uclibc: disable DOPIC on ARM FLAT
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 18 Mar 2016 21:08:09 +0000 (22:08 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 29 Mar 2016 22:15:48 +0000 (00:15 +0200)
As explained by Waldemar, enabling DOPIC in uClibc will lead to the
creation of a Position Independent library. In turn, this will cause
elf2flt to generate a "Has-PIC-GOT" flat binary, which doesn't work on
ARM. In fact, elf2flt on ARM really expect to have non-PIC code as
input, so we must disable DOPIC in the uClibc configuration.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/uclibc/uclibc.mk

index ad94494bcc9f0362aa4c1891964b09566b825f77..e3e45f7bcd32bf5220ad048560691c46889635ce 100644 (file)
@@ -82,6 +82,12 @@ ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_TH
 UCLIBC_EXTRA_CFLAGS += -marm
 endif
 
+ifeq ($(BR2_BINFMT_FLAT),y)
+define UCLIBC_ARM_BINFMT_FLAT
+       $(call KCONFIG_DISABLE_OPT,DOPIC,$(@D)/.config)
+endef
+endif
+
 endif # arm
 
 #
@@ -354,6 +360,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
        $(UCLIBC_ARC_TYPE_CONFIG)
        $(UCLIBC_ARC_PAGE_SIZE_CONFIG)
        $(UCLIBC_ARM_ABI_CONFIG)
+       $(UCLIBC_ARM_BINFMT_FLAT)
        $(UCLIBC_MIPS_ABI_CONFIG)
        $(UCLIBC_MIPS_ISA_CONFIG)
        $(UCLIBC_SH_TYPE_CONFIG)