New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 772182 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Kernel is using gcc as host compiler with USE="clang"

Project Member Reported by manojgupta@chromium.org, Oct 5 2017

Issue description

The kernel ebuilds still use gcc as the host compiler when building with USE="clang".
I believe this behavior is not desired since we probably want to maintain a gcc free environment with USE="clang".

 
We'll also have to make sure that the tools sub-build don't somehow end up back at gcc.  Some discussion in <https://patchwork.kernel.org/patch/9983537/> though that patch turned out to be the wrong way to solve it...
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/c1d9d88a06df47ab01821366004ce5da4bfcc08d

commit c1d9d88a06df47ab01821366004ce5da4bfcc08d
Author: Manoj Gupta <manojgupta@google.com>
Date: Fri Oct 06 22:51:13 2017

cros-kernel2: Use clang as the host compiler with USE="clang"

cros_use_gcc call forces gcc as the host compiler. There is
no need to call this with USE="clang".

Before this CL:
HOSTCC = x86_64-pc-linux-gnu-gcc with USE="clang"

With this CL:
HOSTCC = x86_64-pc-linux-gnu-clang with USE="clang"

There are some new warnings printed about '-fno-delete-null-pointer-checks' but
these should be harmless. Rest of the kernel build logs are identical.

BUG= chromium:772182 
TEST=Compiled kevin and swanky 4.4 kernels.

Change-Id: I25f912850aea1674f9b3e342523269507d03b882
Reviewed-on: https://chromium-review.googlesource.com/703984
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/c1d9d88a06df47ab01821366004ce5da4bfcc08d/eclass/cros-kernel2.eclass

Status: Verified (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 15 2017

Labels: merge-merged-chromeos-4.12
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d9c5a616f59b1d5a932282d63ff6897b35774e51

commit d9c5a616f59b1d5a932282d63ff6897b35774e51
Author: Nick Desaulniers <nick.desaulniers@gmail.com>
Date: Fri Oct 13 21:44:57 2017

FROMGIT: kbuild: clang: remove crufty HOSTCFLAGS

When compiling with `make CC=clang HOSTCC=clang`, I was seeing warnings
that clang did not recognize -fno-delete-null-pointer-checks for HOSTCC
targets.  These were added in commit 61163efae020 ("kbuild: LLVMLinux:
Add Kbuild support for building kernel with Clang").

Clang does not support -fno-delete-null-pointer-checks, so adding it to
HOSTCFLAGS if HOSTCC is clang does not make sense.

It's not clear why the other warnings were disabled, and just for
HOSTCFLAGS, but I can remove them, add -Werror to HOSTCFLAGS and compile
with clang just fine.

Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

(cherry-picked from git-kernel.org masahiroy/linux-kbuild kbuild
commit f984e0ccc4d9d05538475b42c18069e6b0a9d774)

BUG= chromium:772182 
TEST=USE=clang emerge-pyro chromeos-kernel-4_12
  => no warnings about -fno-delete-null-pointer-checks

Change-Id: I75b0a3b3b4fac17f3870ce1330e583300495c69b
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/716518
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>

[modify] https://crrev.com/d9c5a616f59b1d5a932282d63ff6897b35774e51/Makefile

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 15 2017

Labels: merge-merged-chromeos-4.4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/29e36e5a4159b012a20e71614b4dcd25742f0fa4

commit 29e36e5a4159b012a20e71614b4dcd25742f0fa4
Author: Matthias Kaehlcke <mka@chromium.org>
Date: Fri Oct 13 21:45:05 2017

FROMGIT: kbuild: clang: remove crufty HOSTCFLAGS

When compiling with `make CC=clang HOSTCC=clang`, I was seeing warnings
that clang did not recognize -fno-delete-null-pointer-checks for HOSTCC
targets.  These were added in commit 61163efae020 ("kbuild: LLVMLinux:
Add Kbuild support for building kernel with Clang").

Clang does not support -fno-delete-null-pointer-checks, so adding it to
HOSTCFLAGS if HOSTCC is clang does not make sense.

It's not clear why the other warnings were disabled, and just for
HOSTCFLAGS, but I can remove them, add -Werror to HOSTCFLAGS and compile
with clang just fine.

Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

(cherry-picked from git-kernel.org masahiroy/linux-kbuild kbuild
commit f984e0ccc4d9d05538475b42c18069e6b0a9d774)

BUG= chromium:772182 
TEST=USE=clang emerge-pyro chromeos-kernel-4_4
  => no warnings about -fno-delete-null-pointer-checks

Change-Id: I75b0a3b3b4fac17f3870ce1330e583300495c69b
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/716703
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>

[modify] https://crrev.com/29e36e5a4159b012a20e71614b4dcd25742f0fa4/Makefile

Sign in to add a comment