Page MenuHomeFreeBSD

Use LDFLAGS rather than CFLAGS when linking.
ClosedPublic

Authored by brooks on Mar 3 2017, 11:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 10:51 AM
Unknown Object (File)
Mon, Nov 4, 10:49 PM
Unknown Object (File)
Oct 19 2024, 1:44 AM
Unknown Object (File)
Oct 9 2024, 6:27 AM
Unknown Object (File)
Oct 9 2024, 6:27 AM
Unknown Object (File)
Oct 9 2024, 6:27 AM
Unknown Object (File)
Oct 9 2024, 6:05 AM
Unknown Object (File)
Oct 4 2024, 11:06 PM
Subscribers
None

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7887
Build 8027: arc lint + arc unit

Event Timeline

brooks retitled this revision from to Use LDFLAGS rather than CFLAGS when linking..
brooks updated this object.
brooks edited the test plan for this revision. (Show Details)
brooks added reviewers: kan, emaste.

I'm using this in CheriBSD where we're adding -fuse-ld=lld to LDFLAGS in some cases.

Does LDFLAGS contain -m32/64 -mabi and -EB/-EL as appropriate on MIPS? If not, this change will definitely break things.

It defiantly contained -EB. I'm having a hard time figuring out if it contains -m32/64 -mabi because they aren't set be default at it appears that lib32buildenv was nuked making it hard to check that case. I do see that bsd.lib.mk uses only LDFLAGS.

Adding John since he's mucked with CPU flags and libcompat lately.

Quick way to find out is to build mipselhf world using external GCC. It basically gets all things wrong re:default endianness and softfloat.

I have added -mabi=XX to both CFLAGS and LDFLAGS in my mips_xbuild branch (and should push that into head soon). That is needed for external GCC to do sane things with "unusual" ABIs like n32 and el. However, using LDFLAGS when linking instead of CFLAGS seems sensible.

kan edited edge metadata.

This work

This revision is now accepted and ready to land.Mar 4 2017, 8:22 PM
This revision was automatically updated to reflect the committed changes.