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)
Mar 11 2024, 4:04 AM
Unknown Object (File)
Jan 30 2024, 2:56 PM
Unknown Object (File)
Dec 22 2023, 11:55 PM
Unknown Object (File)
Oct 17 2023, 6:11 AM
Unknown Object (File)
Sep 12 2023, 8:38 AM
Unknown Object (File)
Sep 6 2023, 7:09 AM
Unknown Object (File)
Sep 6 2023, 7:06 AM
Unknown Object (File)
Sep 6 2023, 7:05 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 28308

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.