Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33579
Change subject: Move -Wlogical-op into xcompile ......................................................................
Move -Wlogical-op into xcompile
Clang doesn't know `-Wlogical-op`, so let's move it into xcompile where we can easily check if it's supported.
Change-Id: I6a50de0bc5372f61337f237383d32645ba86b0fd Signed-off-by: Nico Huber nico.huber@secunet.com --- M Makefile.inc M util/xcompile/xcompile 2 files changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/33579/1
diff --git a/Makefile.inc b/Makefile.inc index 48879bc..7ac0a82 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -401,7 +401,7 @@
CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wlogical-op +CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index 7ab1cb7..052b88f 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -203,6 +203,9 @@ CFLAGS_GCC+=" -EL" ;; esac + + # Generally available in GCC but not in Clang: + CFLAGS_GCC="$CFLAGS_GCC -Wlogical-op" }
detect_compiler_runtime() {
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 1: Code-Review+1
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 1: Code-Review+1
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 1: Code-Review+2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 1: -Code-Review
gnat1: error: command line option '-Wlogical-op' is valid for C/C++/ObjC/ObjC++ but not for Ada [-Werror]
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 1: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 2:
Not sure if that's better?
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 2: Code-Review+2
Patch Set 2:
Not sure if that's better?
It is. It's somewhat weird to expect the ada compiler to accept all cflags anyway.
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Patch Set 2: Code-Review+2
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33579 )
Change subject: Move -Wlogical-op into xcompile ......................................................................
Move -Wlogical-op into xcompile
Clang doesn't know `-Wlogical-op`, so let's move it into xcompile where we can easily distinguish between the two. However, this requires us to split out `GCC_ADAFLAGS*` from `GCC_CFLAGS*`.
Change-Id: I6a50de0bc5372f61337f237383d32645ba86b0fd Signed-off-by: Nico Huber nico.huber@secunet.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/33579 Reviewed-by: Patrick Georgi pgeorgi@google.com Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M Makefile.inc M toolchain.inc M util/xcompile/xcompile 3 files changed, 5 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved HAOUAS Elyes: Looks good to me, approved
diff --git a/Makefile.inc b/Makefile.inc index 48879bc..7ac0a82 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -401,7 +401,7 @@
CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wlogical-op +CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie diff --git a/toolchain.inc b/toolchain.inc index 0486287..875cb20 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -131,7 +131,7 @@ STRIP_$(1) := $(STRIP_$(2)) READELF_$(1) := $(READELF_$(2)) CFLAGS_$(1) = $$(CFLAGS_common) $$(CFLAGS_$(2)) -ADAFLAGS_$(1) = --RTS=$$(obj)/libgnat-$(2)/ $$(ADAFLAGS_common) $$(GCC_CFLAGS_$(2)) +ADAFLAGS_$(1) = --RTS=$$(obj)/libgnat-$(2)/ $$(ADAFLAGS_common) $$(GCC_ADAFLAGS_$(2)) CPPFLAGS_$(1) = $$(CPPFLAGS_common) $$(CPPFLAGS_$(2)) -D__ARCH_$(2)__ COMPILER_RT_$(1) := $$(COMPILER_RT_$(2)) COMPILER_RT_FLAGS_$(1) := $$(COMPILER_RT_FLAGS_$(2)) diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index 050cc59..e8d6677 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -225,6 +225,9 @@ # GCC GCC_CC_${TARCH}:=${GCC} GCC_CFLAGS_${TARCH}:=${CFLAGS_GCC} +# Generally available for GCC's cc1: +GCC_CFLAGS_${TARCH}+=-Wlogical-op +GCC_ADAFLAGS_${TARCH}:=${CFLAGS_GCC} GCC_COMPILER_RT_${TARCH}:=${CC_RT_GCC} GCC_COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_GCC}