From 9b5303bb6b88e020ebb74975791204a00248ca7a Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Thu, 5 Dec 2024 19:47:09 -0500 Subject: [PATCH 1/2] Only no-op on Apple hosts --- lld/MachO/InputFiles.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp index 7fc49b02c89008..7497dd94e7f9d2 100644 --- a/lld/MachO/InputFiles.cpp +++ b/lld/MachO/InputFiles.cpp @@ -158,8 +158,10 @@ static bool checkCompatibility(const InputFile *input) { return true; // Swift LLVM fork downstream change start + #if defined(__APPLE__) error("This version of lld does not support linking for platform " + getPlatformName(platformInfos.front().target.Platform)); return false; + #endif // Swift LLVM fork downstream change end auto it = find_if(platformInfos, [&](const PlatformInfo &info) { From 3f083b2ede6eaf0a5807e6661451f9eadfcbfdb3 Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Fri, 13 Dec 2024 00:23:39 +0530 Subject: [PATCH 2/2] Feedback: improve diagnostics --- lld/MachO/InputFiles.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp index 7497dd94e7f9d2..7f94b893b5e726 100644 --- a/lld/MachO/InputFiles.cpp +++ b/lld/MachO/InputFiles.cpp @@ -159,8 +159,13 @@ static bool checkCompatibility(const InputFile *input) { // Swift LLVM fork downstream change start #if defined(__APPLE__) - error("This version of lld does not support linking for platform " + getPlatformName(platformInfos.front().target.Platform)); + error("This version of lld does not support linking for platform " + getPlatformName(platformInfos.front().target.Platform) + + ". Please use /usr/bin/ld instead."); return false; + #else + // we can't point non-macOS users to /usr/bin/ld, but we should warn them anyway. + warn("This version of lld does not support linking for platform " + getPlatformName(platformInfos.front().target.Platform) + + ". Proceed at your own risk."); #endif // Swift LLVM fork downstream change end