kbuild: remove cc-option test of -fno-strict-overflow
PATCH 1/4 kbuild: remove cc-option test of -fno-strict-overflow
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/odq8h9
---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
@@ -922,7 +922,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, restrict) KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) # disable invalid "can't wrap" optimizations for signed / pointers -KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) +KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we
arch/arm64/kernel/vdso32/Makefile +1 -1
@@ -90,7 +90,7 @@ VDSO_CFLAGS += -O2 # Some useful compiler-dependent flags from top-level Makefile VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) -VDSO_CFLAGS += $(call cc32-option,-fno-strict-overflow) +VDSO_CFLAGS += -fno-strict-overflow VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types)
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 4/4 kbuild: remove cc-option test of -Werror=date-time
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/xvjcMa
---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
@@ -940,7 +940,7 @@ KBUILD_CFLAGS += -fno-stack-check KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) # Prohibit date/time macros, which would make the build non-deterministic -KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) +KBUILD_CFLAGS += -Werror=date-time # enforce correct pointer usage KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
arch/arm64/kernel/vdso32/Makefile +1 -1
@@ -92,7 +92,7 @@ VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) VDSO_CFLAGS += -fno-strict-overflow VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) -VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) +VDSO_CFLAGS += -Werror=date-time VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types) # The 32-bit compiler does not provide 128-bit integers, which are used in
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 6 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/odq8h9Signed-off-by Masahiro Yamada <[email protected]>
Appeared in clang 3.0.0 in commit 6e50103acda2b918545f30141edeb991d766f2a4.
Quoted 35 lines
---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Makefile +1
-1@@ -922,7 +922,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, restrict) KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) # disable invalid "can't wrap" optimizations for signed / pointers -KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) +KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so wearch/arm64/kernel/vdso32/Makefile +1
-1@@ -90,7 +90,7 @@ VDSO_CFLAGS += -O2 # Some useful compiler-dependent flags from top-level Makefile VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) -VDSO_CFLAGS += $(call cc32-option,-fno-strict-overflow) +VDSO_CFLAGS += -fno-strict-overflow VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types)Signature · 1 line
2.25.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 3/4] kbuild: remove cc-option test of -fno-stack-check
In reply to Masahiro YamadaQuoted 6 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/59cK6oSigned-off-by Masahiro Yamada <[email protected]>
This flag is technically ignored by clang (see commit 05b0798916f01690b5903302e51f3136274e291f) but that obviously does not matter for the sake of this.
Quoted 21 lines
---
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -934,7 +934,7 @@ KBUILD_CFLAGS += -fno-merge-all-constants KBUILD_CFLAGS += $(call cc-option,-fmerge-constants) # Make sure -fstack-check isn't enabled (like gentoo apparently did) -KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) +KBUILD_CFLAGS += -fno-stack-check # conserve stack if available KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)Signature · 1 line
2.25.1
Re: [PATCH 2/4] kbuild: remove cc-option test of -fno-merge-all-constants
In reply to Masahiro YamadaQuoted 6 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/8T4177Signed-off-by Masahiro Yamada <[email protected]>
For what it's worth, the commit that introduced this block is going to be reverted:
https://lore.kernel.org/mm-commits/20200903201518.JKrRS%[email protected]/
Regardless, it was introduced in LLVM 2.7.0 in commit f9d41df0930986c52e198292cf875eb5d1761ece.
Quoted 21 lines
---
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -927,7 +927,7 @@ KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we # need to disable it here generally. -KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants) +KBUILD_CFLAGS += -fno-merge-all-constants # for gcc -fno-merge-all-constants disables everything, but it is fine # to have actual conforming behavior enabled.Signature · 1 line
2.25.1
Re: [PATCH 4/4] kbuild: remove cc-option test of -Werror=date-time
In reply to Masahiro YamadaQuoted 6 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/xvjcMaSigned-off-by Masahiro Yamada <[email protected]>
Introduced in clang 3.5.0, see commit4f43e554081ecac149fe360bee6eef2ed7dab8ea in LLVM.
Quoted 35 lines
---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Makefile +1
-1@@ -940,7 +940,7 @@ KBUILD_CFLAGS += -fno-stack-check KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) # Prohibit date/time macros, which would make the build non-deterministic -KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) +KBUILD_CFLAGS += -Werror=date-time # enforce correct pointer usage KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)arch/arm64/kernel/vdso32/Makefile +1
-1@@ -92,7 +92,7 @@ VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) VDSO_CFLAGS += -fno-strict-overflow VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) -VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) +VDSO_CFLAGS += -Werror=date-time VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types) # The 32-bit compiler does not provide 128-bit integers, which are used inSignature · 1 line
2.25.1
Re: [PATCH 2/4] kbuild: remove cc-option test of -fno-merge-all-constants
In reply to Nathan ChancellorQuoted 7 lines · Nathan Chancellor
Quoted 5 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/8T4177
Quoted 6 lines
Quoted 1 line
Signed-off-by Masahiro Yamada <[email protected]>For what it's worth, the commit that introduced this block is going to be reverted:
https://lore.kernel.org/mm-commits/20200903201518.JKrRS%[email protected]/
My bad - you are right.
This hunk has already gone by Nick's patch.
Thanks.
Quoted 31 lines
Regardless, it was introduced in LLVM 2.7.0 in commit
f9d41df0930986c52e198292cf875eb5d1761ece.Reviewed-by Nathan Chancellor <[email protected]>Quoted 19 lines
---
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-2@@ -927,7 +927,7 @@ KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we # need to disable it here generally. -KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants) +KBUILD_CFLAGS += -fno-merge-all-constants # for gcc -fno-merge-all-constants disables everything, but it is fine # to have actual conforming behavior enabled. --Quoted 2 lines
2.25.1
--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200910163311.GB3119896%40ubuntu-n2-xlarge-x86.
Signature · 2 lines
Best Regards Masahiro Yamada
PATCH 2/4 kbuild: remove cc-option test of -fno-merge-all-constants
In reply to Masahiro YamadaThe minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/8T4177
---
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -927,7 +927,7 @@ KBUILD_CFLAGS += -fno-strict-overflow # clang sets -fmerge-all-constants by default as optimization, but this # is non-conforming behavior for C and in fact breaks the kernel, so we # need to disable it here generally. -KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants) +KBUILD_CFLAGS += -fno-merge-all-constants # for gcc -fno-merge-all-constants disables everything, but it is fine # to have actual conforming behavior enabled.
Signature · 1 line
2.25.1
PATCH 3/4 kbuild: remove cc-option test of -fno-stack-check
In reply to Masahiro YamadaThe minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/59cK6o
---
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -934,7 +934,7 @@ KBUILD_CFLAGS += -fno-merge-all-constants KBUILD_CFLAGS += $(call cc-option,-fmerge-constants) # Make sure -fstack-check isn't enabled (like gentoo apparently did) -KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,) +KBUILD_CFLAGS += -fno-stack-check # conserve stack if available KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
Signature · 1 line
2.25.1
Will Deacon
maintainerQuoted 11 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/odq8h9Signed-off-by Masahiro Yamada <[email protected]>---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
This, and the other patch (4/4 -- I didn't see 2 or 3), look good to me. Are you taking them via the kbuild tree, or shall I queue them in the arm64 tree? Please just let me know what you prefer.
Will
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Will,
Quoted 14 lines · Will Deacon
Quoted 11 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/odq8h9Signed-off-by Masahiro Yamada <[email protected]>---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 5 lines
This, and the other patch (4/4 -- I didn't see 2 or 3), look good to me. Are you taking them via the kbuild tree, or shall I queue them in the arm64 tree? Please just let me know what you prefer.
Will
I will apply all to the kbuild tree.
Your Ack is appreciated.
Thanks.
Signature · 7 lines
Best Regards Masahiro Yamada _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 14 lines · Masahiro Yamada
Quoted 13 lines · Will Deacon
Quoted 11 lines · Masahiro Yamada
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag.
Here is the godbolt:
https://godbolt.org/z/odq8h9Signed-off-by Masahiro Yamada <[email protected]>---
Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 3 lines
This, and the other patch (4/4 -- I didn't see 2 or 3), look good to me. Are you taking them via the kbuild tree, or shall I queue them in the arm64 tree? Please just let me know what you prefer.
I will apply all to the kbuild tree.
Your Ack is appreciated.
For both:
Will
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel