Page MenuHomeFreeBSD

For riscv kernel builds, add -N to LDFLAGS instead of replacing the SYSTEM_LD variable.
ClosedPublic

Authored by ian on Dec 24 2019, 11:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 9:50 PM
Unknown Object (File)
Sun, Dec 8, 8:44 AM
Unknown Object (File)
Mon, Nov 25, 12:47 PM
Unknown Object (File)
Oct 4 2024, 7:56 PM
Unknown Object (File)
Oct 4 2024, 1:51 PM
Unknown Object (File)
Oct 2 2024, 8:11 PM
Unknown Object (File)
Oct 2 2024, 1:31 AM
Unknown Object (File)
Oct 1 2024, 11:59 PM
Subscribers

Details

Summary

This avoids duplicating the contents of SYSTEM_LD from kern.pre.mk just to add the -N flag to it. If the basic linker command ever needs to be changed, this will be one less place that has to be found and fixed.

Test Plan

Not tested at all, could a riscv person please test this?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Does anyone know why riscv needs writable text segments? Or if it really does?

If you can find out why -N is needed, please add a comment. Otherwise we are good to go

This revision is now accepted and ready to land.Dec 24 2019, 11:45 PM
In D22920#502031, @ian wrote:

Does anyone know why riscv needs writable text segments? Or if it really does?

It doesn't seem to be required. It builds, boots and runs regression tests (although I've not run the full set yet) happily without the -N.

Just an update to note that the commit for this was reverted in r356078 due to CI build failures. I'm unable to install a working riscv toolchain for building and testing myself, apparently at least in part because I'm still running 12.0-stable (and if I try to upgrade from that my video card turns into a pumpkin).

In D22920#502165, @ian wrote:

Just an update to note that the commit for this was reverted in r356078 due to CI build failures. I'm unable to install a working riscv toolchain for building and testing myself, apparently at least in part because I'm still running 12.0-stable (and if I try to upgrade from that my video card turns into a pumpkin).

Adding -Bdynamic to LDFLAGS fixes the compile issue with the GCC toolchain.

If you are able, can you send me the error you get while trying to build using 12.0-stable? You should be able to build riscv using any supported FreeBSD version.