summaryrefslogtreecommitdiff
path: root/arch/x86/config.mk
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-07-27 06:12:35 -0700
committerBin Meng <bmeng.cn@gmail.com>2017-08-01 20:17:02 +0800
commite719b6b0f8fa5c6f3f4aeaa319dcf17d735153f8 (patch)
treedbb66060302447fdbc77e1a37312f3c1ab4cff5e /arch/x86/config.mk
parent9a95f51ffecc8ff9cf09db1615c1a580731b722f (diff)
x86: Enforce toolchain to generate 64-bit codes for 64-bit U-Boot
64-bit U-Boot image is a combination of 32-bit U-Boot (SPL) plus 64-bit U-Boot (proper). For the U-Boot proper, it has be compiled to 64-bit object codes. Attempting to use a toolchain to compile 64-bit U-Boot for qemu-x86_64, like kernel.org 4.9 i386-linux-gcc, fails with the following errors: arch/x86/cpu/intel_common/microcode.c:79:2: error: PIC register clobbered by 'ebx' in 'asm' The issue is because toolchain is preconfigured to generate code for the 32-bit architecture (i386), and currently '-m64' is missing in the makefile fragment. Using kernel.org 4.9 x86_64-linux-gcc works out of the box, since it is preconfigured to generate 64-bit codes. When compiling U-Boot SPL, '-m32' is passed to the toolchain, no mater 32-bit (i386-linux-) or 64-bit (x86_64-linux) the toolchain is preconfigured to generate. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/config.mk')
-rw-r--r--arch/x86/config.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 043425e5e3..8835dcf36f 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -26,7 +26,7 @@ endif
ifeq ($(IS_32BIT),y)
PLATFORM_CPPFLAGS += -march=i386 -m32
else
-PLATFORM_CPPFLAGS += $(if $(CONFIG_SPL_BUILD),,-fpic) -fno-common
+PLATFORM_CPPFLAGS += $(if $(CONFIG_SPL_BUILD),,-fpic) -fno-common -m64
endif
PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden