linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Elliot Berman <quic_eberman@quicinc.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Nathan Chancellor <nathan@kernel.org>,
	Fangrui Song <maskray@google.com>,
	Matthias Maennich <maennich@google.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] kbuild: Add environment variables for userprogs flags
Date: Fri, 28 Jan 2022 11:40:56 +0900	[thread overview]
Message-ID: <CAK7LNAQ4wXjLfz_+6QeT06tKr_2Pan0qtxf=adKQtCNagZ+5wQ@mail.gmail.com> (raw)
In-Reply-To: <20220112224342.958358-1-quic_eberman@quicinc.com>

(+CC: Arnd)

On Thu, Jan 13, 2022 at 7:44 AM Elliot Berman <quic_eberman@quicinc.com> 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, our build environment can do like
> "--sysroot=/dev/null" to force sysroot detection to fail.
>
> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
> ---


> --- a/usr/include/Makefile
> +++ b/usr/include/Makefile
> @@ -12,6 +12,9 @@ UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration
>  # It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64.
>  UAPI_CFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
>
> +# USERCFLAGS might contain sysroot location for CC
> +UAPI_CFLAGS += $(USERCFLAGS)
>

I am OK with this patch, but I was not sure with this line.

Initially, I thought exported UAPI headers should be self-contained.
In other words, we should be able to compile-test them without
relying on compiler or libc headers.

Is this achievable or not?

I think Arnd is an expert in this area.
I hope some input from him.





 +
>  override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
>
>  # The following are excluded for now because they fail to build.
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

  parent reply	other threads:[~2022-01-28  2:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 22:43 [PATCH] kbuild: Add environment variables for userprogs flags Elliot Berman
2022-01-26 18:21 ` Nick Desaulniers
2022-01-27 11:25   ` Masahiro Yamada
2022-01-28  3:15   ` Fangrui Song
2022-01-28 19:40     ` Elliot Berman
2022-01-28 20:10       ` Fangrui Song
2022-01-28 20:06   ` Elliot Berman
2022-01-28  2:40 ` Masahiro Yamada [this message]
2022-01-28 22:08 ` [PATCH v2] " Elliot Berman
2022-01-28 22:45   ` Fangrui Song
2022-01-28 22:49     ` Nick Desaulniers
2022-01-28 23:26       ` Elliot Berman
2022-01-28 23:29         ` Nick Desaulniers
2022-01-28 22:48   ` Nick Desaulniers
2022-02-01 21:35 ` [PATCH v3] " Elliot Berman
2022-02-01 21:38   ` Nick Desaulniers
2022-02-01 22:03     ` Fāng-ruì Sòng
2022-02-08 22:53     ` Nick Desaulniers
2022-02-10  0:29       ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNAQ4wXjLfz_+6QeT06tKr_2Pan0qtxf=adKQtCNagZ+5wQ@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=arnd@arndb.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=maennich@google.com \
    --cc=maskray@google.com \
    --cc=michal.lkml@markovi.net \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=quic_eberman@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).