nuttx/arch
Marco Casaroli 77f263b4fa cmake: Build FDPIC modules the way the make build does.
The same two differences as in common/Toolchain.defs: the compiler is told
-mfdpic -fPIC, and the module link is done by an arm-uclinuxfdpiceabi
linker.

That linker is not the one that links the firmware, so the module link needs
a variable of its own.  CMAKE_ELF_LD is the ordinary linker unless the
architecture sets it, which arm does under CONFIG_FDPIC.

The linker script needs nothing here: it is generated from
libs/libc/elf/gnu-elf.ld.in, which both build systems preprocess, and the
FDPIC segments are already in it.

-r is now conditional on CONFIG_PIC being off, which is what
common/Toolchain.defs has always done and the cmake build did not: a
position independent module is linked as an executable, and an FDPIC one as
a shared object, so neither wants it.

-fno-use-cxa-atexit mirrors CXXELFFLAGS for the same reason it was added
there.

Configured and built mps3-an547:picostest with CONFIG_FDPIC through cmake and
ninja: the modules in bin/ are ARM FDPIC with two PT_LOAD segments.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-09-09 10:21:21 +08:00
..
arm cmake: Build FDPIC modules the way the make build does. 2026-09-09 10:21:21 +08:00
arm64 arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
avr arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
ceva arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
dummy
hc tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
mips arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
misoc arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
or1k arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
renesas nuttx/libc: refine the atomic related Kconfig 2026-08-24 13:20:45 +08:00
risc-v arch/risc-v/src/eic7700x/Kconfig: fix broken kconfig-frontends parsing 2026-09-09 10:15:05 +08:00
sim arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
sparc arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
tricore arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
x86 arch, boards, cmake: Build C++ ELF modules without __cxa_atexit. 2026-09-04 15:44:24 -03:00
x86_64 arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
xtensa arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
z16 tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-07-28 21:26:03 -03:00
z80 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
CMakeLists.txt cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
Kconfig binfmt, arch/arm: Add the CONFIG_FDPIC option and the ABI header. 2026-09-08 16:31:16 -03:00