This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Get Android API from --target
ClosedPublic

Authored by vitalybuka on Nov 4 2020, 1:12 PM.

Diff Detail

Event Timeline

vitalybuka created this revision.Nov 4 2020, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2020, 1:12 PM
Herald added subscribers: Restricted Project, mgorny. · View Herald Transcript
vitalybuka requested review of this revision.Nov 4 2020, 1:12 PM
oontvoo added inline comments.Nov 4 2020, 1:24 PM
compiler-rt/CMakeLists.txt
280

I thought this was causing cmake error

http://lab.llvm.org:8011/#/builders/99/builds/447

Do you know why it was broken?
Is that because of undefined ANDROID_API_LEVEL?
if so if(ANDROID AND should be enough.

Is there any other reason to run CHECK_CXX_SOURCE_COMPILES? it's should be slower than REGEX MATCH.

Do you know why it was broken?
Is that because of undefined ANDROID_API_LEVEL?
if so if(ANDROID AND should be enough.

Nice, it's on our bot. I'll figure that out myself.

Is there any other reason to run CHECK_CXX_SOURCE_COMPILES? it's should be slower than REGEX MATCH.

This Q is still open.

Do you know why it was broken?
Is that because of undefined ANDROID_API_LEVEL?
if so if(ANDROID AND should be enough.

Wouldn't it still become if (ANDROID AND <empty> GREATER_EQUAL 28), which is still malformed?
How about we just set ANDROID_API_LEVEL to -1 for the non-android case?

(Disclaimer: not an expert in cmake)

Is there any other reason to run CHECK_CXX_SOURCE_COMPILES? it's should be slower than REGEX MATCH.

No. I was just trying to avoid the cmake error.

vitalybuka updated this revision to Diff 302966.Nov 4 2020, 2:00 PM

fix cmake error

compiler-rt/CMakeLists.txt
280

this works

vitalybuka added inline comments.Nov 4 2020, 2:02 PM
compiler-rt/CMakeLists.txt
280

True if the given string or variable’s value is a valid number and greater than or equal to that on the right.

undef is going to be empty string so it's not a number

oontvoo accepted this revision.Nov 4 2020, 2:04 PM
This revision is now accepted and ready to land.Nov 4 2020, 2:04 PM
This revision was landed with ongoing or failed builds.Nov 4 2020, 2:06 PM
This revision was automatically updated to reflect the committed changes.