Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bf62763 authored by H. Peter Anvin's avatar H. Peter Anvin
Browse files

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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarH. 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
parent e0a449ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2175,7 +2175,7 @@ config IA32_AOUT
	---help---
	  Support old a.out binaries in the 32bit emulation.

config X86_X32_ABI
config X86_X32
	bool "x32 ABI for 64-bit mode (EXPERIMENTAL)"
	depends on X86_64 && IA32_EMULATION && EXPERIMENTAL
	---help---
@@ -2190,7 +2190,7 @@ config X86_X32_ABI

config COMPAT
	def_bool y
	depends on IA32_EMULATION || X86_X32_ABI
	depends on IA32_EMULATION || X86_X32

config COMPAT_FOR_U64_ALIGNMENT
	def_bool COMPAT
+16 −0
Original line number Diff line number Diff line
@@ -82,6 +82,22 @@ ifdef CONFIG_CC_STACKPROTECTOR
        endif
endif

ifdef CONFIG_X86_X32
	x32_ld_ok := $(call try-run,\
			/bin/echo -e '1: .quad 1b' | \
			$(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" - && \
			$(OBJCOPY) -O elf32-x86-64 "$$TMP" "$$TMPO" && \
			$(LD) -m elf32_x86_64 "$$TMPO" -o "$$TMP",y,n)
	ifeq ($(x32_ld_ok),y)
		CONFIG_X86_X32_ABI := y
		KBUILD_AFLAGS += -DCONFIG_X86_X32_ABI
		KBUILD_CFLAGS += -DCONFIG_X86_X32_ABI
	else
		$(warning CONFIG_X86_X32 enabled but no binutils support)
	endif
endif
export CONFIG_X86_X32_ABI

# Don't unroll struct assignments with kmemcheck enabled
ifeq ($(CONFIG_KMEMCHECK),y)
	KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy)