Page MenuHomeFreeBSD

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

Authored by arichardson on Feb 22 2021, 11:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 6:57 PM
Unknown Object (File)
Mon, Oct 21, 2:05 PM
Unknown Object (File)
Oct 4 2024, 12:52 PM
Unknown Object (File)
Oct 4 2024, 11:41 AM
Unknown Object (File)
Sep 28 2024, 4:34 AM
Unknown Object (File)
Sep 27 2024, 3:39 AM
Unknown Object (File)
Sep 24 2024, 10:39 AM
Unknown Object (File)
Sep 14 2024, 12:40 AM
Subscribers

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim requested changes to this revision.Feb 23 2021, 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
10

Missing dot between 'clang' and 'Otherwise'?

This revision now requires changes to proceed.Feb 23 2021, 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?

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. :)

This revision is now accepted and ready to land.Mar 5 2021, 8:39 PM