rpav / c2ffi

Clang-based FFI wrapper generator
GNU Lesser General Public License v2.1
234 stars 39 forks source link

Failed to build on Arm64 Ubuntu 20.04 #88

Open bpecsek opened 3 years ago

bpecsek commented 3 years ago

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 toclang::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 toclang::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

rpav commented 3 years ago

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.