summaryrefslogtreecommitdiff
path: root/util/xcompile
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-10-10 12:44:11 -0500
committerIsaac Christensen <isaac.christensen@se-eng.com>2014-08-25 23:33:20 +0200
commit8414d3c0b407d9afc6a2446dba3ca358da2c7bb6 (patch)
tree58ec86e36aaae70fc41a3bdd760e70fd9501a8e2 /util/xcompile
parent9518b56ab079f4c12eefe83cc9b4fa24b413ebe8 (diff)
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 compilation units it should not be used such as the SMM module as this module doesn't save/restore SSE registers. Change-Id: I64d4a6c5fa9fadb4b35bc7097458e992a094dcba Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/172640 Reviewed-by: Stefan Reinauer <reinauer@google.com> (cherry picked from commit d49358f7959bb52c3e7ff67d37c21a1b294adf72) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6716 Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/xcompile')
-rwxr-xr-xutil/xcompile/xcompile5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 01d75bf337..4b18942be2 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -138,6 +138,11 @@ detect_special_flags() {
x86)
testcc "$CC" "$CFLAGS -Wa,--divide" &&
CFLAGS="$CFLAGS -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
+ # specify -mmsse, etc flags.
+ CFLAGS="$CFLAGS -march=i686"
;;
esac
}