From: Nathan Chancellor <natechancellor@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Guillaume Tucker <guillaume.tucker@collabora.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
Mark Brown <broonie@kernel.org>,
Guenter Roeck <linux@roeck-us.net>,
clang-built-linux <clang-built-linux@googlegroups.com>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
kernel@collabora.com
Subject: Re: [PATCH RFC 1/1] kbuild: enable overriding the compiler using the environment
Date: Thu, 8 Aug 2019 22:15:52 -0700 [thread overview]
Message-ID: <20190809051552.GA44466@archlinux-threadripper> (raw)
In-Reply-To: <CAKwvOdmOdJspcO8jqUhqR63-MOWkV3ZrVcCO6u=HG6peov8Htw@mail.gmail.com>
On Thu, Aug 08, 2019 at 03:42:32PM -0700, 'Nick Desaulniers' via Clang Built Linux wrote:
> On Thu, Aug 8, 2019 at 2:07 PM Guillaume Tucker
> <guillaume.tucker@collabora.com> wrote:
> >
> > Only use gcc/g++ for HOSTCC, HOSTCXX and CC by default if they are not
> > already defined in the environment. This fixes cases such as building
> > host tools with clang without having gcc installed.
> >
> > The issue was initially hit when running merge_config.sh with clang
> > only as it failed to build "HOSTCC scripts/basic/fixdep".
>
> Thanks for the patch. I don't quite follow the exact error.
>
> When building with Clang, I usually do:
>
> $ make CC=clang HOSTCC=clang ...
>
> are you trying to fix the case where you do:
>
> $ make CC=clang ...
> <no HOSTCC set>
> when GCC is not installed? Because if so, I think it would be easier
> to just specify HOSTCC=clang, but maybe I'm misunderstanding the
> issue?
As I understand it,
$ make CC=clang HOSTCC=clang
works fine. What doesn't currently work is:
$ export CC=clang
$ export HOSTCC=clang
$ make
This is problematic because there is no way for CC, HOSTCC, and HOSTCXX
to be passed to make within scripts/kconfig/merge_config.sh.
A quick test before and after the patch:
$ ( export HOSTCC=clang; make -j$(nproc) O=out defconfig V=1 )
...
gcc -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wmissing-prototypes...
gcc -Wp,-MD,scripts/kconfig/.confdata.o.d -Wall -Wmissing-prototypes...
...
$ ( export HOSTCC=clang; make -j$(nproc) O=out defconfig V=1 )
...
clang -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes...
clang -Wp,-MD,scripts/kconfig/.confdata.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes...
...
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
I wonder if all variable should be converted to that scheme or just the
ones that are needed in this instance. I also wonder if this will cause
any issues with people who define these variables in their environment
already; if so, maybe merge_config.sh should be updated to support
passing CC, HOSTCC, and HOSTCXX to make.
Cheers,
Nathan
next prev parent reply other threads:[~2019-08-09 5:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 21:06 [PATCH RFC 0/1] kbuild: enable overriding the compiler using the environment Guillaume Tucker
2019-08-08 21:06 ` [PATCH RFC 1/1] " Guillaume Tucker
2019-08-08 22:35 ` Mark Brown
2019-08-12 13:13 ` Guillaume Tucker
2019-08-08 22:42 ` Nick Desaulniers
2019-08-08 22:54 ` Mark Brown
2019-08-09 5:15 ` Nathan Chancellor [this message]
2019-08-12 13:33 ` Guillaume Tucker
2019-08-12 16:37 ` Masahiro Yamada
2019-08-12 17:14 ` Mark Brown
2019-08-12 17:33 ` Nick Desaulniers
2019-08-08 22:17 ` [PATCH RFC 0/1] " Mark Brown
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=20190809051552.GA44466@archlinux-threadripper \
--to=natechancellor@gmail.com \
--cc=broonie@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=guillaume.tucker@collabora.com \
--cc=kernel@collabora.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=yamada.masahiro@socionext.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