As from commit e0590f41fe1e ("RISC-V: Enable static-pie.") the library fails to build: riscv64-linux-gnu-gcc -o .../support/test-run-command -nostdlib -nostartfiles -static -static-pie .../csu/rcrt1.o .../csu/crti.o `riscv64-linux-gnu-gcc --print-file-name=crtbeginS.o` .../support/test-run-command.o .../elf/static-stubs.o .../support/libsupport_nonshared.a -Wl,--start-group .../libc.a -lgcc -Wl,--end-group `riscv64-linux-gnu-gcc --print-file-name=crtendS.o` .../csu/crtn.o.../bin/../lib/gcc/riscv64-linux-gnu/14.0.0/../../../../riscv64-linux-gnu/bin/ld: read-only segment has dynamic relocations collect2: error: ld returned 1 exit status make[2]: *** [../Rules:290: .../support/test-run-command] Error 1 I can see there is an autoconf test included with the commit referred that is supposed to catch toolchain configurations that are unsuitable for PIE, however evidently the logic fails to trigger here, so a better one may be needed. Versions of tools used to reproduce: GCC: riscv64-linux-gnu-gcc (GCC) 14.0.0 20240110 (experimental) commit 3353e7d28447 ("RISC-V/testsuite: Fix comment termination in pr105314.c") binutils: GNU ld (GNU Binutils) 2.40.50.20230510 commit 8b7b3b2bf435 ("or1k relocation truncated to fit: R_OR1K_GOT16 even when using -mcmodel=large")
It seems that binutils before 225df051d3d4cf714d1791b9035966a6686b3f3d fails to build static-pie correctly, so maybe add a similar test on glibc configure test.