mvn包错误,因为在制作llvm项目时自动添加-arch x86_64。 M1

发布于 2025-01-15 01:08:34 字数 2113 浏览 0 评论 0原文

当我使用 mvn 包时,我收到如下错误消息:

Determining if the CXX compiler works failed with the following output:
Change Dir: /Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp

Run Build Command(s):/opt/homebrew/bin/gmake -f Makefile cmTC_81381/fast && /opt/homebrew/bin/gmake  -f CMakeFiles/cmTC_81381.dir/build.make CMakeFiles/cmTC_81381.dir/build
gmake[1]: Entering directory '/Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o
/opt/homebrew/opt/llvm/bin/clang++   -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -MD -MT CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o -c /Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_81381
/opt/homebrew/Cellar/cmake/3.22.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81381.dir/link.txt --verbose=1
/opt/homebrew/opt/llvm/bin/clang++  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib  CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o -o cmTC_81381 
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libc++.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [CMakeFiles/cmTC_81381.dir/build.make:100: cmTC_81381] Error 1
gmake[1]: Leaving directory '/Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_81381/fast] Error 2

我已经尝试过

arch arm64 mvn package

,但没有成功。 当我只尝试创建此 Maven 项目的子模块(此错误之一)时,我的 clang++ 工作得很好。

when I'm using mvn package, I got error message like this:

Determining if the CXX compiler works failed with the following output:
Change Dir: /Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp

Run Build Command(s):/opt/homebrew/bin/gmake -f Makefile cmTC_81381/fast && /opt/homebrew/bin/gmake  -f CMakeFiles/cmTC_81381.dir/build.make CMakeFiles/cmTC_81381.dir/build
gmake[1]: Entering directory '/Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o
/opt/homebrew/opt/llvm/bin/clang++   -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -MD -MT CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o -c /Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_81381
/opt/homebrew/Cellar/cmake/3.22.3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81381.dir/link.txt --verbose=1
/opt/homebrew/opt/llvm/bin/clang++  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib  CMakeFiles/cmTC_81381.dir/testCXXCompiler.cxx.o -o cmTC_81381 
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libc++.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [CMakeFiles/cmTC_81381.dir/build.make:100: cmTC_81381] Error 1
gmake[1]: Leaving directory '/Users/steven/k/llvm-backend/target/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_81381/fast] Error 2

I have tried

arch arm64 mvn package

It didn't work.
My clang++ work well when I only try to make the submodule (this error one) of this maven project.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

[浮城] 2025-01-22 01:08:34
       <exec executable="cmake" dir="${project.build.directory}/build" failonerror="true">
          <arg value="-DCMAKE_OSX_ARCHITECTURES='arm64'"/>
          <arg value="-DCMAKE_PREFIX_PATH=${prefix.path}" />
          <arg value="-DCMAKE_BUILD_TYPE=${project.build.type}" />
          <arg value="-DCMAKE_INSTALL_PREFIX=${llvm.backend.prefix}" />
          <arg value="-DGC_INTERVAL=${llvm.backend.gc.interval}" />
          <arg value="${project.basedir}/src/main/native/llvm-backend" />
        </exec>
       <exec executable="cmake" dir="${project.build.directory}/build" failonerror="true">
          <arg value="-DCMAKE_OSX_ARCHITECTURES='arm64'"/>
          <arg value="-DCMAKE_PREFIX_PATH=${prefix.path}" />
          <arg value="-DCMAKE_BUILD_TYPE=${project.build.type}" />
          <arg value="-DCMAKE_INSTALL_PREFIX=${llvm.backend.prefix}" />
          <arg value="-DGC_INTERVAL=${llvm.backend.gc.interval}" />
          <arg value="${project.basedir}/src/main/native/llvm-backend" />
        </exec>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文