Edmund Furse via llvm-dev
2020-May-07 09:36 UTC
[llvm-dev] Ld64.lld cannot find Foundation framework
Dear LLVM community I need some help please. 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. The clang binary works fine to compile a file, but ld64.lld comes up with the error "cannot find framework". However similar arguments using /usr/bin/ld instead of ld64.lld works fine. Here are the details: Here is the call using /usr/bin/ld: /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 This works correctly. Here is the call using ld64.lld: /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 gives the error message: Library search paths: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib Framework search paths: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks ld64.lld: error: Unable to find framework for -framework Foundation Any suggestions welcome. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200507/03567a68/attachment-0001.html>
James Y Knight via llvm-dev
2020-May-07 11:26 UTC
[llvm-dev] Ld64.lld cannot find Foundation framework
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. On Thu, May 7, 2020, 5:36 AM Edmund Furse via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Dear LLVM community I need some help please. > > 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. > The clang binary works fine to compile a file, but ld64.lld comes up with > the error "cannot find framework". > However similar arguments using /usr/bin/ld instead of ld64.lld works fine. > > Here are the details: > > *Here is the call using /usr/bin/ld*: > > /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 > > *This works correctly*. > > *Here is the call using ld64.lld:* > > /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 > > *gives the error message:* > > Library search paths: > > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib > Framework search paths: > > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk > > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks > ld64.lld: error: Unable to find framework for -framework Foundation > > Any suggestions welcome. > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200507/5292ed30/attachment.html>
Edmund Furse via llvm-dev
2020-May-07 17:53 UTC
[llvm-dev] Ld64.lld cannot find Foundation framework
Thanks for your reply. Two questions: 1). Will ld64.lld be fixed in LLVM v11.0 and when is this likely to be? 2). You mention Apple’s linker, by which I assume you mean GNU’s ld. Is it possible to get a binary version of ld (preferably that does not use other things from /usr/bin)? Thanks> On 7 May 2020, at 12:26, James Y Knight <jyknight at google.com> wrote: > > 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. > > On Thu, May 7, 2020, 5:36 AM Edmund Furse via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > Dear LLVM community I need some help please. > > 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. > The clang binary works fine to compile a file, but ld64.lld comes up with the error "cannot find framework". > However similar arguments using /usr/bin/ld instead of ld64.lld works fine. > > Here are the details: > > Here is the call using /usr/bin/ld: > > /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 > > This works correctly. > > Here is the call using ld64.lld: > > /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 > > gives the error message: > > Library search paths: > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib > Framework search paths: > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks > ld64.lld: error: Unable to find framework for -framework Foundation > > Any suggestions welcome. > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200507/47f00417/attachment.html>
Possibly Parallel Threads
- Ld64.lld cannot find Foundation framework
- Ld64.lld cannot find Foundation framework
- [LLVMdev] How to run LLVM3.6.1 on OS X (Yosemite, Xcode6.4) OR how to link bitcode generated by OS X clang with LLVM3.6.1
- Missing hivex.h error when compiling on macOS 10.14 (Mojave)
- Unable to build 'lld' on Mac OS 10.9