This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Refactor iOS simulator/device test configuration generation code for LibFuzzer.
ClosedPublic

Authored by delcypher on Jan 22 2020, 4:35 PM.

Details

Summary

In order to do this FUZZER_SUPPORTED_OS had to be pulled out of
lib/fuzzer/CMakeLists.txt and into the main config so we can use it
from the test/fuzzer/CMakeList.txt. FUZZER_SUPPORTED_OS currently
has the same value of SANITIZER_COMMON_SUPPORTED_OS which preserves
the existing behaviour but this allows us in the future to adjust the
supported platforms independent of SANITIZER_COMMON_SUPPORTED_OS. This
mirrors the other sanitizers.

For non-Apple platforms FUZZER_SUPPORTED_OS is not defined and
surprisingly this was the behaviour before this patch because
SANITIZER_COMMON_SUPPORTED_OS was actually empty. This appears to
not matter right now because the functions that take an OS as an
argument seem to ignore it on non-Apple platforms.

While this change tries to be NFC it is technically not because we
now generate an iossim config whereas previously we didn't. This seems
like the right thing to do because the build system was configured to
compile LibFuzzer for iossim but previously we weren't generating a lit
test config for it. The device/simulator testing configs don't run by
default anyway so this shouldn't break testing.

This change relies on the get_capitalized_apple_platform() function
added in a previous commit.

rdar://problem/58798733

Diff Detail

Event Timeline

delcypher created this revision.Jan 22 2020, 4:35 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 22 2020, 4:35 PM
Herald added subscribers: Restricted Project, mgorny. · View Herald Transcript
delcypher updated this revision to Diff 239914.Jan 23 2020, 8:37 AM

Explicitly define LIBFUZZER_TEST_COMPILER

delcypher edited the summary of this revision. (Show Details)Jan 23 2020, 8:40 AM
yln accepted this revision.Jan 23 2020, 11:24 AM
This revision is now accepted and ready to land.Jan 23 2020, 11:24 AM
This revision was automatically updated to reflect the committed changes.