lkml.org 
[lkml]   [2022]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] kbuild: Add environment variables for userprogs flags
From


On 1/28/2022 2:49 PM, Nick Desaulniers wrote:
> On Fri, Jan 28, 2022 at 2:45 PM Fangrui Song <maskray@google.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.

\
 
 \ /
  Last update: 2022-01-29 00:26    [W:0.060 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site