This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers][Apple][Cmake] Lower C++ standard to 14 for single sanitizer test on Apple platforms
AbandonedPublic

Authored by thetruestblue on Sep 14 2022, 10:56 AM.

Details

Reviewers
yln
rsundahl
wrotki
delcypher
azhar
Group Reviewers
Restricted Project
Summary

This is a not-so-ideal suggestion on how we can add a flag to a single test within SanitizerUnitTestCommon tests. set_source_file_properties(<file> PROPERTIES COMPILE_FLAGS <flag>) does not seem to be considered in generate_compiler_rt_tests. Ideally, this flag would be added in the appropriate CMakeList.txt file in compiler-rt/lib/sanitizer_common/tests/. However, it was not clear how or if it would be possible to add a source-specific change in this file. There are examples of other compiler-rt test-suites using this (i.e. scudo), their source properties are considered (handled with add_compiler_rt_runtime), whereas these are not.

Alternatives:
-We could up this test's macos-min-version to 10.13, rather than lower C++ standard.
-We could apply this flag to the entire test-suite within CMakeList.txt.
-We could up the SANITIZER_MIN_VERSION_DEFAULT to 10.13

Can someone with more cmake know-how recommend an alternative?

rdar://98737270

Diff Detail

Event Timeline

thetruestblue created this revision.Sep 14 2022, 10:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 10:56 AM
thetruestblue requested review of this revision.Sep 14 2022, 10:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 10:56 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
thetruestblue edited the summary of this revision. (Show Details)Sep 14 2022, 10:59 AM
thetruestblue added a reviewer: azhar.
thetruestblue edited the summary of this revision. (Show Details)
MaskRay added a reviewer: Restricted Project.Sep 14 2022, 11:18 AM
thetruestblue retitled this revision from Lower C++ standard to 14 for single sanitizer test on Apple platforms to [Sanitizers][Apple][Cmake] Lower C++ standard to 14 for single sanitizer test on Apple platforms.Sep 14 2022, 11:22 AM
thetruestblue abandoned this revision.Sep 16 2022, 11:04 AM

Abandoning for a more lightweight change.