From d49358f7959bb52c3e7ff67d37c21a1b294adf72 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 10 Oct 2013 12:44:11 -0500 Subject: [PATCH] xcompile: always use -march=i686 When compiling coreboot for x86 on gcc the compiler is free to pick whatever defaults it is using at the time of gcc's compile/configuration when no -march is specified. Not properly specifying -march then opens up the use of SSE instructions for copmilation units it should not be used such as the SMM module as this module doesn't save/restore SSE registers. BUG=chrome-os-partner:22991 BRANCH=None TEST=Built and confirmed -march=i686 was used on command line. Also noted not xmm registers were produced grep'ing through objdump output. Change-Id: I64d4a6c5fa9fadb4b35bc7097458e992a094dcba Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/172640 Reviewed-by: Stefan Reinauer --- util/xcompile/xcompile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index 8eea8cb94d..9019788749 100644 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -106,6 +106,11 @@ detect_special_flags() { # Use bfd linker instead of gold if available: testcc "$CC" "$CFLAGS -fuse-ld=bfd" && CFLAGS="$CFLAGS -fuse-ld=bfd" && LINKER_SUFFIX_i386='.bfd' + # 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 + # specify -mmsse, etc flags. + CFLAGS="$CFLAGS -march=i686" ;; arm ) ARMFLAGS=""