[coreboot-gerrit] New patch to review for coreboot: Unconditionally compile romstage with -Wa, --divide

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Tue Jul 7 00:55:10 CEST 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10817

-gerrit

commit a27604512915c12a8c15c173ee86ffa0e7e5509a
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Tue Jul 7 00:32:47 2015 +0200

    Unconditionally compile romstage with -Wa,--divide
    
    The option --divide is required by our assembler to ensure that
    '/' is not parsed as a comment sign but as a division, because
    some of the cache as ram code is using divisions.
    
    The --divide parameter has been part of the GNU as since binutils 2.17.
    Hence, compile romstage (which contains cache as ram init) with
    -Wa,--divide unconditionally instead of probing for it and adding it to
    all compiler invocations (because that is causing random trouble with
    clang when compiling the SMM code and calling gcc with --divide instead of
    -Wa,--divide)
    
    Change-Id: Ideefb2a243dc1d657ba415a99c1f8ab1d93800e0
    Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
 src/arch/x86/Makefile.inc | 3 +++
 util/xcompile/xcompile    | 8 --------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index f502bbe..20740a4 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -247,6 +247,9 @@ $(objgenerated)/crt0.S: $$(crt0s)
 # Compiling crt0 with -g seems to trigger https://sourceware.org/bugzilla/show_bug.cgi?id=6428
 romstage-S-ccopts += -I. -g0
 
+# Some cache as ram code is doing divisions
+romstage-S-ccopts +=-Wa,--divide
+
 endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
 
 ###############################################################################
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 7ae1e39..884d7b8 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -143,10 +143,6 @@ detect_special_flags() {
 
 	case "$architecture" in
 	x86)
-		testcc "$GCC"      "$CFLAGS_GCC -Wa,--divide" &&
-			CFLAGS_GCC="$CFLAGS_GCC -Wa,--divide"
-		testcc "$CLANG"      "$CFLAGS_CLANG -Wa,--divide" &&
-			CFLAGS_CLANG="$CFLAGS_CLANG -Wa,--divide"
 		# Always build for i686 -- no sse/mmx instructions since SMM
 		# modules are compiled using these flags. Note that this
 		# doesn't prevent a project using xcompile to explicitly
@@ -154,10 +150,6 @@ detect_special_flags() {
 		CFLAGS_GCC="$CFLAGS_GCC  -march=i686"
 		;;
 	x64)
-		testcc "$GCC"      "$CFLAGS_GCC -Wa,--divide" &&
-			CFLAGS_GCC="$CFLAGS_GCC -Wa,--divide"
-		testcc "$CLANG"      "$CFLAGS_CLANG -Wa,--divide" &&
-			CFLAGS_CLANG="$CFLAGS_CLANG -Wa,--divide"
 		;;
 	mipsel)
 		testcc "$GCC" "$CFLAGS_GCC -mno-abicalls -fno-pic" && \



More information about the coreboot-gerrit mailing list