libpayload: Enable building libpayload with march=i586

Add a Kconfig value to enable building libpayload with the 586 compiler.
Update the cross compiler script to add the Kconfig value name that is
used when libpayload builds.

The Quark SOC does not support some of the instructions generated with
the 686 compiler (e.g. CMOV).  Success occurs when
payloads/libpayload/build/config.h indicates that
CONFIG_LP_USE_MARCH_586=1.

TEST=Build and run on Galileo Gen2.

Change-Id: I04907e9a38ee139bae2e8b227821f54614707c25
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/20322
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Lee Leahy 2017-06-20 14:33:28 -07:00
parent 08bb837268
commit 6796d787c5
2 changed files with 9 additions and 1 deletions

View File

@ -157,6 +157,14 @@ config BASE_ADDRESS
endmenu endmenu
config USE_MARCH_586
bool "Use march=586 qualifier to build"
default n
depends on ARCH_X86
help
Allow a platform or processor to select to be compiled using
the '-march=i586' option instead of the typical '-march=i686'
menu "Standard Libraries" menu "Standard Libraries"
config LIBC config LIBC

View File

@ -239,7 +239,7 @@ EOF
if [ "${TARCH}" = "x86_64" ] || [ "${TARCH}" = "x86_32" ]; then if [ "${TARCH}" = "x86_64" ] || [ "${TARCH}" = "x86_32" ]; then
cat <<EOF cat <<EOF
ifeq (\$(CONFIG_USE_MARCH_586),y) ifneq (\$(CONFIG_USE_MARCH_586)\$(CONFIG_LP_USE_MARCH_586),)
GCC_CFLAGS_${TARCH} += -march=i586 GCC_CFLAGS_${TARCH} += -march=i586
else else
GCC_CFLAGS_${TARCH} += -march=i686 GCC_CFLAGS_${TARCH} += -march=i686