Skip to content

Commit 2bce1b4

Browse files
nickdesaulnierskok-o3
authored andcommitted
Revert "kbuild: disable clang's default use of -fmerge-all-constants"
This reverts commit 3e11309. -fno-merge-all-constants has been the default since clang-6; the minimum supported version of clang in the kernel is clang-10 (10.0.1). Suggested-by: Nathan Chancellor <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Sedat Dilek <[email protected]> Reviewed-by: Fangrui Song <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Sedat Dilek <[email protected]> Reviewed-by: Kees Cook <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Marco Elver <[email protected]> Cc: Miguel Ojeda <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Vincenzo Frascino <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Link: https://reviews.llvm.org/rL329300. Link: ClangBuiltLinux/linux#9 Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Adithya R <[email protected]>
1 parent 0658f83 commit 2bce1b4

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -956,15 +956,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
956956
# disable invalid "can't wrap" optimizations for signed / pointers
957957
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
958958

959-
# clang sets -fmerge-all-constants by default as optimization, but this
960-
# is non-conforming behavior for C and in fact breaks the kernel, so we
961-
# need to disable it here generally.
962-
KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
963-
964-
# for gcc -fno-merge-all-constants disables everything, but it is fine
965-
# to have actual conforming behavior enabled.
966-
KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)
967-
968959
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
969960
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
970961

0 commit comments

Comments
 (0)