This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Passthrough CMAKE_SYSTEM_NAME to default builtin and runtimes target
ClosedPublic

Authored by phosek on Jan 31 2020, 2:55 PM.

Details

Summary

When building the default builtin and runtimes target, set the
CMAKE_SYSTEM_NAME to the current one. This is not necessary on
Linux and Darwin, but it appears to be necessary on Windows,
otherwise CMake fails.

Diff Detail

Event Timeline

phosek created this revision.Jan 31 2020, 2:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2020, 2:55 PM
smeenai accepted this revision.Feb 4 2020, 5:25 PM

LGTM

This seems like strange behavior on CMake's part, but the change is fine.

This revision is now accepted and ready to land.Feb 4 2020, 5:25 PM
This revision was automatically updated to reflect the committed changes.

Hello Petr,

these changes break the Windows to ARM Linux cross builders:
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/4166
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/4144

We pass a proper CMAKE_SYSTEM_NAME for the target build through BUILTINS_CMAKE_ARGS and RUNTIMES_CMAKE_ARGS variables, such as

set(BUILTINS_CMAKE_ARGS  "-DCMAKE_SYSTEM_NAME=Linux" CACHE STRING "")
set(RUNTIMES_CMAKE_ARGS  "-DCMAKE_SYSTEM_NAME=Linux" CACHE STRING "")

(see clang/cmake/caches/CrossWinToARMLinux.cmake for details)

Your change pass a host system name that is Windows in our case and it is incorrect for the build target.

Is there a way to pass a proper system name in that case?