[WIP] toolchain: Add cxx_lib attribute to inject libc++ in x-compile#696
[WIP] toolchain: Add cxx_lib attribute to inject libc++ in x-compile#696phlax wants to merge 1 commit intobazel-contrib:masterfrom
Conversation
dzbarsky
left a comment
There was a problem hiding this comment.
What issues did you hit? In my experience, the c++ standard library include/ doesn't vary between targets (aside from a few minor things like fortran and libomp headers) and when cross-compiling the cxx lib comes from the sysroot, which this toolchain already supports?
|
i didnt really want to put it into sysroot, our sysroot currently does have libstdc++ but i wanted to remove that also - so its just glibc there is a fix that this pr requires, but otherwise this is working really nicely in patches |
Signed-off-by: Ryan Northey <ryan@synca.io>
|
@dzbarsky i probably didnt answer your question very well - i have updated the description which should hopefully address it if including this is something the project is willing to consider, i would be happy to add some tests/docs |
|
fwiw - i think more fixes from downstream testing being tested atm - will update once that is done |
when cross-compiling you only need the exec toolchain and not the target one, except for the c++ libs themselves
to work around this currently toolchains_llvm falls back to using libstdc++ on the assumption that it is more likely to be present either on the host or in the sysroot
these foreign arch libs are only provided in the huge arch-specific toolchain or release tarballs, so we were keen not to have consumers downloading multiple toolchains for additional arches
to workaround this, we (envoy) now publish tarballs containining only
lib/andinclude/folders with the libc++ libs fished out of the llvm release tarballthis PR allows toolchains_llvm to make use of this - example config from current envoy (workspace):
it can also be used with bzlmod like so
partial fix for #694