This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix cross-compiling detection
ClosedPublic

Authored by hauhsu on Mar 28 2023, 8:23 PM.

Details

Summary

Previously the detection compares "CMAKE_SYSTEM_NAME" and
"CMAKE_TARGET_SYSTEM_NAME", which only contains OS names like "Linux".
This is not sufficient when cross-compiling for different target CPUs.

This patch uses CMAKE_CROSSCOMPILING, which sets automatically by CMake
when cross compiling.

Diff Detail

Event Timeline

hauhsu created this revision.Mar 28 2023, 8:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2023, 8:23 PM
Herald added subscribers: Enna1, dberris. · View Herald Transcript
hauhsu requested review of this revision.Mar 28 2023, 8:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2023, 8:23 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
hauhsu updated this revision to Diff 509200.Mar 28 2023, 8:32 PM

Remove a redundant space

hauhsu updated this revision to Diff 509206.Mar 28 2023, 9:01 PM

Remove a redundant space.

smeenai accepted this revision.Mar 28 2023, 11:16 PM
smeenai added a subscriber: beanz.

LGTM, unless @phosek or @beanz is aware of some subtlety here.

This revision is now accepted and ready to land.Mar 28 2023, 11:16 PM
phosek accepted this revision.Mar 28 2023, 11:51 PM

LGTM

This revision was automatically updated to reflect the committed changes.