michaeleisel / zld

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

Compile error on Big Sur with latest XCode #86

Closed dvtkrlbs closed 3 years ago

dvtkrlbs commented 3 years ago
Last 15 lines from /Users/dvtkrlbs/Library/Logs/Homebrew/zld/02.make:
[100%] Built target flags_parse
find abseil-cpp-20200225/build_arm64/absl -name '*.a' | xargs libtool -static -o abseil-cpp-20200225/build/libabsl_arm64.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (escaping.cc.o) in output file used for input files: abseil-cpp-20200225/build_arm64/absl/strings/libabsl_strings.a(escaping.cc.o) and: abseil-cpp-20200225/build_arm64/absl/strings/libabsl_strings_internal.a(escaping.cc.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (flag.cc.o) in output file used for input files: abseil-cpp-20200225/build_arm64/absl/flags/libabsl_flags_internal.a(flag.cc.o) and: abseil-cpp-20200225/build_arm64/absl/flags/libabsl_flags.a(flag.cc.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (usage.cc.o) in output file used for input files: abseil-cpp-20200225/build_arm64/absl/flags/libabsl_flags_usage.a(usage.cc.o) and: abseil-cpp-20200225/build_arm64/absl/flags/libabsl_flags_usage_internal.a(usage.cc.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/strings/libabsl_strings.a(string_view.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/types/libabsl_bad_optional_access.a(bad_optional_access.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/types/libabsl_bad_any_cast_impl.a(bad_any_cast.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/types/libabsl_bad_variant_access.a(bad_variant_access.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/flags/libabsl_flags.a(flag.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/debugging/libabsl_debugging_internal.a(elf_mem_image.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: abseil-cpp-20200225/build_arm64/absl/debugging/libabsl_debugging_internal.a(vdso_support.cc.o) has no symbols
lipo -create abseil-cpp-20200225/build/libabsl_x86_64.a abseil-cpp-20200225/build/libabsl_arm64.a -output abseil-cpp-20200225/build/libabsl.a
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: abseil-cpp-20200225/build/libabsl_x86_64.a and abseil-cpp-20200225/build/libabsl_arm64.a have the same architectures (x86_64) and can't be in the same fat output file
make: *** [abseil-cpp-20200225] Error 1
dvtkrlbs commented 3 years ago

This only happens with brew system and I think it is about building fat binaries for both arm and x86. I will try to disable arm support from the brew file for now.

dvtkrlbs commented 3 years ago

This is really strange I can manually build abseil as a fat library using make abseil-cpp-20200225 but the same thing does not work on brew build step.

michaeleisel commented 3 years ago

yeah, this is due to brew's (IMO insane) shims they use to silently mess with clang invocations. let's merge this with https://github.com/michaeleisel/homebrew-zld/issues/4 . also, please try brew upgrade again