Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure on iwarilama's Mac #1130

Closed
strager opened this issue Dec 22, 2023 · 2 comments
Closed

build failure on iwarilama's Mac #1130

strager opened this issue Dec 22, 2023 · 2 comments
Assignees

Comments

@strager
Copy link
Collaborator

strager commented Dec 22, 2023

ninja -C build quick-lint-js     


ninja: Entering directory `build'
[1/102] Linking CXX executable quick-lint-js-generate-diagnostic-metadata
FAILED: quick-lint-js-generate-diagnostic-metadata 
: && /opt/homebrew/opt/llvm/bin/clang++ -D_LIBCPP_DISABLE_AVAILABILITY -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib -L/opt/homebrew/opt/llvm/lib/c++ tools/CMakeFiles/quick-lint-js-generate-diagnostic-metadata.dir/generate-diagnostic-metadata.cpp.o -o quick-lint-js-generate-diagnostic-metadata -L/opt/homebrew/opt/llvm/lib   -L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++  libquick-lint-js-precompiled-headers.a  src/libquick-lint-js-tool-lib.a  libquick-lint-js-precompiled-headers.a  vendor/simdjson/libsimdjson.a && :
ld: warning: ignoring duplicate libraries: 'libquick-lint-js-precompiled-headers.a'
ld: archive member '/' not a mach-o file in '/Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/libquick-lint-js-precompiled-headers.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2/102] Linking CXX executable quick-lint-js-compile-translations
FAILED: quick-lint-js-compile-translations 
: && /opt/homebrew/opt/llvm/bin/clang++ -D_LIBCPP_DISABLE_AVAILABILITY -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib -L/opt/homebrew/opt/llvm/lib/c++ tools/CMakeFiles/quick-lint-js-compile-translations.dir/compile-translations.cpp.o -o quick-lint-js-compile-translations -L/opt/homebrew/opt/llvm/lib   -L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++  libquick-lint-js-precompiled-headers.a  src/libquick-lint-js-tool-lib.a  libquick-lint-js-precompiled-headers.a  vendor/simdjson/libsimdjson.a && :
ld: warning: ignoring duplicate libraries: 'libquick-lint-js-precompiled-headers.a'
ld: archive member '/' not a mach-o file in '/Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/libquick-lint-js-precompiled-headers.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[3/102] Linking CXX executable quick-lint-js-generate-trace-sources
FAILED: quick-lint-js-generate-trace-sources 
: && /opt/homebrew/opt/llvm/bin/clang++ -D_LIBCPP_DISABLE_AVAILABILITY -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib -L/opt/homebrew/opt/llvm/lib/c++ tools/CMakeFiles/quick-lint-js-generate-trace-sources.dir/generate-trace-sources.cpp.o -o quick-lint-js-generate-trace-sources -L/opt/homebrew/opt/llvm/lib   -L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++  libquick-lint-js-precompiled-headers.a  src/libquick-lint-js-tool-lib.a  libquick-lint-js-precompiled-headers.a  vendor/simdjson/libsimdjson.a && :
ld: warning: ignoring duplicate libraries: 'libquick-lint-js-precompiled-headers.a'
ld: archive member '/' not a mach-o file in '/Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/libquick-lint-js-precompiled-headers.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[4/102] Linking CXX executable quick-lint-js-generate-lex-keyword
FAILED: quick-lint-js-generate-lex-keyword 
: && /opt/homebrew/opt/llvm/bin/clang++ -D_LIBCPP_DISABLE_AVAILABILITY -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib -L/opt/homebrew/opt/llvm/lib/c++ tools/CMakeFiles/quick-lint-js-generate-lex-keyword.dir/generate-lex-keyword.cpp.o -o quick-lint-js-generate-lex-keyword -L/opt/homebrew/opt/llvm/lib   -L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++  libquick-lint-js-precompiled-headers.a  src/libquick-lint-js-tool-lib.a  libquick-lint-js-precompiled-headers.a  vendor/simdjson/libsimdjson.a && :
ld: warning: ignoring duplicate libraries: 'libquick-lint-js-precompiled-headers.a'
ld: archive member '/' not a mach-o file in '/Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/libquick-lint-js-precompiled-headers.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
@strager strager self-assigned this Dec 22, 2023
@strager
Copy link
Collaborator Author

strager commented Dec 22, 2023

After working around the above issue, we get another issue:

[163/325] Generating quick-lint-js-licenses.txt
FAILED: src/quick-lint-js-licenses.txt /Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/src/quick-lint-js-licenses.txt 
cd /Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/src && /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 /Users/iwarilama/Desktop/Code/dump/quick-lint-js/cmake/../tools/collect-copyright --build-directory /Users/iwarilama/Desktop/Code/dump/quick-lint-js/build --linkmap /Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/src/quick-lint-js.trace >"/Users/iwarilama/Desktop/Code/dump/quick-lint-js/build/src/quick-lint-js-licenses.txt"
Traceback (most recent call last):
  File "/Users/iwarilama/Desktop/Code/dump/quick-lint-js/cmake/../tools/collect-copyright", line 1686, in <module>
    main()
  File "/Users/iwarilama/Desktop/Code/dump/quick-lint-js/cmake/../tools/collect-copyright", line 276, in main
    dump_from_linkmap(
  File "/Users/iwarilama/Desktop/Code/dump/quick-lint-js/cmake/../tools/collect-copyright", line 308, in dump_from_linkmap
    dump_from_projects(
  File "/Users/iwarilama/Desktop/Code/dump/quick-lint-js/cmake/../tools/collect-copyright", line 327, in dump_from_projects
    raise Exception(f"could not find source for archive: {archive}") from None
Exception: could not find source for archive: src/libquick-lint-js-diagnostic-metadata.a[2]
[165/325] Building CXX object test/CMakeFiles/quick-lint-js-test.dir/cmake_pch_arm64.hxx.pch
ninja: build stopped: subcommand failed.

@strager
Copy link
Collaborator Author

strager commented Dec 22, 2023

I can reproduce the bugs if I use Apple's new linker (from Xcode 15.1 specifically).

strager added a commit that referenced this issue Dec 22, 2023
Xcode 15 introduces Apple's new linker. Fix compatibility with new
linker:

* Work around errors when linking archives with empty object files.
* Fix collect-copyright script to work with the new linker's slightly
  different linker map file format.

Fixes #1130.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant