casaroli opened a new pull request, #21469: URL: https://github.com/apache/nuttx/pull/21469
## Summary Five boards linked libgcc inside the group of the user libraries of a protected build: at32f437-mini, qemu-armv7r, stm32f4discovery, lm3s6965-ek and fvp-armv8r. Inside the group, the linker takes a function from libgcc as soon as the applications refer to it, before it scans libc again. So a function that both libc and libgcc define comes from libgcc. This PR links libgcc after the group, as the other boards do: `--start-group $(USER_LDLIBS) --end-group $(USER_LIBGCC)` in place of `--start-group $(USER_LDLIBS) $(USER_LIBGCC) --end-group`. Today no function in these images is in both, so this PR fixes nothing that a program can see. It matters when libc defines such a function, as #20723 does for `__emutls_get_address()`: with the old order these boards link the copy of libgcc. `[skip-cmake-parity]`: only these five Make files have this order. ## Impact Only the user image of a protected build of the five boards, with Make. The images keep the same archive members and the same symbols. The libgcc code moves to another place in the image. No ABI change. Not a breaking change. ## Testing Link maps with and without this PR, on master 6b9b216ff30, Arm GNU 13.2 and AArch64 GNU 14.2: | Configuration | Archive members, master | with this PR | |---|---|---| | `lm3s6965-ek:qemu-protected` | 418 (8 from libgcc) | the same 418 | | `fvp-armv8r:pnsh` | 342 (none from libgcc) | the same 342 | `nm` of the user image, with and without this PR: `qemu-armv7r:pnsh`, `stm32f4discovery:kostest`, `lm3s6965-ek:qemu-kostest`, `lm3s6965-ek:qemu-protected` and `fvp-armv8r:pnsh` have the same symbols. These images were not run. at32f437-mini has no protected configuration in the tree, so its Makefile is not built. With #20723 and a program with a `__thread` variable, the user image links libgcc's `emutls.o` without this PR and libc's `tls_emutls.o` with it, on `lm3s6965-ek:qemu-protected` and `fvp-armv8r:pnsh`. Builds with `EXTRAFLAGS="-Wno-cpp -Werror"`, each OK: the five configurations above, and qemu-armv8a:nsh, rv-virt:pnsh64, mps2-an500:knsh. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
