Skip to content

Commit b711449

Browse files
committed
probe: the macOS link names the target the compile names
1 parent 874cd9c commit b711449

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎src/build/flags.cppm‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,11 +2425,13 @@ CompileFlags compute_flags_impl(const BuildPlan& plan, bool packageLinkFlags) {
24252425
// graph-supplied-target replacement below, which assembles its own
24262426
// `--target=` and `--no-default-config`, and appending them twice
24272427
// would make the outcome depend on the driver's flag ordering.
2428-
std::string apple_cross_ld;
2429-
if (appleCross) {
2430-
apple_cross_ld = crossTarget;
2431-
if (isClangWithCfg) apple_cross_ld += " --no-default-config";
2432-
}
2428+
//
2429+
// The target is named whenever the compile named it, not only for an
2430+
// Apple cross SDK: `x86_64-macos` on an Apple-silicon host compiles
2431+
// x86_64 objects, and a link told nothing ran for arm64 and found no
2432+
// `main` among them (measured on macos-15-arm64).
2433+
std::string apple_cross_ld = crossTarget;
2434+
if (appleCross && isClangWithCfg) apple_cross_ld += " --no-default-config";
24332435
platformAnchor = macos_sdk + version_min;
24342436
f.ld = std::format("{}{}{}{} -fuse-ld=lld{}{}{}{}", full_static,
24352437
b_flag, apple_cross_ld, macos_sdk, version_min,

0 commit comments

Comments
 (0)