Page MenuHomeFreeBSD

Avoid recomputing COMPILER_/LINKER_ variables when set explicitly
ClosedPublic

Authored by arichardson on Aug 7 2020, 11:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 5 2025, 2:08 AM
Unknown Object (File)
Dec 27 2024, 3:26 AM
Unknown Object (File)
Dec 10 2024, 6:34 PM
Unknown Object (File)
Nov 24 2024, 12:37 PM
Unknown Object (File)
Nov 23 2024, 1:17 AM
Unknown Object (File)
Nov 22 2024, 10:52 AM
Unknown Object (File)
Nov 22 2024, 10:52 AM
Unknown Object (File)
Nov 21 2024, 4:09 PM
Subscribers

Details

Summary

I noticed that when we build libraries for a different ABI (in CheriBSD) we
were calling ${XCC}/${LD} --version for every directory. It turns out that
this was caused by bsd.compat.mk explicitly setting (X_)COMPILER variables
for that build stage and this stops the _can_export logic from working.
To fix this, we change the check to only set _can_export=no if the variable
is set and it is set to a different value than the cached value.
This noticeably speeds up the tree walk while building compat libraries.

Obtained from: CheriBSD

Test Plan

Adding debug output shows fewer cc --version calls and we have been using this
patch for a long time in CheriBSD.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32833
Build 30244: arc lint + arc unit