Page MenuHomeFreeBSD

Allow using sanitizers for ssp tests with out-of-tree compiler
Needs ReviewPublic

Authored by arichardson on Mon, Feb 22, 11:10 AM.

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 37341
Build 34230: arc lint + arc unit

Event Timeline

dim requested changes to this revision.Tue, Feb 23, 8:16 PM

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
9

Missing dot between 'clang' and 'Otherwise'?

This revision now requires changes to proceed.Tue, Feb 23, 8:16 PM
In D28852#646943, @dim wrote:

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?

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?