This is an archive of the discontinued LLVM Phabricator instance.

[runtimes] Fix crosscompiling after a7cad6680b4087eff8994f1f99ac40c661a6621f (D97451)
ClosedPublic

Authored by tambre on Mar 3 2021, 6:32 AM.

Details

Summary

It moved the logic for CMake target arguments into llvm_ExternalProject_Add().
No handling was added for CMAKE_CROSSCOMPILING, which has a separate set of compiler_args.
This broke crosscompiling, as now the runtimes builds defaulted to the compiler's default.

I've also added passing of CMAKE_ASM_COMPILER, which was missing before although we were passing the triple for it.

Diff Detail

Event Timeline

tambre created this revision.Mar 3 2021, 6:32 AM
tambre requested review of this revision.Mar 3 2021, 6:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2021, 6:32 AM

Sorry for the oversight and thanks for taking a look!

llvm/cmake/modules/LLVMExternalProjectUtils.cmake
236

I think this could potentially cause issues since callers might not specify TARGET_TRIPLE. Would it maybe make sense to move the block from line 214 further down to also affect the cross compiling build?

tambre updated this revision to Diff 327817.Mar 3 2021, 8:58 AM
tambre marked an inline comment as done.

Move ARG_TARGET_TRIPLE block down to simplify code.

llvm/cmake/modules/LLVMExternalProjectUtils.cmake
236

Not specifying TARGET_TRIPLE probably means non-working crosscompiling for the caller. Only such caller seems to be for the LLVM test suite, which I imagine isn't supported for crosscompiling.

But moving the block down is simpler. Done, thanks!

zero9178 accepted this revision.Mar 3 2021, 9:55 AM

LGTM, but maybe wait half a day to a day or so in case anyone more reputable has anything to add.

This revision is now accepted and ready to land.Mar 3 2021, 9:55 AM