* [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM
@ 2022-08-02 20:21 Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC" Ben Wolsieffer
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-02 20:21 UTC (permalink / raw)
To: buildroot; +Cc: Ben Wolsieffer, Thomas Petazzoni, Yann E. MORIN
Introduces support for the FDPIC binary format on ARM. FDPIC binaries
enable more efficient use of memory on no-MMU systems.
The first patch reverts the removal of general FDPIC support, while the
second adds support for FDPIC specifically on ARM. The last two patches
disable FDPIC when building Linux and U-Boot.
Changes in v2:
* Simplify special casing of FDPIC toolchain target
* Add additional patches to fix building Linux and U-Boot with an
FDPIC toolchain by passing -mno-fdpic. I have submitted fixes
upstream to do this automatically, but they have not yet been
accepted and will take a while to end up in Buildroot.
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Ben Wolsieffer (4):
Revert "arch: drop now useless support for FDPIC"
arch/arm: add support for FDPIC
boot/uboot: pass -mno-fdpic if FDPIC is enabled
linux: pass -mno-fdpic if FDPIC is enabled
arch/Config.in | 15 +++++++++++++++
boot/uboot/uboot.mk | 5 +++++
linux/linux.mk | 8 +++++++-
package/Makefile.in | 6 ++++++
package/uclibc/uclibc.mk | 8 ++++++++
5 files changed, 41 insertions(+), 1 deletion(-)
--
2.37.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC"
2022-08-02 20:21 [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Ben Wolsieffer
@ 2022-08-02 20:21 ` Ben Wolsieffer
2022-08-02 22:12 ` Thomas Petazzoni via buildroot
2022-08-02 20:21 ` [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC Ben Wolsieffer
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-02 20:21 UTC (permalink / raw)
To: buildroot; +Cc: Ben Wolsieffer, Thomas Petazzoni, Yann E. MORIN
This reverts commit 58dcd28dfbed481becb822b009583a63efbc6ffa.
ARM supports FDPIC, so this code is needed once again.
Signed-off-by: Ben Wolsieffer <Ben.Wolsieffer@hefring.com>
---
arch/Config.in | 14 ++++++++++++++
package/uclibc/uclibc.mk | 8 ++++++++
2 files changed, 22 insertions(+)
diff --git a/arch/Config.in b/arch/Config.in
index 1c0c400a98..c5d481b9e5 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -12,6 +12,9 @@ config BR2_SOFT_FLOAT
config BR2_USE_MMU
bool
+config BR2_ARCH_HAS_FDPIC_SUPPORT
+ bool
+
choice
prompt "Target Architecture"
default BR2_i386
@@ -418,6 +421,7 @@ endif
choice
prompt "Target Binary Format"
default BR2_BINFMT_ELF if BR2_USE_MMU
+ default BR2_BINFMT_FDPIC if BR2_ARCH_HAS_FDPIC_SUPPORT
default BR2_BINFMT_FLAT
config BR2_BINFMT_ELF
@@ -429,6 +433,16 @@ config BR2_BINFMT_ELF
and executables used across different architectures and
operating systems.
+config BR2_BINFMT_FDPIC
+ bool "FDPIC"
+ depends on BR2_ARCH_HAS_FDPIC_SUPPORT
+ select BR2_BINFMT_SUPPORTS_SHARED
+ help
+ ELF FDPIC binaries are based on ELF, but allow the individual
+ load segments of a binary to be located in memory
+ independently of each other. This makes this format ideal for
+ use in environments where no MMU is available.
+
config BR2_BINFMT_FLAT
bool "FLAT"
depends on !BR2_USE_MMU
diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index 0e17a8e65d..ff98a05c16 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -56,6 +56,14 @@ UCLIBC_LOCALES = \
endif
# noMMU binary formats
+ifeq ($(BR2_BINFMT_FDPIC),y)
+define UCLIBC_BINFMT_CONFIG
+ $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
+ $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
+ $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
+ $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
+endef
+endif
ifeq ($(BR2_BINFMT_FLAT_ONE),y)
define UCLIBC_BINFMT_CONFIG
$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT)
--
2.37.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC
2022-08-02 20:21 [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC" Ben Wolsieffer
@ 2022-08-02 20:21 ` Ben Wolsieffer
2022-08-02 22:13 ` Thomas Petazzoni via buildroot
2022-08-02 20:21 ` [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled Ben Wolsieffer
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-02 20:21 UTC (permalink / raw)
To: buildroot; +Cc: Ben Wolsieffer, Thomas Petazzoni, Yann E. MORIN
Linux on ARM supports FDPIC binaries intended for use on no-MMU systems.
This patch enables support for building a toolchain that produces FDPIC
binaries.
The target name for an FDPIC toolchain must be
arm-<vendor>-uclinuxfdpiceabi, which doesn't follow the standard format
and requires a special case.
According to the kernel help for CONFIG_BINFMT_ELF_FDPIC, "It is also
possible to run FDPIC ELF binaries on MMU linux," so FDPIC support is
available on all ARM platforms, not just no-MMU.
Signed-off-by: Ben Wolsieffer <Ben.Wolsieffer@hefring.com>
---
arch/Config.in | 1 +
package/Makefile.in | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/arch/Config.in b/arch/Config.in
index c5d481b9e5..8dab58cf04 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -39,6 +39,7 @@ config BR2_arceb
config BR2_arm
bool "ARM (little endian)"
+ select BR2_ARCH_HAS_FDPIC_SUPPORT
# MMU support is set by the subarchitecture file, arch/Config.in.arm
help
ARM is a 32-bit reduced instruction set computer (RISC)
diff --git a/package/Makefile.in b/package/Makefile.in
index ff60f85092..81a7028275 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -37,7 +37,13 @@ $(error BR2_TOOLCHAIN_BUILDROOT_VENDOR cannot be 'unknown'. \
endif
# Compute GNU_TARGET_NAME
+# FDPIC on ARM requires a special target name: it has no OS field and must
+# use the suffix -uclinuxfdpiceabi.
+ifeq ($(BR2_arm)$(BR2_armeb):$(BR2_BINFMT_FDPIC),y:y)
+GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-uclinuxfdpiceabi
+else
GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
+endif
# FLAT binary format needs uclinux, except RISC-V 64-bits which needs
# the regular linux name.
--
2.37.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled
2022-08-02 20:21 [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC" Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC Ben Wolsieffer
@ 2022-08-02 20:21 ` Ben Wolsieffer
2022-08-02 22:15 ` Thomas Petazzoni via buildroot
2022-08-02 20:21 ` [Buildroot] [PATCH v2 4/4] linux: " Ben Wolsieffer
2022-08-02 22:08 ` [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Thomas Petazzoni via buildroot
4 siblings, 1 reply; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-02 20:21 UTC (permalink / raw)
To: buildroot; +Cc: Ben Wolsieffer, Thomas Petazzoni, Yann E. MORIN
If the FDPIC ABI is enabled by default in the toolchain, it must be
explicitly disabled when building U-Boot.
---
boot/uboot/uboot.mk | 5 +++++
1 file changed, 5 insertions(+)
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)
--
2.37.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v2 4/4] linux: pass -mno-fdpic if FDPIC is enabled
2022-08-02 20:21 [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Ben Wolsieffer
` (2 preceding siblings ...)
2022-08-02 20:21 ` [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled Ben Wolsieffer
@ 2022-08-02 20:21 ` Ben Wolsieffer
2022-08-02 22:08 ` [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Thomas Petazzoni via buildroot
4 siblings, 0 replies; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-02 20:21 UTC (permalink / raw)
To: buildroot; +Cc: Ben Wolsieffer, Thomas Petazzoni, Yann E. MORIN
If the FDPIC ABI is enabled by default in the toolchain, it must be
explicitly disabled when building the kernel.
---
linux/linux.mk | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/linux/linux.mk b/linux/linux.mk
index 3d9ac37959..c73806ed49 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -152,6 +152,7 @@ endif
LINUX_MAKE_FLAGS = \
HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
ARCH=$(KERNEL_ARCH) \
+ KCFLAGS="$(LINUX_CFLAGS)" \
INSTALL_MOD_PATH=$(TARGET_DIR) \
CROSS_COMPILE="$(TARGET_CROSS)" \
WERROR=0 \
@@ -172,7 +173,12 @@ endif
# sanitize the arguments passed from user space in registers.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82435
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y)
-LINUX_MAKE_ENV += KCFLAGS=-Wno-attribute-alias
+LINUX_CFLAGS += -Wno-attribute-alias
+endif
+
+# Disable FDPIC if enabled by default in toolchain
+ifeq ($(BR2_BINFMT_FDPIC),y)
+LINUX_CFLAGS += -mno-fdpic
endif
ifeq ($(BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT),y)
--
2.37.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM
2022-08-02 20:21 [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Ben Wolsieffer
` (3 preceding siblings ...)
2022-08-02 20:21 ` [Buildroot] [PATCH v2 4/4] linux: " Ben Wolsieffer
@ 2022-08-02 22:08 ` Thomas Petazzoni via buildroot
2022-08-03 20:52 ` Ben Wolsieffer
4 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-02 22:08 UTC (permalink / raw)
To: Ben Wolsieffer; +Cc: Yann E. MORIN, buildroot
Hello Ben,
On Tue, 2 Aug 2022 16:21:38 -0400
Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote:
> Introduces support for the FDPIC binary format on ARM. FDPIC binaries
> enable more efficient use of memory on no-MMU systems.
>
> The first patch reverts the removal of general FDPIC support, while the
> second adds support for FDPIC specifically on ARM. The last two patches
> disable FDPIC when building Linux and U-Boot.
Thanks a lot for this support! Could you comment on which
gcc/binutils/gdb versions have support for FDPIC on ARM?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC"
2022-08-02 20:21 ` [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC" Ben Wolsieffer
@ 2022-08-02 22:12 ` Thomas Petazzoni via buildroot
2022-08-03 21:04 ` Ben Wolsieffer
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-02 22:12 UTC (permalink / raw)
To: Ben Wolsieffer; +Cc: Yann E. MORIN, buildroot
Hello Ben,
On Tue, 2 Aug 2022 16:21:39 -0400
Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote:
> This reverts commit 58dcd28dfbed481becb822b009583a63efbc6ffa.
>
> ARM supports FDPIC, so this code is needed once again.
>
> Signed-off-by: Ben Wolsieffer <Ben.Wolsieffer@hefring.com>
> ---
> arch/Config.in | 14 ++++++++++++++
> package/uclibc/uclibc.mk | 8 ++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/arch/Config.in b/arch/Config.in
> index 1c0c400a98..c5d481b9e5 100644
> --- a/arch/Config.in
> +++ b/arch/Config.in
> @@ -12,6 +12,9 @@ config BR2_SOFT_FLOAT
> config BR2_USE_MMU
> bool
>
> +config BR2_ARCH_HAS_FDPIC_SUPPORT
> + bool
> +
> choice
> prompt "Target Architecture"
> default BR2_i386
> @@ -418,6 +421,7 @@ endif
> choice
> prompt "Target Binary Format"
> default BR2_BINFMT_ELF if BR2_USE_MMU
> + default BR2_BINFMT_FDPIC if BR2_ARCH_HAS_FDPIC_SUPPORT
This default means that existing defconfigs for ARM noMMU, which
currently use FLAT binaries will "automatically" switch to FDPIC.
On another topic, I am wondering what happens with external toolchains?
For example at https://toolchains.bootlin.com/releases_armv7m.html we
have ARMv7-M toolchains that produce FLAT binaries. So probably it
means that the toolchain-external-bootlin package needs to be amended
to only offer the existing ARMv7-M toolchain when FLAT binaries are
selected.
I haven't really thought of all the implications, but to me it seems
like the case of external toolchains should be considered, to see what
is the impact of the FDPIC support.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC
2022-08-02 20:21 ` [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC Ben Wolsieffer
@ 2022-08-02 22:13 ` Thomas Petazzoni via buildroot
2022-08-03 20:54 ` Ben Wolsieffer
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-02 22:13 UTC (permalink / raw)
To: Ben Wolsieffer; +Cc: Yann E. MORIN, buildroot
On Tue, 2 Aug 2022 16:21:40 -0400
Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote:
> Linux on ARM supports FDPIC binaries intended for use on no-MMU systems.
> This patch enables support for building a toolchain that produces FDPIC
> binaries.
>
> The target name for an FDPIC toolchain must be
> arm-<vendor>-uclinuxfdpiceabi, which doesn't follow the standard format
> and requires a special case.
>
> According to the kernel help for CONFIG_BINFMT_ELF_FDPIC, "It is also
> possible to run FDPIC ELF binaries on MMU linux," so FDPIC support is
> available on all ARM platforms, not just no-MMU.
>
> Signed-off-by: Ben Wolsieffer <Ben.Wolsieffer@hefring.com>
I am (genuinely) surprised it's all what's needed. All of
binutils/gcc/gdb automagically now that we're using FDPIC just by
looking at the uclinuxfdpiceabi part of the tuple?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled
2022-08-02 20:21 ` [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled Ben Wolsieffer
@ 2022-08-02 22:15 ` Thomas Petazzoni via buildroot
2022-08-03 21:07 ` Ben Wolsieffer
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-02 22:15 UTC (permalink / raw)
To: Ben Wolsieffer; +Cc: Yann E. MORIN, buildroot
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
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM
2022-08-02 22:08 ` [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Thomas Petazzoni via buildroot
@ 2022-08-03 20:52 ` Ben Wolsieffer
0 siblings, 0 replies; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-03 20:52 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Yann E. MORIN, buildroot
Thanks for the review!
On Wed, Aug 03, 2022 at 12:08:43AM +0200, Thomas Petazzoni wrote:
> Hello Ben,
>
> On Tue, 2 Aug 2022 16:21:38 -0400
> Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote:
>
> > Introduces support for the FDPIC binary format on ARM. FDPIC binaries
> > enable more efficient use of memory on no-MMU systems.
> >
> > The first patch reverts the removal of general FDPIC support, while the
> > second adds support for FDPIC specifically on ARM. The last two patches
> > disable FDPIC when building Linux and U-Boot.
>
> Thanks a lot for this support! Could you comment on which
> gcc/binutils/gdb versions have support for FDPIC on ARM?
Support was added in GCC 10 and binutils 2.31. It appears that the
patches to GDB [1] were never upstreamed, although mainline GDB seems to
work more or less fine without them. gdbserver and the kernel need
patches to support debugging on Cortex-M processors, but this is
unrelated to FDPIC.
[1] https://github.com/mickael-guene/gdb/commits/gdb-7.5.1-fdpic
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC
2022-08-02 22:13 ` Thomas Petazzoni via buildroot
@ 2022-08-03 20:54 ` Ben Wolsieffer
0 siblings, 0 replies; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-03 20:54 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Yann E. MORIN, buildroot
On Wed, Aug 03, 2022 at 12:13:06AM +0200, Thomas Petazzoni wrote:
> I am (genuinely) surprised it's all what's needed. All of
> binutils/gcc/gdb automagically now that we're using FDPIC just by
> looking at the uclinuxfdpiceabi part of the tuple?
>
Yes, there was a bit of discussion [1] regarding whether FDPIC support
should be activated with compiler flags or be enabled by default with a
special toolchain target. It's not clear to me whether the former is
possible in the final version of the patches, but the latter seems to be
preferred.
[1] https://gcc.gnu.org/legacy-ml/gcc-patches/2018-10/msg01707.html
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC"
2022-08-02 22:12 ` Thomas Petazzoni via buildroot
@ 2022-08-03 21:04 ` Ben Wolsieffer
0 siblings, 0 replies; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-03 21:04 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Yann E. MORIN, buildroot
On Wed, Aug 03, 2022 at 12:12:03AM +0200, Thomas Petazzoni wrote:
> Hello Ben,
>
> On Tue, 2 Aug 2022 16:21:39 -0400
> Ben Wolsieffer <ben.wolsieffer@hefring.com> wrote:
>
> > @@ -418,6 +421,7 @@ endif
> > choice
> > prompt "Target Binary Format"
> > default BR2_BINFMT_ELF if BR2_USE_MMU
> > + default BR2_BINFMT_FDPIC if BR2_ARCH_HAS_FDPIC_SUPPORT
>
> This default means that existing defconfigs for ARM noMMU, which
> currently use FLAT binaries will "automatically" switch to FDPIC.
>
I didn't look too closely at this revert before, but yes, it probably
doesn't make sense to enable it by default when adding support for FDPIC
to an existing architecture.
> On another topic, I am wondering what happens with external toolchains?
> For example at https://toolchains.bootlin.com/releases_armv7m.html we
> have ARMv7-M toolchains that produce FLAT binaries. So probably it
> means that the toolchain-external-bootlin package needs to be amended
> to only offer the existing ARMv7-M toolchain when FLAT binaries are
> selected.
>
> I haven't really thought of all the implications, but to me it seems
> like the case of external toolchains should be considered, to see what
> is the impact of the FDPIC support.
The fact that FDPIC requires a certain toolchain target unfortunately
means that the existing prebuilt toolchains can't support it. Perhaps I
should add a BR2_TOOLCHAIN_HAS_FDPIC_SUPPORT option?
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled
2022-08-02 22:15 ` Thomas Petazzoni via buildroot
@ 2022-08-03 21:07 ` Ben Wolsieffer
0 siblings, 0 replies; 13+ messages in thread
From: Ben Wolsieffer @ 2022-08-03 21:07 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Yann E. MORIN, buildroot
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.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-08-03 21:07 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-02 20:21 [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 1/4] Revert "arch: drop now useless support for FDPIC" Ben Wolsieffer
2022-08-02 22:12 ` Thomas Petazzoni via buildroot
2022-08-03 21:04 ` Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 2/4] arch/arm: add support for FDPIC Ben Wolsieffer
2022-08-02 22:13 ` Thomas Petazzoni via buildroot
2022-08-03 20:54 ` Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 3/4] boot/uboot: pass -mno-fdpic if FDPIC is enabled Ben Wolsieffer
2022-08-02 22:15 ` Thomas Petazzoni via buildroot
2022-08-03 21:07 ` Ben Wolsieffer
2022-08-02 20:21 ` [Buildroot] [PATCH v2 4/4] linux: " Ben Wolsieffer
2022-08-02 22:08 ` [Buildroot] [PATCH v2 0/4] Add support for FDPIC binaries on ARM Thomas Petazzoni via buildroot
2022-08-03 20:52 ` Ben Wolsieffer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox