Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I think this is down to some differences in how clang is invoked for compilation and linking. The example I'm basing my usage off is is the Kaleidoscope Tutorial part 3. Note the build invocation, a single call to clang++ (this works fine):
- http://llvm.org/docs/tutorial/LangImpl3.html#full-code-listing
- This ends up calling
- clang++
- -g -O3 toy.cpp
- -I/usr/local/llvm/include
- -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
- -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
- -L/usr/local/llvm/lib -lpthread -lm
- -lLLVMCore -lLLVMSupport
- -o toy
- But Xcode gives me lots of STL link errors. Xcode does this in two steps (with a lot of other cruft). I added the -D equivalents and the search paths and libraries to link to the Xcode project. The first step calls (I tried to bring in only the relevant options; there are many more):
- clang
- -x c++ -g
- -O0
- -std=gnu++11
- -stdlib=libc++
- -D_DEBUG
- -D_GNU_SOURCE
- -D__STDC_CONSTANT_MACROS
- -D__STDC_FORMAT_MACROS
- -D__STDC_LIMIT_MACROS
- -c <path>/libLLVM.cp
- -o <path>/libLLVM.o
- clang++
- -L/usr/local/llvm/lib
- -filelist <a file that contains path to libLLVM.o>
- -stdlib=libc++
- -lLLVMCore
- -lLLVMSupport
- -single_module
- -o <path>libLLVM.dylib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement