[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <094ab4eb-b877-2a14-d6c8-1d9e28335d7d@quicinc.com>
Date: Fri, 28 Jan 2022 15:26:26 -0800
From: Elliot Berman <quic_eberman@...cinc.com>
To: Nick Desaulniers <ndesaulniers@...gle.com>
CC: Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nathan Chancellor <nathan@...nel.org>,
"Matthias Maennich" <maennich@...gle.com>,
<linux-kbuild@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<llvm@...ts.linux.dev>, Fangrui Song <maskray@...gle.com>
Subject: Re: [PATCH v2] kbuild: Add environment variables for userprogs flags
On 1/28/2022 2:49 PM, Nick Desaulniers wrote:
> On Fri, Jan 28, 2022 at 2:45 PM Fangrui Song <maskray@...gle.com> wrote:
>>
>> On 2022-01-28, Elliot Berman wrote:
>>> Allow additional arguments be passed to userprogs compilation.
>>> Reproducible clang builds need to provide a sysroot and gcc path to
>>> ensure same toolchain is used across hosts. KCFLAGS is not currently
>>> used for any user programs compilation, so add new USERCFLAGS and
>>> USERLDFLAGS which serves similar purpose as HOSTCFLAGS/HOSTLDFLAGS.
>>>
>>> Specifically, I'm trying to force CC_CAN_LINK to consistently fail in
>>> an environment where a user sysroot is not specifically available.
>>> Currently, Clang might automatically detect GCC installation on hosts
>>> which have it installed to a default location in /. With addition of
>>> these environment variables, you can specify flags such as:
>>>
>>> $ make USERCFLAGS=--sysroot=/dev/null USERLDFLAGS=-Wl,--sysroot=/dev/null
>>>
>>> to force sysroot detection to fail.
>>
>> -Wl,--sysroot=/dev/null => --sysroot
>>
>> As I mentioned in
>> https://lore.kernel.org/all/20220128031549.w5a4bilxbkppagfu@google.com/
>> -Wl,--sysroot=/dev/null does not suppress search paths like -L/lib .
>
> In that case, Elliot, can you please test whether USERLDFLAGS is
> necessary to be specified AT ALL? Maybe we can drop that addition from
> this patch if so?
USERLDFLAGS as --sysroot=/dev/null isn't necessary and not needed for
the Android kernel usecase. I've included here since we have HOSTLDFLAGS
and LDFLAGS for host programs and kernel respectively.
Powered by blists - more mailing lists