This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Fix use of -asan-instrument-assembly in tests
ClosedPublic

Authored by foad on Nov 10 2014, 1:45 AM.

Details

Summary

The option -asan-instrument-assembly is declared in the X86 backend.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=All then the
option is tolerated but ignored.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=PowerPC then
the testsuite fails with:
[ 93%] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64-inline.o
clang (LLVM option parsing): Unknown command line argument '-asan-instrument-assembly'. Try: 'clang (LLVM option parsing) -help'

Fix this inconsistency by only adding the option if that toolchain was
built with the X86 backend included.

Diff Detail

Event Timeline

foad updated this revision to Diff 15970.Nov 10 2014, 1:45 AM
foad retitled this revision from to [ASan] Fix use of -asan-instrument-assembly in tests.
foad updated this object.
foad edited the test plan for this revision. (Show Details)
foad added reviewers: kcc, samsonov, eugenis.
foad added a subscriber: Unknown Object (MLST).
eugenis edited edge metadata.Nov 10 2014, 2:26 AM

I just discovered I had a fix for this from half a year ago.
Not sure which one is better.
http://reviews.llvm.org/D4718

foad added a comment.Nov 10 2014, 2:43 AM
In D6190#4, @eugenis wrote:

I just discovered I had a fix for this from half a year ago.
Not sure which one is better.
http://reviews.llvm.org/D4718

Thanks! D4718 looks cleaner to me. I assume instrumented assembly will be supported on more targets in the future.

eugenis accepted this revision.Nov 11 2014, 4:56 AM
eugenis edited edge metadata.

No, D4718 does not work as TargetMachine.cpp does not get linked into llvm-mc. I'm not sure why, and can't spend more time on this right now. If you feel like it, you could try fixing it the right way, or just land this cmake patch.

This revision is now accepted and ready to land.Nov 11 2014, 4:56 AM
foad closed this revision.Nov 11 2014, 5:35 AM