Message ID | 20240922092312.2061358-6-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Hello, On Sun, 22 Sep 2024 11:23:08 +0200 Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > From: Ben Wolsieffer <ben.wolsieffer@hefring.com> > > If the FDPIC ABI is enabled by default in the toolchain, it must be > explicitly disabled when building U-Boot. > > Signed-off-by: Ben Wolsieffer <Ben.Wolsieffer@hefring.com> > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> This patch and PATCH 6/9 which does the same for the Linux package makes me wonder what is the right approach, and I am not fully clear. Indeed, we already have some logic in the toolchain-wrapper to pass or not pass certain flags when we're building U-Boot or the kernel. However, in this case, FDPIC is enabled by default, and the wrapper would have to disable FDPIC when building U-Boot/Linux, which isn't what the wrapper is doing today. So I'm a bit unsure on what's the best approach between what you're proposing, and handling things in the wrapper. Perhaps we need to try what you proposed, and see if it works well for all use-cases. Thomas
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index ab534a8b3a20..d8faef648fad 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -172,6 +172,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)