[all-commits] [llvm/llvm-project] 0ecd4f: [compiler-rt] Check for missing CMAKE_C_COMPILER_T...
David Spickett via All-commits
all-commits at lists.llvm.org
Thu Apr 6 05:56:05 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0ecd4f6c55c0cb4e9ba0e03758925da8cef66088
https://github.com/llvm/llvm-project/commit/0ecd4f6c55c0cb4e9ba0e03758925da8cef66088
Author: David Spickett <david.spickett at linaro.org>
Date: 2023-04-06 (Thu, 06 Apr 2023)
Changed paths:
M compiler-rt/cmake/Modules/CompilerRTUtils.cmake
Log Message:
-----------
[compiler-rt] Check for missing CMAKE_C_COMPILER_TARGET when using COMPILER_RT_DEFAULT_TARGET_ONLY
COMPILER_RT_DEFAULT_TARGET_ONLY is the goto workaround for building
only one of a multilib setup while still being able to autodetect the native target.
For example only building 64 bit libraries on Intel instead of 32 and 64 bit.
Which may fail without 32 bit compatibility libs installed.
As reported in https://discourse.llvm.org/t/configuring-compiler-rt-to-use-default-target-only-does-not-work/62727
this build config hasn't worked in a while.
It relies on a variable usually set during cross compliation,
though my testing shows you can set it in other scenarios too.
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_TARGET.html
So the options you need to provide are:
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DCMAKE_C_COMPILER_TARGET="aarch64-unknown-linux-gnu"
And we should error if CMAKE_C_COMPILER_TARGET isn't set.
Reviewed By: glaubitz
Differential Revision: https://reviews.llvm.org/D147598
More information about the All-commits
mailing list