tomhrr / dale

Lisp-flavoured C
BSD 3-Clause "New" or "Revised" License
1.03k stars 48 forks source link

Compiliation problems again #194

Closed porky11 closed 6 years ago

porky11 commented 6 years ago

I tried building the current version of dale using the current version of llvm. First "Config.h" wasn't found, but I just moved it manually from my build directory to the dale directory. Then there is another error:

[ 72%] Linking CXX executable dalec
libdale.so.0.1: undefined reference to `llvm::TargetRegistry::lookupTarget(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
libdale.so.0.1: undefined reference to `llvm::sys::getDefaultTargetTriple[abi:cxx11]()'
libdale.so.0.1: undefined reference to `llvm::createPrintBasicBlockPass(llvm::raw_ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libdale.so.0.1: undefined reference to `llvm::createPrintModulePass(llvm::raw_ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
libdale.so.0.1: undefined reference to `llvm::createPrintFunctionPass(llvm::raw_ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
libdale.so.0.1: undefined reference to `llvm::sys::DynamicLibrary::getPermanentLibrary(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: error: ld returned 1 exit status

I also got similar errors using old llvm.

It may also be a good idea to add binary releases, but normally, since current llvm is now supported, it should not be necessary.

tomhrr commented 6 years ago

The Config.h problem should be fixed as of 3ee57b7f837258e6877bd5d2dee4a9ea8a343651: were you building with at least that commit?

I'll look into doing binary releases, but for the linking errors, if there are references to cxx11, that is typically due to LLVM being compiled with different options (or a different compiler) from Dale. See e.g. https://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring. Is it possible that's the problem here?

porky11 commented 6 years ago

Most works again now. I had different versions of llvm and clang installed at different location, which may have caused the error. Just the target module-to-markdown didn't work, but after removing it, it compiled without problems.