Page MenuHomeFreeBSD

Allow setting the initial LDFLAGS for the cross environment with XLDFLAGS
AbandonedPublic

Authored by arichardson on Nov 2 2017, 5:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 5 2024, 5:38 PM
Unknown Object (File)
Jan 1 2024, 3:55 AM
Unknown Object (File)
Dec 25 2023, 9:39 AM
Unknown Object (File)
Sep 14 2023, 9:11 PM
Subscribers
None

Details

Summary

This allows me to add -fuse-ld=lld/bfd to the build environment without
using XCFLAGS. If I use XCFLAGS the build fails due to the -Werror warning
-Wunused-command-line-argument.

Test Plan

I can now add -fuse-ld=lld by setting XLDFLAGS

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12405
Build 12681: arc lint + arc unit

Event Timeline

FWIW, I used -Wno-unused-command-line-argument in XCFLAGS as my workaround for using -fuse-ld. I'll defer to Bryan on how this should work. One question I have is does this DTRT if a Makefile modifies LDFLAGS? I almost wonder if what we want is to add CCLD and CXXLD variables that are used instead of CC and CXX when linking libraries and programs and have CCLD set to "XCC XCFLAGS XLDFLAGS" and CXXLD set to "XCXX XCXXFLAGS XLDFLAGS" in CROSSENV? (CCLD would default to CC and CXXLD would default to CXX)

There was one Makefile that did a LDFLAGS= instead of += so I guess this is actually quite fragile. Adding CCLD/CXXLD sounds like the better solution and I'll upload a new patch with that approach if @bdrewery agrees that it makes sense.

Should no longer be needed