This is an archive of the discontinued LLVM Phabricator instance.

Use host's executable suffix for clang when cross-compiling compiler-rt
ClosedPublic

Authored by broadwaylamb on Sep 10 2019, 7:55 AM.

Details

Summary

When cross-compiling compiler-rt as part of LLVM e. g. for Linux on
a Windows host and using the just-built clang as cross-compiler, we set
the -DBUILTINS_CMAKE_ARGS="-DCMAKE_SYSTEM_NAME=Linux" flag in top-level
cmake invocation, which causes CMAKE_EXECUTABLE_SUFFIX to be an empty
string in the nested cmake invocation for building builtins.

But the compiler for compiling test cases is meant to be run on host,
therefore it may have the '.exe' suffix.

Handle this by asking cmake about the host system.

Diff Detail

Repository
rL LLVM

Event Timeline

broadwaylamb created this revision.Sep 10 2019, 7:55 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 10 2019, 7:55 AM
Herald added subscribers: llvm-commits, Restricted Project, mgorny, dberris. · View Herald Transcript
rnk accepted this revision.Sep 10 2019, 6:05 PM

lgtm

This revision is now accepted and ready to land.Sep 10 2019, 6:05 PM
In D67401#1665548, @rnk wrote:

lgtm

I don't have commit access, can I ask you to commit this for me? Or is there anything else that needs to be done?

rnk added a comment.Sep 12 2019, 11:44 AM
In D67401#1665548, @rnk wrote:

lgtm

I don't have commit access, can I ask you to commit this for me? Or is there anything else that needs to be done?

Sure, I landed it in r371754. I actually tested it on Windows before landing, and check-asan seemed to work.

This revision was automatically updated to reflect the committed changes.