Page MenuHomePhabricator

clang/test/Driver/fsanitize.c: Fix -fsanitize=vptr using default target
ClosedPublic

Authored by JamesNagurne on Jul 12 2019, 11:25 AM.

Details

Reviewers
MaskRay
Summary

test/Driver/fsanitize.c: Fix -fsanitize=vptr using default target

In revision rL365872, a line containing '-target x86_64-linux-gnu' along
with '-fsanitize=vptr' was modified to only contain the -fsanitize option.

The default implementation of getSupportedSanitizers isn't able to turn
on the vptr sanitizer, and thus, any platform that runs this test will
fail with the error:

clang: error: unsupported option '-fsanitize=vptr' for target '<target>'

Diff Detail

Event Timeline

JamesNagurne created this revision.Jul 12 2019, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2019, 11:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MaskRay accepted this revision.Jul 12 2019, 5:35 PM

Sorry, I accidentally updated this one by mistake. vptr is not always available. Thanks!

This revision is now accepted and ready to land.Jul 12 2019, 5:35 PM
MaskRay added a comment.EditedJul 12 2019, 5:57 PM

I committed this for you in rL365981 (it may have broken a Windows build for a long time. I wanted to fix it soon..). Thanks!

any platform that runs this test will fail with the error:

Not-too-ancient Darwin, FreeBSD, Linux, NetBSD, OpenBSD, Solaris, etc support this, but notable exception is Windows:

% clang -target x86_64-windows -fsanitize=vptr -fno-rtti fsanitize.c '-###'
clang-9: error: unsupported option '-fsanitize=vptr' for target 'x86_64-unknown-windows-msvc'
MaskRay closed this revision.Jul 12 2019, 5:59 PM

I committed this for you in rL365981 (it may have broken a Windows build for a long time. I wanted to fix it soon..). Thanks!

any platform that runs this test will fail with the error:

Not-too-ancient Darwin, FreeBSD, Linux, NetBSD, OpenBSD, Solaris, etc support this, but notable exception is Windows:

% clang -target x86_64-windows -fsanitize=vptr -fno-rtti fsanitize.c '-###'
clang-9: error: unsupported option '-fsanitize=vptr' for target 'x86_64-unknown-windows-msvc'

Yes, my comment was rather misguided here. I didn't mean to say "All platforms", more like "All platforms that don't support -fsanitize=vptr". Specifically, this was affecting our embedded arm target.
Thanks for getting this in!