File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -340,8 +340,21 @@ static mlir::LogicalResult getLinkerInvocation(
340340 driver.ResourceDir =
341341 llvm::StringRef (clangResourceDir.data (), clangResourceDir.size ());
342342 if (targetMac and not llvm::sys::Process::GetEnv (" SDKROOT" ))
343- driver.SysRoot = " /Applications/Xcode.app/Contents/Developer/Platforms/"
344- " MacOSX.platform/Developer/SDKs/MacOSX.sdk" ;
343+ {
344+ if (llvm::sys::fs::exists (
345+ " /Applications/Xcode.app/Contents/Developer/Platforms/"
346+ " MacOSX.platform/Developer/SDKs/MacOSX.sdk" ))
347+ driver.SysRoot = " /Applications/Xcode.app/Contents/Developer/Platforms/"
348+ " MacOSX.platform/Developer/SDKs/MacOSX.sdk" ;
349+ else if (llvm::sys::fs::exists (
350+ " /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" ))
351+ driver.SysRoot = " /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" ;
352+ else
353+ {
354+ llvm::errs () << " could not find SDKROOT, set it with export "
355+ " SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" ;
356+ }
357+ }
345358
346359 std::unique_ptr<clang::driver::Compilation> C (driver.BuildCompilation (args));
347360 if (!C)
@@ -465,7 +478,7 @@ static int linkLibraries(
465478 else
466479 {
467480 argSource.push_back (" -undefined" );
468- argSource.push_back (" suppress " );
481+ argSource.push_back (" dynamic_lookup " );
469482 }
470483
471484 argSource.push_back (" -o" );
You can’t perform that action at this time.
0 commit comments