<div dir="auto"><div>The MachO port of lld (ld64.lld) doesn't work. There is recently some activity to start to fix this situation, but for now you need to use Apple's linker.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 7, 2020, 5:36 AM Edmund Furse via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><span style="font-size:13px">Dear LLVM community I need some help please.</span><div><br></div><div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">I want to use LLVM's clang and lld within a MacOSX sandboxed app.  This is because sandboxing does not allow calls to /usr/bin/clang.</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">The clang binary works fine to compile a file, but ld64.lld comes up with the error "cannot find framework".</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">However similar arguments using /usr/bin/ld instead of ld64.lld works fine.</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">Here are the details:</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><b>Here is the call using /usr/bin/ld</b><span style="font-stretch:normal;font-size:12px;line-height:normal">:</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">/usr/bin/ld HelloObjC.o -o HelloObjC  -v -sdk_version 10.14.0 -macosx_version_min 10.14.0 -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -framework Foundation -framework Cocoa -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk  -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><b>This works correctly</b>.</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><b>Here is the call using ld64.lld:</b></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">/Users/edmundfurse/Documents/NewClang/NewClangM21b/NewClangM21/Tools/bin/ld64.lld HelloObjC.o -o HelloObjC  -v -sdk_version 10.14.0 -macosx_version_min 10.14.0 -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -framework Foundation -framework Cocoa -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/usr/local/lib -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><b>gives the error message:</b></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">Library search paths:</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">Framework search paths:</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">ld64.lld: error: Unable to find framework for -framework Foundation</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px"><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">Any suggestions welcome.</div><div><br></div><div><br></div></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div>