Repository navigation
Conversation
-ld_classic was added for Xcode 15.3, gated on clang >= 15.0 with no upper
bound. Apple has since removed the classic linker, so every clang from 15
upward was passed a flag that newer linkers only warn about and ignore:
ld: warning: -ld_classic is no longer supported and will be ignored
Probe for it at configure time instead. The flag only produces a warning,
not an error, so the check links a trivial program with -fatal_warnings to
turn that warning into a failure. Linkers that still support the flag are
unaffected and keep it.
Global Size Summary (Total Flash delta in bytes)Built from 05ae33c rebased onto 6743a33
|
Author
|
CI note: the one red check, It fails in QAUTOTUNE with This change also cannot reach that test: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #34924, as discussed there: #34924 (comment)
-ld_classicis gated oncc_version_gte(cfg, 15, 0)with no upper bound, so every clang from 15 upward is passed it. Apple has since removed the classic linker, so on current Xcode every macOS link emits:The flag was added for Xcode 15.3 for a real reason, so it cannot simply be dropped. This probes for it at configure time instead, following the
check_librtpattern incxx_checks.py. The complication is that the flag only produces a warning, not an error, so a plain link test succeeds on both old and new linkers; the check links a trivial program with-fatal_warningsto turn that warning into a failure.Linkers that still accept
-ld_classicare unaffected and keep the flag.Testing
macOS 27.0.1 (26A434), Apple Silicon arm64, Apple clang 21.0.0 (clang-2100.3.34.2), ld PROJECT:ld-27037.1.
Configure reports the new check alongside the existing ones:
and
-ld_classicis absent from the storedLINKFLAGS, with-dead_stripretained:./waf copterlinks with no linker warnings, and the resulting binary boots and runs the SITL sim loop.To check that the probe discriminates rather than always failing, I re-ran it against a flag this linker does accept (
-dead_strip): it reportsavailableand the flag is kept. That is the Xcode 15.3 path, exercised by proxy -- I do not have a 15.3 toolchain to test directly, so confirmation from someone who does would be welcome.Note on the build: master alone does not link on this toolchain until #34924 lands, so the build and run above were done with #34924 merged in locally. This branch itself contains only the two waf files.