add ARM FDPIC support
v3 cover add ARM FDPIC support
I resumed the series [1] submitted by Waldemar Brodkorb, where I made some changes to the patch [9/9] "configs/stm32f746_disco_sd: new defconfig" based on the suggestions provided by Thomas Petazzoni during the review of a previous series [2].
Like Waldemar, I also did not encounter any issues during testing on the board.
[1] https://patchwork.ozlabs.org/project/buildroot/cover/[email protected]/
[2] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Ben Wolsieffer (6):
Revert: "arch: drop now useless support for FDPIC"
arch: don't enable FDPIC binaries by default arch/arm: add support for FDPIC boot/uboot: pass -mno-fdpic if FDPIC is enabled
linux: pass -mno-fdpic if FDPIC is enabled package/uclibc: enable NPTL on no-MMU ARM w/ FDPIC
Dario Binacchi (2):
Add the right dependencies on BR2_BINFMT_* to the toolchains configs/stm32f746_disco_sd: new defconfig
Waldemar Brodkorb (1):
package/busybox: remove STATIC from busybox-minimal.config
DEVELOPERS | 4 + arch/Config.in | 14 ++ .../stm32f746-disco/extlinux.conf | 4 + .../stm32f746-disco/flash_sd.sh | 22 ++ .../stm32f746-disco/genimage.cfg | 10 + .../stm32f746-disco/linux.fragment | 13 ++ .../patches/linux-headers/linux-headers.hash | 1 + .../stm32f746-disco/patches/linux/linux.hash | 2 + .../stm32f746-disco/patches/uboot/uboot.hash | 2 + .../stm32f746-disco/post-build.sh | 4 + .../stm32f746-disco/readme.txt | 31 +++ boot/uboot/uboot.mk | 5 + configs/stm32f746_disco_sd_defconfig | 31 +++ linux/linux.mk | 8 +- package/Makefile.in | 6 + package/busybox/busybox-minimal.config | 2 +- package/glibc/Config.in | 1 + package/musl/Config.in | 1 + package/uclibc/Config.in | 2 +- package/uclibc/uclibc.mk | 7 + .../Config.in | 1 + .../toolchain-external-arm-aarch64/Config.in | 1 + .../Config.in.options | 194 ++++++++++++++++++ .../Config.in | 1 + .../Config.in | 1 + .../Config.in | 1 + .../toolchain-external-linaro-arm/Config.in | 1 + .../toolchain-external-linaro-armeb/Config.in | 1 + .../toolchain-external-synopsys-arc/Config.in | 1 + 29 files changed, 369 insertions(+), 3 deletions(-) create mode 100644 board/stmicroelectronics/stm32f746-disco/extlinux.conf create mode 100755 board/stmicroelectronics/stm32f746-disco/flash_sd.sh create mode 100644 board/stmicroelectronics/stm32f746-disco/genimage.cfg create mode 100644 board/stmicroelectronics/stm32f746-disco/linux.fragment create mode 120000 board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash create mode 100755 board/stmicroelectronics/stm32f746-disco/post-build.sh create mode 100644 board/stmicroelectronics/stm32f746-disco/readme.txt create mode 100644 configs/stm32f746_disco_sd_defconfig
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 1/9 Revert: "arch: drop now useless support for FDPIC"
From: Ben Wolsieffer <[email protected]>
This reverts commit 58dcd28dfbed481becb822b009583a63efbc6ffa.
ARM supports FDPIC, so this code is needed once again.
---
No changes since v1
arch/Config.in | 14 ++++++++++++++ package/uclibc/uclibc.mk | 7 +++++++ 2 files changed, 21 insertions(+)
arch/Config.in +14 -0
@@ -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
@@ -430,6 +433,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
@@ -441,6 +445,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
package/uclibc/uclibc.mk +7 -0
@@ -57,6 +57,13 @@ 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_ENABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config) +endef +endif ifeq ($(BR2_BINFMT_FLAT),y) define UCLIBC_BINFMT_CONFIG $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT)
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 2/9 arch: don't enable FDPIC binaries by default
In reply to Dario BinacchiFrom: Ben Wolsieffer <[email protected]>
FDPIC support is being added as a new option for an existing architecture (ARM), so we don't want to suddenly change the default.
---
No changes since v1
arch/Config.in | 1 - 1 file changed, 1 deletion(-)
arch/Config.in +0 -1
@@ -433,7 +433,6 @@ 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
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
RFC PATCH v3 3/9 Add the right dependencies on BR2_BINFMT_* to the toolchains
In reply to Dario BinacchiFDPIC support is not provided by all toolchains. The patch adds the correct dependencies on BR2_BINFMT_* to the toolchains, so they can only be selected if they support the chosen target binary format
Checking the FDPIC support for the different toolchains was done by running the following command for each of them:
*-gcc -mfdpic -o test test.c
where test.c is:
int main(int argc, char**argv)
{
printf("Ciao!\n");
return 0;
}---
- Added in v3.
- It replaces the previous patch "arch: make FDPIC dependent on toolchain support", considered incorrect.
package/glibc/Config.in | 1 + package/musl/Config.in | 1 + .../Config.in | 1 + .../toolchain-external-arm-aarch64/Config.in | 1 + .../Config.in.options | 194 ++++++++++++++++++ .../Config.in | 1 + .../Config.in | 1 + .../Config.in | 1 + .../toolchain-external-linaro-arm/Config.in | 1 + .../toolchain-external-linaro-armeb/Config.in | 1 + .../toolchain-external-synopsys-arc/Config.in | 1 + 11 files changed, 204 insertions(+)
package/glibc/Config.in +1 -0
@@ -25,6 +25,7 @@ config BR2_PACKAGE_GLIBC_ARCH_SUPPORTS depends on !BR2_POWERPC_CPU_HAS_SPE depends on BR2_RISCV_ISA_RVA || !BR2_riscv depends on BR2_USE_MMU + depends on BR2_BINFMT_ELF config BR2_PACKAGE_GLIBC_SUPPORTS bool
package/musl/Config.in +1 -0
@@ -24,6 +24,7 @@ config BR2_PACKAGE_MUSL_ARCH_SUPPORTS # sh2 nommu is supported by musl, but we don't have support # for it in Buildroot. depends on BR2_USE_MMU + depends on BR2_BINFMT_ELF config BR2_PACKAGE_MUSL_SUPPORTS bool
toolchain/toolchain-external/toolchain-external-arm-aarch64-be/Config.in +1 -0
@@ -3,6 +3,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_BE depends on BR2_aarch64_be depends on BR2_HOSTARCH = "x86_64" depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_13 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_INSTALL_LIBSTDCPP
toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in +1 -0
@@ -3,6 +3,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64 depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_13 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_INSTALL_LIBSTDCPP
toolchain/toolchain-external/toolchain-external-bootlin/Config.in.options +194 -0
1,358 lines not on this page · raw message
toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in +1 -0
@@ -7,6 +7,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS depends on !BR2_mips_interaptiv depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on !BR2_MIPS_NABI32 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HAS_NATIVE_RPC
toolchain/toolchain-external/toolchain-external-linaro-aarch64-be/Config.in +1 -0
@@ -3,6 +3,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_BE depends on BR2_aarch64_be depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_INSTALL_LIBSTDCPP
toolchain/toolchain-external/toolchain-external-linaro-aarch64/Config.in +1 -0
@@ -3,6 +3,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64 depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_INSTALL_LIBSTDCPP
toolchain/toolchain-external/toolchain-external-linaro-arm/Config.in +1 -0
@@ -9,6 +9,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on BR2_ARM_EABIHF depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HAS_NATIVE_RPC
toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in +1 -0
@@ -9,6 +9,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" depends on BR2_ARM_EABIHF depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8 + depends on BR2_BINFMT_ELF select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HAS_NATIVE_RPC
toolchain/toolchain-external/toolchain-external-synopsys-arc/Config.in +1 -0
@@ -3,6 +3,7 @@ config BR2_TOOLCHAIN_EXTERNAL_SYNOPSYS_ARC depends on BR2_arc depends on BR2_HOSTARCH = "x86_64" depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_15 + depends on BR2_BINFMT_ELF select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 4/9 arch/arm: add support for FDPIC
In reply to Dario BinacchiFrom: Ben Wolsieffer <[email protected]>
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 a 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.
---
No changes since v1
arch/Config.in | 1 + package/Makefile.in | 6 ++++++ 2 files changed, 7 insertions(+)
arch/Config.in +1 -0
@@ -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)
package/Makefile.in +6 -0
@@ -39,7 +39,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 which needs the # regular linux name.
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 5/9 boot/uboot: pass -mno-fdpic if FDPIC is enabled
In reply to Dario BinacchiFrom: Ben Wolsieffer <[email protected]>
If the FDPIC ABI is enabled by default in the toolchain, it must be explicitly disabled when building U-Boot.
---
No changes since v1
boot/uboot/uboot.mk | 5 +++++ 1 file changed, 5 insertions(+)
boot/uboot/uboot.mk +5 -0
@@ -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)
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 6/9 linux: pass -mno-fdpic if FDPIC is enabled
In reply to Dario BinacchiFrom: Ben Wolsieffer <[email protected]>
If the FDPIC ABI is enabled by default in the toolchain, it must be explicitly disabled when building the kernel.
---
No changes since v1
linux/linux.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
linux/linux.mk +7 -1
@@ -163,6 +163,7 @@ endif LINUX_MAKE_FLAGS = \ HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS))) $(HOST_LDFLAGS)" \ ARCH=$(KERNEL_ARCH) \ + KCFLAGS="$(LINUX_CFLAGS)" \ INSTALL_MOD_PATH=$(TARGET_DIR) \ CROSS_COMPILE="$(TARGET_CROSS)" \ WERROR=0 \
@@ -184,7 +185,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)
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 7/9 package/uclibc: enable NPTL on no-MMU ARM w/ FDPIC
In reply to Dario BinacchiFrom: Ben Wolsieffer <[email protected]>
NPTL is supported on no-MMU ARM systems if FDPIC binaries are used.
---
No changes since v1
package/uclibc/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/uclibc/Config.in +1 -1
@@ -78,7 +78,7 @@ choice config BR2_PTHREADS_NATIVE bool "Native POSIX Threading (NPTL)" - depends on BR2_USE_MMU + depends on BR2_USE_MMU || ((BR2_arm || BR2_armeb) && BR2_BINFMT_FDPIC) select BR2_TOOLCHAIN_HAS_THREADS select BR2_TOOLCHAIN_HAS_THREADS_NPTL
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 8/9 package/busybox: remove STATIC from busybox-minimal.config
In reply to Dario BinacchiFrom: Waldemar Brodkorb <[email protected]>
With FDPIC we want a shared busybox executable even with noMMU. Static is already handled by busybox.mk for static toolchains.
---
No changes since v1
package/busybox/busybox-minimal.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/busybox/busybox-minimal.config +1 -1
@@ -40,7 +40,7 @@ CONFIG_FEATURE_SYSLOG=y # # Build Options # -CONFIG_STATIC=y +# CONFIG_STATIC is not set # CONFIG_PIE is not set # CONFIG_NOMMU is not set # CONFIG_BUILD_LIBBUSYBOX is not set
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 9/9 configs/stm32f746_disco_sd: new defconfig
In reply to Dario BinacchiThe commit adds support for STM32F746G-DISCO board. The discovery kit is a complete demonstration and development platform for STMicroelectronics Arm Cortex-M7-core-based STM32F746NG.
Board support package includes the following components:
- mainline Linux kernel 5.15.165
- mainline U-Boot 2024.07
- default packages from buildroot
---
No changes since v2
DEVELOPERS | 4 +++ .../stm32f746-disco/extlinux.conf | 4 +++ .../stm32f746-disco/flash_sd.sh | 22 +++++++++++++ .../stm32f746-disco/genimage.cfg | 10 ++++++ .../stm32f746-disco/linux.fragment | 13 ++++++++ .../patches/linux-headers/linux-headers.hash | 1 + .../stm32f746-disco/patches/linux/linux.hash | 2 ++ .../stm32f746-disco/patches/uboot/uboot.hash | 2 ++ .../stm32f746-disco/post-build.sh | 4 +++ .../stm32f746-disco/readme.txt | 31 +++++++++++++++++++ configs/stm32f746_disco_sd_defconfig | 31 +++++++++++++++++++ 11 files changed, 124 insertions(+) create mode 100644 board/stmicroelectronics/stm32f746-disco/extlinux.conf create mode 100755 board/stmicroelectronics/stm32f746-disco/flash_sd.sh create mode 100644 board/stmicroelectronics/stm32f746-disco/genimage.cfg create mode 100644 board/stmicroelectronics/stm32f746-disco/linux.fragment create mode 120000 board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash create mode 100644 board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash create mode 100755 board/stmicroelectronics/stm32f746-disco/post-build.sh create mode 100644 board/stmicroelectronics/stm32f746-disco/readme.txt create mode 100644 configs/stm32f746_disco_sd_defconfig
DEVELOPERS +4 -0
@@ -788,10 +788,12 @@ F: package/xinetd/ N: Dario Binacchi <[email protected]> F: board/bsh/ +F: board/stmicroelectronics/stm32f746-disco/ F: board/stmicroelectronics/stm32f769-disco/ F: configs/imx6ulz_bsh_smm_m2_defconfig F: configs/imx8mn_bsh_smm_s2_defconfig F: configs/imx8mn_bsh_smm_s2_pro_defconfig +F: configs/stm32f746_disco_sd_defconfig F: configs/stm32f769_disco_sd_defconfig F: package/armadillo/ F: package/babeld/
@@ -3304,7 +3306,9 @@ F: package/ngrep/ N: Waldemar Brodkorb <[email protected]> F: board/qemu/riscv32-virt/ +F: board/stmicroelectronics/stm32f746-disco/ F: configs/qemu_riscv32_nommu_virt_defconfig +F: configs/stm32f746_disco_sd_defconfig F: package/asterisk/ F: package/evilwm/ F: package/fbv/
board/stmicroelectronics/stm32f746-disco/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@ +label stm32f746-disco-buildroot + kernel /boot/zImage + devicetree /boot/stm32f746-disco.dtb + append console=ttySTM0,115200 root=/dev/mmcblk0p1 rw rootwait consoleblank=0 ignore_loglevel
board/stmicroelectronics/stm32f746-disco/flash_sd.sh new file +22 -0
@@ -0,0 +1,22 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + OUTPUT_DIR=output +else + OUTPUT_DIR=$1 +fi + +if ! test -d "${OUTPUT_DIR}" ; then + echo "ERROR: no output directory specified." + echo "Usage: $0 OUTPUT_DIR" + exit 1 +fi + +"${OUTPUT_DIR}"/host/bin/openocd -f board/stm32f746g-disco.cfg \ + -c "init" \ + -c "reset init" \ + -c "flash probe 0" \ + -c "flash info 0" \ + -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin 0x08000000" \ + -c "reset run" \ + -c "shutdown"
board/stmicroelectronics/stm32f746-disco/genimage.cfg new file +10 -0
@@ -0,0 +1,10 @@ +image sdcard.img { + hdimage { + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext2" + size = 32M + } +}
board/stmicroelectronics/stm32f746-disco/linux.fragment new file +13 -0
@@ -0,0 +1,13 @@ +# CONFIG_PREEMPT is not set +# CONFIG_MULTIUSER is not set +# CONFIG_TIMERFD is not set +CONFIG_SET_MEM_PARAM=y +CONFIG_DRAM_BASE=0xC0000000 +CONFIG_DRAM_SIZE=0x01000000 +# CONFIG_GCC_PLUGINS is not set +# CONFIG_XIP_KERNEL is not set +# CONFIG_BLK_DEV is not set +# CONFIG_COMPAT_BRK is not set +# CONFIG_PROC_SYSCTL is not set +# CONFIG_CRYPTO is not set +CONFIG_RCU_TRACE=y
board/stmicroelectronics/stm32f746-disco/patches/linux-headers/linux-headers.hash new file +1 -0
@@ -0,0 +1 @@ +../linux/linux.hash
board/stmicroelectronics/stm32f746-disco/patches/linux/linux.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 a36dd3e82ceb634afded31f2656568f57c4d9c4b399859f298b18116df11c6fe linux-5.15.165.tar.xz
board/stmicroelectronics/stm32f746-disco/patches/uboot/uboot.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f u-boot-2024.07.tar.bz2
board/stmicroelectronics/stm32f746-disco/post-build.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +BOARD_DIR="$(dirname "$0")" + +install -m 0644 -D "${BOARD_DIR}"/extlinux.conf "${TARGET_DIR}"/boot/extlinux/extlinux.conf
board/stmicroelectronics/stm32f746-disco/readme.txt new file +31 -0
@@ -0,0 +1,31 @@ +STM32F746-DISCO +=================== + +This tutorial describes how to use the predefined Buildroot +configuration for the STM32F746-DISCO evaluation platform. + +Building +-------- + + make stm32f746_disco_sd_defconfig + make + +Flashing +-------- + + ./board/stmicroelectronics/stm32f746-disco/flash_sd.sh output/ + +It will flash the U-boot bootloader. + +Creating SD card +---------------- + +Buildroot prepares an "sdcard.img" image in the output/images/ directory, +ready to be dumped on a SD card. Launch the following command as root: + + dd if=output/images/sdcard.img of=/dev/<your-sd-device> + +*** WARNING! This will destroy all the card content. Use with care! *** + +For details about the medium image layout and its content, see the +definition in board/stmicroelectronics/stm32f746-disco/genimage.cfg.
configs/stm32f746_disco_sd_defconfig new file +31 -0
@@ -0,0 +1,31 @@ +BR2_arm=y +BR2_cortex_m7=y +BR2_BINFMT_FDPIC=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y +BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f746-disco/patches" +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y +BR2_INIT_TINYINIT=y +BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32f746-disco/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32f746-disco/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.15.165" +BR2_LINUX_KERNEL_DEFCONFIG="stm32" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32f746-disco/linux.fragment" +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f746-disco" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_SIZE="32M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.07" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32f746-disco" +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_OPENOCD=y
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Dario,
Quoted 8 lines · On Sun, 29 Sep 2024 22:14:50 +0200 Dario Binacchi…
Ben Wolsieffer (6):
Revert: "arch: drop now useless support for FDPIC"
arch: don't enable FDPIC binaries by defaultarch/arm: add support for FDPIC boot/uboot: pass -mno-fdpic if FDPIC is enabled
linux: pass -mno-fdpic if FDPIC is enabled package/uclibc: enable NPTL on no-MMU ARM w/ FDPIC
Quoted 6 lines
Dario Binacchi (2):
Add the right dependencies on BR2_BINFMT_* to the toolchains configs/stm32f746_disco_sd: new defconfigWaldemar Brodkorb (1):
package/busybox: remove STATIC from busybox-minimal.config
Thanks for this new iteration, which I have applied, but with some changes.
Essentially, I changed a bit my mind on PATCH 3/9, and I believe adding BR2_BINFMT_ELF everywhere was a bit unneeded. And your patch was actually not sufficient: it still allowed to select the Bootlin ARMv7-M FLAT toolchain when ARMv7-M FDPIC was selected as the target architecture in Buildroot.
So I simplified the patch, and only made sure that the Bootlin ARMv7-M FLAT toolchain can only be selected when BR2_BINFMT_FLAT=y. BTW, in this patch, you had modified directly toolchain/toolchain-external/toolchain-external-bootlin/Config.in.options, but as explained at the beginning of this file, this file is auto-generated, so modifying it without changing support/scripts/gen-bootlin-toolchains is somewhat useless.
Also, on the patch actually enabling FDPIC on ARM, I restricted that to ARMv7-M. I know it in theory works on MMU-capable ARM systems, but FDPIC really doesn't make any sense in such cases (ELF works just fine), so nobody will ever use FDPIC on such systems... making the support of this configuration a bit useless.
Thanks for your persistence with this work!
Best regards,
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot