aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-02-27 17:09:10 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2012-02-27 17:09:10 -0500
commit0bf6276392e990dd0da0ccd8e10f42597d503f29 (patch)
tree11c01cc99a28ab84f8d8790baedd104bb825e970 /arch/x86
parente0a449cab53814b73faf824284a6b3809b9b1316 (diff)
x32: Warn and disable rather than error if binutils too old
If X32 is enabled in .config, but the binutils can't build it, issue a warning and disable the feature rather than erroring out. In order to support this, have CONFIG_X86_X32 be the option set in Kconfig, and CONFIG_X86_X32_ABI be the option set by the Makefile when it is enabled and binutils has been found to be functional. Requested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: H. J. Lu <hjl.tools@gmail.com> Link: http://lkml.kernel.org/r/1329696488-16970-1-git-send-email-hpa@zytor.com
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Kconfig4
-rw-r--r--arch/x86/Makefile16
2 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c9d6c9ed27e5..e2b38b4bffdc 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2175,7 +2175,7 @@ config IA32_AOUT
2175 ---help--- 2175 ---help---
2176 Support old a.out binaries in the 32bit emulation. 2176 Support old a.out binaries in the 32bit emulation.
2177 2177
2178config X86_X32_ABI 2178config X86_X32
2179 bool "x32 ABI for 64-bit mode (EXPERIMENTAL)" 2179 bool "x32 ABI for 64-bit mode (EXPERIMENTAL)"
2180 depends on X86_64 && IA32_EMULATION && EXPERIMENTAL 2180 depends on X86_64 && IA32_EMULATION && EXPERIMENTAL
2181 ---help--- 2181 ---help---
@@ -2190,7 +2190,7 @@ config X86_X32_ABI
2190 2190
2191config COMPAT 2191config COMPAT
2192 def_bool y 2192 def_bool y
2193 depends on IA32_EMULATION || X86_X32_ABI 2193 depends on IA32_EMULATION || X86_X32
2194 2194
2195config COMPAT_FOR_U64_ALIGNMENT 2195config COMPAT_FOR_U64_ALIGNMENT
2196 def_bool COMPAT 2196 def_bool COMPAT
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 209ba1294592..31bb1eb1216a 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -82,6 +82,22 @@ ifdef CONFIG_CC_STACKPROTECTOR
82 endif 82 endif
83endif 83endif
84 84
85ifdef CONFIG_X86_X32
86 x32_ld_ok := $(call try-run,\
87 /bin/echo -e '1: .quad 1b' | \
88 $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" - && \
89 $(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMPO" && \
90 $(LD) -m elf32_x86_64 "$$TMPO" -o "$$TMP",y,n)
91 ifeq ($(x32_ld_ok),y)
92 CONFIG_X86_X32_ABI := y
93 KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
94 KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
95 else
96 $(warning CONFIG_X86_X32 enabled but no binutils support)
97 endif
98endif
99export CONFIG_X86_X32_ABI
100
85# Don't unroll struct assignments with kmemcheck enabled 101# Don't unroll struct assignments with kmemcheck enabled
86ifeq ($(CONFIG_KMEMCHECK),y) 102ifeq ($(CONFIG_KMEMCHECK),y)
87 KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy) 103 KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy)