We need to build the .o's, but don't need to link. Build a static
library instead of a binary to accmoplish this. This removes the need to
have all the libc and crt stuff built, which is required for a
binary. In addition, trying to build a non-standard binary runs into
trouble with undefined symbols on arm related to EABI, even when using a
simplified startup with -nostdlib -e start.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
MIPS, being the usual odd one out, used __start not _start, FWIW...
Maybe best to be explicit with -e?
Comment Actions
Alternatively you could build either a shared library or just the .o (/ a static library) and avoid the mild hackery needed to not get linker errors for the executable
Comment Actions
I thought of that too... Years ago, I might have opted for the library, but libraries are becoming increasingly complex and I worry that it would be more fragile that -e, which seems a tiny bit more robust...
tools/build/test-includes/test-includes.c | ||
---|---|---|
1 | Is this comment really accurate now that the entry point is specified in the linker flags? |
Comment Actions
Turns out brooks was right in a comment he left on the other review.
arm failed with the previous method, move to build a library method and see if that works.