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 failed] Building for macOS-arm64 but attempting to link with file built for macOS-x86_64 #59

Open
anabioticsoul opened this issue Sep 30, 2023 · 2 comments

Comments

@anabioticsoul
Copy link

Hello everyone, I'm new to SVF. I attempted to utilize SVF as an external library in CLion on macOS Monterey, but encountered a cmake failure along with the following log:

It appears that the SVF library is currently available for x86_64 architecture but not for arm64. Would it be possible to provide an arm64 version for macOS? Your assistance would be greatly appreciated! Thank you very much!

====================[ 构建 | svf-ex | Release-Clang-14 ]==========================
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/xxx/Repositories/git_repos/SVF-example/cmake-build-release-clang-14 --target svf-ex -- -j 6
[ 50%] Linking CXX executable ../bin/svf-ex
ld: warning: ignoring file /Users/xxx/node_modules/svf-lib/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "SVF::LLVMModuleSet::getSVFValue(llvm::Value const*)", referenced from:
      aliasQuery(SVF::PointerAnalysis*, llvm::Value*, llvm::Value*) in svf-ex.cpp.o
  "SVF::LLVMModuleSet::llvmModuleSet", referenced from:
      aliasQuery(SVF::PointerAnalysis*, llvm::Value*, llvm::Value*) in svf-ex.cpp.o
  "SVF::LLVMModuleSet::LLVMModuleSet()", referenced from:
      aliasQuery(SVF::PointerAnalysis*, llvm::Value*, llvm::Value*) in svf-ex.cpp.o
ld: symbol(s) not found for architecture arm64
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [bin/svf-ex] Error 1
make[2]: *** [src/CMakeFiles/svf-ex.dir/all] Error 2
make[1]: *** [src/CMakeFiles/svf-ex.dir/rule] Error 2
make: *** [svf-ex] Error 2

@yuleisui
Copy link
Collaborator

@JasonZhongZexin could help with a build of arm lib in SVF’s CI and SVF’s npm?

@anabioticsoul
Copy link
Author

@JasonZhongZexin could help with a build of arm lib in SVF’s CI and SVF’s npm?

Thank you for your prompt response. I have successfully recompiled SVF using clang. I replaced the original x64 version of libSvfLLVM.a with a version compiled for the arm architecture, and this has resolved the issue. Additionally, it would be greatly appreciated if you could consider updating npm. Thank you once again!

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

2 participants