[coreboot-gerrit] New patch to review for coreboot: xcompile: Add a way to specify -march=i586
Martin Roth (martinroth@google.com)
gerrit at coreboot.org
Tue Feb 2 01:34:36 CET 2016
Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13552
-gerrit
commit e369c74cff35bdc583a4c6b4efe32136c4d3bbf6
Author: Martin Roth <martinroth at google.com>
Date: Mon Feb 1 17:33:37 2016 -0700
xcompile: Add a way to specify -march=i586
Instead of instructing users to edit xcompile when they want to build
a quark platform, give the build a way to set -march=586 so that
the quark code will build correctly. The Quark processor does not
support the instructions introduced with the Pentium 6 architecture.
Change-Id: I0ed69aadc515f86f76800180e0e33bcd75feac5a
Signed-off-by: Martin Roth <martinroth at google.com>
---
src/arch/x86/Kconfig | 6 ++++++
util/xcompile/xcompile | 27 ++++++++++++++++++++++-----
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 738e7d1..49f940a 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -58,6 +58,12 @@ config ARCH_RAMSTAGE_X86_64
bool
default n
+config USE_MARCH_586
+ def_bool n
+ help
+ Allow a platform or processor to select to be compiled using
+ the '-march=i586' option instead of the typical '-march=i686'
+
# This is an SMP option. It relates to starting up APs.
# It is usually set in mainboard/*/Kconfig.
# TODO: Improve description.
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 1765183..79c8a4c 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -182,11 +182,6 @@ detect_special_flags() {
case "$architecture" in
x86)
- # 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_GCC="$CFLAGS_GCC -march=i686"
;;
x64)
;;
@@ -224,6 +219,27 @@ GCC_CC_${TARCH}:=${GCC}
GCC_CFLAGS_${TARCH}:=${CFLAGS_GCC}
GCC_COMPILER_RT_${TARCH}:=${CC_RT_GCC}
GCC_COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_GCC}
+EOF
+
+# Generally the x86 should 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.
+# The Quark processor doesn't support the instructions
+# introduced with the Pentium 6 architecture, so allow it
+# to use i586 instead.
+if [ "${TARCH}" = "x86_64" ] || [ "${TARCH}" = "x86_32" ]; then
+cat <<EOF
+
+ifeq (\$(CONFIG_USE_MARCH_586),y)
+ GCC_CFLAGS_${TARCH} += -march=i586
+else
+ GCC_CFLAGS_${TARCH} += -march=i686
+endif
+EOF
+fi
+
+cat <<EOF
# Clang
CLANG_CC_${TARCH}:=${CLANG}
@@ -245,6 +261,7 @@ else
COMPILER_RT_${TARCH}:=\$(CLANG_COMPILER_RT_${TARCH})
COMPILER_RT_FLAGS_${TARCH}:=\$(CLANG_COMPILER_RT_FLAGS_${TARCH})
endif
+
CPP_${TARCH}:=${GCCPREFIX}cpp
AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS}
LD_${TARCH}:=${GCCPREFIX}ld${LINKER_SUFFIX} ${LDFLAGS}
More information about the coreboot-gerrit
mailing list