Message ID | 20220802202142.1770838-4-Ben.Wolsieffer@hefring.com |
---|---|
State | Superseded |
Headers | show |
Series | Add support for FDPIC binaries on ARM | expand |
On Tue, 2 Aug 2022 16:21:41 -0400 Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote: > If the FDPIC ABI is enabled by default in the toolchain, it must be > explicitly disabled when building U-Boot. Missing SoB. Who added -mfdpic by default? Directly the compiler? If -mfdpic was added by our toolchain wrapper, then the toolchain wrapper (toolchain/toolchain-wrapper.c) already has a few checks to avoid adding -fPIE when building the kernel/U-Boot. Thanks! Thomas
On Wed, Aug 03, 2022 at 12:15:27AM +0200, Thomas Petazzoni wrote: > On Tue, 2 Aug 2022 16:21:41 -0400 > Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote: > > > If the FDPIC ABI is enabled by default in the toolchain, it must be > > explicitly disabled when building U-Boot. > > Missing SoB. Sorry, will fix. > Who added -mfdpic by default? Directly the compiler? > > If -mfdpic was added by our toolchain wrapper, then the toolchain > wrapper (toolchain/toolchain-wrapper.c) already has a few checks to > avoid adding -fPIE when building the kernel/U-Boot. > -mfdpic is enabled by default when the toolchain is configured for arm-*-uclinuxfdpiceabi.
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index a9f9b1bf16..4955a59a60 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -158,6 +158,11 @@ UBOOT_MAKE_OPTS += \ HOSTLDFLAGS="$(HOST_LDFLAGS)" \ $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) +# Disable FDPIC if enabled by default in toolchain +ifeq ($(BR2_BINFMT_FDPIC),y) +UBOOT_MAKE_OPTS += KCFLAGS=-mno-fdpic +endif + ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31),y) UBOOT_DEPENDENCIES += arm-trusted-firmware ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF),y)