Issue |
127172
|
Summary |
link libunwind.dylib failed on macOs M1
|
Labels |
new issue
|
Assignees |
|
Reporter |
xbcnn
|
I am trying build llvm locally on macOs M1.
The configuration:
```
cmake -B build -G Ninja -S llvm \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DLIBCXX_INCLUDE_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release
ninja -C build check-cxx
```
Failed messages:
```
[152/156] Performing configure step for 'google-benchmark'
FAILED: libcxx/test/benchmarks/google-benchmark/src/google-benchmark-stamp/google-benchmark-configure /Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/src/google-benchmark-stamp/google-benchmark-configure
cd /Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/src/google-benchmark-build && /opt/homebrew/bin/cmake -GNinja -C/Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/tmp/google-benchmark-cache-Release.cmake -S /Users/test/src/llvm-project/runtimes/../third-party/benchmark -B /Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/src/google-benchmark-build && /opt/homebrew/bin/cmake -E touch /Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/src/google-benchmark-stamp/google-benchmark-configure
loading initial cache file /Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/tmp/google-benchmark-cache-Release.cmake
-- The CXX compiler identification is Clang 21.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /Users/test/src/llvm-project/build2/bin/clang++
-- Check for working CXX compiler: /Users/test/src/llvm-project/build2/bin/clang++ - broken
CMake Error at /opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
The C++ compiler
"/Users/test/src/llvm-project/build2/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/src/google-benchmark-build/CMakeFiles/CMakeScratch/TryCompile-tAEwDV'
Run Build Command(s): /usr/local/bin/ninja -v cmTC_684a5
[1/2] /Users/test/src/llvm-project/build2/bin/clang++ -Wno-unused-command-line-argument -nostdinc++ -isystem /Users/test/src/llvm-project/build2/include/c++/v1 -L/Users/test/src/llvm-project/build2/./lib -Wl,-rpath,/Users/test/src/llvm-project/build2/./lib -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -MD -MT CMakeFiles/cmTC_684a5.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_684a5.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_684a5.dir/testCXXCompiler.cxx.o -c /Users/test/src/llvm-project/build2/runtimes/runtimes-bins/libcxx/test/benchmarks/google-benchmark/src/google-benchmark-build/CMakeFiles/CMakeScratch/TryCompile-tAEwDV/testCXXCompiler.cxx
[2/2] : && /Users/test/src/llvm-project/build2/bin/clang++ -Wno-unused-command-line-argument -nostdinc++ -isystem /Users/test/src/llvm-project/build2/include/c++/v1 -L/Users/test/src/llvm-project/build2/./lib -Wl,-rpath,/Users/test/src/llvm-project/build2/./lib -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_684a5.dir/testCXXCompiler.cxx.o -o cmTC_684a5 && :
FAILED: cmTC_684a5
: && /Users/test/src/llvm-project/build2/bin/clang++ -Wno-unused-command-line-argument -nostdinc++ -isystem /Users/test/src/llvm-project/build2/include/c++/v1 -L/Users/test/src/llvm-project/build2/./lib -Wl,-rpath,/Users/test/src/llvm-project/build2/./lib -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_684a5.dir/testCXXCompiler.cxx.o -o cmTC_684a5 && :
ld: warning: ignoring file /Users/test/src/llvm-project/build2/./lib/libc++.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/Users/test/src/llvm-project/build2/./lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:4 (project)
-- Configuring incomplete, errors occurred!
ninja: build stopped: subcommand failed.
```
So why it building for macOS-x86_64? Did I configure something wrong and how to fix it?
Thanks.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs