SVF-example icon indicating copy to clipboard operation
SVF-example copied to clipboard

[Build failed] Building for macOS-arm64 but attempting to link with file built for macOS-x86_64

Open anabioticsoul opened this issue 1 year ago • 2 comments

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

anabioticsoul avatar Sep 30 '23 03:09 anabioticsoul

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

yuleisui avatar Sep 30 '23 04:09 yuleisui

@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!

anabioticsoul avatar Sep 30 '23 10:09 anabioticsoul