With an out-of-tree Clang, we can use the -resource-dir flag when linking
to point it at the runtime libraries from the current SYSROOT.
This moves the path to the clang-internal library directory to a separate
.mk file that can be used by Makefiles that want to find the sanitizer
libraries. I intend to re-use this .mk file for my upcoming changes that
allow building the entire base system with ASAN/UBSAN/MSAN.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Though I dislike this all getting so complex, I guess there is no good alternative way to get the required information. At some point using an external toolchain will become the default, and then it'd better work... :)
I would really like if there was a way to not always have to pass the resource dir option, though. It seems to be unconditonallly passed now? And I don't think we always want to embed rpaths into executables?
lib/libc/tests/ssp/Makefile | ||
---|---|---|
10 | Missing dot between 'clang' and 'Otherwise'? |
I think we should also pass it with the in-tree compiler, otherwise we depend on the compiler install dir containing the sanitizer libraries. Does that even work for universe builds?
I don't like it too much, but it seems to be necessary to be able to build world with sanitizers later, so let's go for it. :)