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
F80187934: D28852.diff
Thu, Mar 28, 11:25 PM
Unknown Object (File)
Fri, Mar 22, 2:34 PM
Unknown Object (File)
Fri, Mar 22, 2:34 PM
Unknown Object (File)
Fri, Mar 22, 2:34 PM
Unknown Object (File)
Fri, Mar 22, 11:09 AM
Unknown Object (File)
Fri, Mar 22, 10:56 AM
Unknown Object (File)
Fri, Mar 22, 10:56 AM
Unknown Object (File)
Wed, Mar 20, 7:44 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37341
Build 34230: arc lint + arc unit

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