c2ffi
c2ffi copied to clipboard
Failed to build on Arm64 Ubuntu 20.04
I am trying to build c2ffi on an Arm64 Ubuntu 20.04 running under Parallel Desktop on an M1 MacBook Air
I am getting this error at the linking phase:
[ 7%] Linking CXX executable bin/c2ffi
/usr/bin/ld: CMakeFiles/c2ffi.dir/src/Expr.cpp.o: in function macro_type(clang::CompilerInstance&, clang::Preprocessor&, char const*, clang::MacroInfo const*, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)': Expr.cpp:(.text+0x54c): undefined reference to
clang::NumericLiteralParser::NumericLiteralParser(llvm::StringRef, clang::SourceLocation, clang::SourceManager const&, clang::LangOptions const&, clang::TargetInfo const&, clang::DiagnosticsEngine&)'
/usr/bin/ld: CMakeFiles/c2ffi.dir/src/c2ffi.cpp.o: in function main': c2ffi.cpp:(.text.startup+0x240): undefined reference to
clang::SourceManager::createFileID(clang::FileEntry const*, clang::SourceLocation, clang::SrcMgr::CharacteristicKind, int, unsigned int)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/c2ffi.dir/build.make:270: bin/c2ffi] Error 1
make[1]: *** [CMakeFiles/Makefile2:99: CMakeFiles/c2ffi.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
Unfortunately I don't have access to the platform or resources necessary to test or fix this.
It's possible linking additional libraries could fix this; however this must be fixed carefully. Ideally one should include additional options from the LLVM package.
PRs should make sure not to break other platforms, and ideally add CI for the desired platform.