[build] Ship the clang builtin headers and prefer them at runtime - #33
[build] Ship the clang builtin headers and prefer them at runtime#33aaronj0 wants to merge 1 commit into
Conversation
Test Results
|
| endif() | ||
| install(DIRECTORY "${_clang_resource_dir}/include/" | ||
| DESTINATION "cppjit_backend/lib/clang/${LLVM_VERSION_MAJOR}/include" | ||
| ) |
There was a problem hiding this comment.
I suspect this is wrong. The clang resource directory contains a lot more than clang headers. Look at the contents of clang -print-resource-dir.
There was a problem hiding this comment.
Yes but we only ship /include. As per my understanding that is all we need, and the in-process JIT does not use any symbols from the compiler-rt archives in /lib
There was a problem hiding this comment.
The rest of the contents of resource-dir are not a requirement for a self-contained cppjit wheel. They are link time contents so they cannot be used unless we want to load those archives at runtime, all the necesseray llvm libs are already linked into cppinterop_
There was a problem hiding this comment.
If so, you may want to put it as include path? And not as resource directory?
There was a problem hiding this comment.
Nothing in the installed layout is called resource director, but here it is written out as clang/${LLVM_VERSION_MAJOR}/include under cppjit_backend. Yes, the variables CPPJIT_RESOURCE_DIR and ResourceDir are inaccurate. I have now renamed them to say clang include dir. _clang_resource_dir is still correct
198d0e3 to
46a6799
Compare
This is the second part of the patch that ships the required runtime clang headers. With this change, a build/install of cppjit is self-contained and with the LLVM that is statically linked into
libClangCppInterOp.so, we drop the LLVM dependency on a target machine. The wheels build PR will exercise this on clean images without LLVM.