Skip to content

Commit 151b144

Browse files
nickdesaulniersgregkh
authored andcommitted
kbuild: clang: remove crufty HOSTCFLAGS
commit df16aaa upstream. 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 61163ef ("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> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bc342bc commit 151b144

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎Makefile‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,6 @@ HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
369369
HOSTLDFLAGS := $(HOST_LFS_LDFLAGS)
370370
HOST_LOADLIBES := $(HOST_LFS_LIBS)
371371

372-
ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
373-
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
374-
-Wno-missing-field-initializers -fno-delete-null-pointer-checks
375-
endif
376-
377372
# Make variables (CC, etc...)
378373
AS = $(CROSS_COMPILE)as
379374
LD = $(CROSS_COMPILE)ld

0 commit comments

Comments
 (0)