Message ID | 20200910135120.3527468-1-masahiroy@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] kbuild: remove cc-option test of -fno-strict-overflow | expand |
On Thu, Sep 10, 2020 at 10:51:17PM +0900, Masahiro Yamada wrote: > The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. > > Here is the godbolt: > https://godbolt.org/z/odq8h9 > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Appeared in clang 3.0.0 in commit 6e50103acda2b918545f30141edeb991d766f2a4. Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> > --- > > Makefile | 2 +- > arch/arm64/kernel/vdso32/Makefile | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 4b5a305e30d2..059b36f2ea53 100644 > --- a/Makefile > +++ b/Makefile > @@ -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 > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile > index d6adb4677c25..dfffd55175a3 100644 > --- a/arch/arm64/kernel/vdso32/Makefile > +++ b/arch/arm64/kernel/vdso32/Makefile > @@ -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) > -- > 2.25.1 >
On Thu, Sep 10, 2020 at 10:51:17PM +0900, Masahiro Yamada wrote: > The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. > > Here is the godbolt: > https://godbolt.org/z/odq8h9 > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > 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
Hi Will, On Sat, Sep 12, 2020 at 12:22 AM Will Deacon <will@kernel.org> wrote: > > On Thu, Sep 10, 2020 at 10:51:17PM +0900, Masahiro Yamada wrote: > > The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. > > > > Here is the godbolt: > > https://godbolt.org/z/odq8h9 > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > --- > > > > 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 I will apply all to the kbuild tree. Your Ack is appreciated. Thanks.
On Mon, Sep 14, 2020 at 09:51:31PM +0900, Masahiro Yamada wrote: > On Sat, Sep 12, 2020 at 12:22 AM Will Deacon <will@kernel.org> wrote: > > On Thu, Sep 10, 2020 at 10:51:17PM +0900, Masahiro Yamada wrote: > > > The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. > > > > > > Here is the godbolt: > > > https://godbolt.org/z/odq8h9 > > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > > --- > > > > > > 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. > > I will apply all to the kbuild tree. > Your Ack is appreciated. For both: Acked-by: Will Deacon <will@kernel.org> Will
diff --git a/Makefile b/Makefile index 4b5a305e30d2..059b36f2ea53 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index d6adb4677c25..dfffd55175a3 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile @@ -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)
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/odq8h9 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)