This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers, CMake] Basic sanitizer Solaris support (PR 33274)
ClosedPublic

Authored by ro on Dec 6 2017, 7:59 AM.

Details

Summary

This patch, on top of https://reviews.llvm.org/D40898, contains the build system
changes necessary to enable the Solaris/x86 sanitizer port.

The only issue of note is the libclang_rt.sancov_{begin, end} libraries: clang relies on the
linker automatically defining start_SECNAME and stop_SECNAME labels for
sections whose names are valid C identifiers. This is a GNU ld extension not present
in the ELF gABI, also implemented by gold and lld, but not by Solaris ld. To work around
this, I automatically link the sancov_{begin,end} libraries into every executable for now.
There seems to be now way to build individual startup objects like crtbegin.o/crtend.o,
so I've followed the lead of libclang_rt.asan-preinit which also contains just a single
object.

Diff Detail

Event Timeline

ro created this revision.Dec 6 2017, 7:59 AM
Herald added subscribers: Restricted Project, fedor.sergeev, mgorny and 2 others. · View Herald TranscriptDec 6 2017, 7:59 AM
kcc edited reviewers, added: alekseyshl; removed: samsonov.Dec 6 2017, 9:49 AM
kcc added inline comments.
lib/sanitizer_common/CMakeLists.txt
221

Please explain why you do this in the comments.

ro updated this revision to Diff 125906.Dec 7 2017, 1:52 AM

Explain SancovBegin/SancovEnd libraries.

ro marked an inline comment as done.Dec 7 2017, 1:53 AM
alekseyshl accepted this revision.Dec 12 2017, 1:38 PM
This revision is now accepted and ready to land.Dec 12 2017, 1:38 PM
ro updated this revision to Diff 126968.Dec 14 2017, 8:12 AM

Rebased, accounting for the new sanitizer_platform_limits_solaris.{cc,h} files.

Could someone please commit this for me? Thanks.

Just to double check, this patch does not depend on any other and can be committed, right?

ro added a comment.Dec 19 2017, 3:50 PM

Right, it's independent of the few outstanding ones.

This revision was automatically updated to reflect the committed changes.