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)
Sun, Mar 24, 6:12 PM
Unknown Object (File)
Dec 23 2023, 12:25 PM
Unknown Object (File)
Dec 23 2023, 12:25 PM
Unknown Object (File)
Dec 18 2023, 10:15 AM
Unknown Object (File)
Nov 12 2023, 5:58 AM
Unknown Object (File)
Oct 31 2023, 3:16 AM
Unknown Object (File)
Oct 20 2023, 11:14 AM
Unknown Object (File)
Aug 29 2023, 3:35 PM
Subscribers
None

Diff Detail

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

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.