michaeleisel / zld

A faster version of Apple's linker
MIT License
1.19k stars 50 forks source link

Using pre-built zld #78

Closed michaeleisel closed 3 years ago

michaeleisel commented 3 years ago

It appears that zld doesn't build on OSX 10.15 for ARM, and maybe that's due to missing arm variants in dylibs. During make, I get:

    Run Build Command(s):/usr/bin/make cmTC_2bd92/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_2bd92.dir/build.make CMakeFiles/cmTC_2bd92.dir/build
    Building CXX object CMakeFiles/cmTC_2bd92.dir/testCXXCompiler.cxx.o
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=11.0 -o CMakeFiles/cmTC_2bd92.dir/testCXXCompiler.cxx.o -c /Users/meisel/projects/zld/abseil-cpp-20200225/build_arm64/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_2bd92
    /usr/local/Cellar/cmake/3.18.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2bd92.dir/link.txt --verbose=1
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_2bd92.dir/testCXXCompiler.cxx.o -o cmTC_2bd92 
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libc++.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libc++.tbd
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

In that case, maybe it's time to give up on recommending people build it from scratch, and just distribute a pre-built fat binary. Can someone provide the built version? @thii ?

thii commented 3 years ago

Are you sure you're not using an x86 cmake?

thii commented 3 years ago

Here's a prebuilt version: zld.e58a15e.tar.gz

michaeleisel commented 3 years ago

What do you mean by x86 cmake? I'm just doing git clean -dfx && make on an x86 10.15 mac

thii commented 3 years ago

Ahh, sorry I thought you were trying to build on an arm Mac.

thii commented 3 years ago

I think it's just linking with the wrong SDK. You need at least macOS 11.0 SDK which is only included in Xcode 12.2+.

michaeleisel commented 3 years ago

OK makes sense, I think I'll just put up the pre-built version then

michaeleisel commented 3 years ago

Version is uploaded, readme updated in 4773cfd05b730d3c14fc70b4e56fbf14c8be42d7