Skip to content

Commit f4d60e2

Browse files
authored
[CMake] Remove supporting of DEFAULT_SYSROOT for the ARM/Aarch64 cross builds. NFC. (#94300)
Avoid usage DEFAULT_SYSROOT CMake variable to confgiure the ARM/Aarch64 cross platform toolchain builds. Use the Clang configuration files with proper `--sysroot=` in it instead. More details could be found here: #94284
1 parent 68761a9 commit f4d60e2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

clang/cmake/caches/CrossWinToARMLinux.cmake

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@
66
# on Windows platform.
77
#
88
# NOTE: the build requires a development ARM Linux root filesystem to use
9-
# proper target platform depended library and header files.
9+
# proper target platform depended library and header files:
10+
# - create <full-path-to-clang-configs> directory and put the clang configuration
11+
# file named <TOOLCHAIN_TARGET_TRIPLE>.cfg into it.
12+
# - add the `--sysroot=<path-to-develop-arm-linux-root-fs>` argument into
13+
# this configuration file.
14+
# - add other necessary target depended clang arguments there,
15+
# such as '-mcpu=cortex-a78' & etc.
16+
#
17+
# See more details here: https://clang.llvm.org/docs/UsersManual.html#configuration-files
1018
#
1119
# Configure:
1220
# cmake -G Ninja ^
13-
# -DTOOLCHAIN_TARGET_TRIPLE=armv7-unknown-linux-gnueabihf ^
21+
# -DTOOLCHAIN_TARGET_TRIPLE=aarch64-unknown-linux-gnu ^
1422
# -DCMAKE_INSTALL_PREFIX=../install ^
15-
# -DDEFAULT_SYSROOT=<path-to-develop-arm-linux-root-fs> ^
16-
# -DLLVM_AR=<llvm_obj_root>/bin/llvm-ar[.exe] ^
23+
# -DCLANG_CONFIG_FILE_USER_DIR=<full-path-to-clang-configs> ^
1724
# -DCMAKE_CXX_FLAGS="-D__OPTIMIZE__" ^
1825
# -DREMOTE_TEST_HOST="<hostname>" ^
1926
# -DREMOTE_TEST_USER="<ssh_user_name>" ^
@@ -43,10 +50,6 @@ get_filename_component(LLVM_PROJECT_DIR
4350
"${CMAKE_CURRENT_LIST_DIR}/../../../"
4451
ABSOLUTE)
4552

46-
if (NOT DEFINED DEFAULT_SYSROOT)
47-
message(WARNING "DEFAULT_SYSROOT must be specified for the cross toolchain build.")
48-
endif()
49-
5053
if (NOT DEFINED LLVM_ENABLE_ASSERTIONS)
5154
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
5255
endif()
@@ -136,7 +139,6 @@ endif()
136139
set(LLVM_BUILTIN_TARGETS "${TOOLCHAIN_TARGET_TRIPLE}" CACHE STRING "")
137140

138141
set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_SYSTEM_NAME "Linux" CACHE STRING "")
139-
set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_SYSROOT "${DEFAULT_SYSROOT}" CACHE STRING "")
140142
set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_INSTALL_RPATH "${RUNTIMES_INSTALL_RPATH}" CACHE STRING "")
141143
set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
142144
set(BUILTINS_${TOOLCHAIN_TARGET_TRIPLE}_LLVM_CMAKE_DIR "${LLVM_PROJECT_DIR}/llvm/cmake/modules" CACHE PATH "")
@@ -156,7 +158,6 @@ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
156158
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_LLVM_ENABLE_RUNTIMES "${LLVM_ENABLE_RUNTIMES}" CACHE STRING "")
157159

158160
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_SYSTEM_NAME "Linux" CACHE STRING "")
159-
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_SYSROOT "${DEFAULT_SYSROOT}" CACHE STRING "")
160161
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_INSTALL_RPATH "${RUNTIMES_INSTALL_RPATH}" CACHE STRING "")
161162
set(RUNTIMES_${TOOLCHAIN_TARGET_TRIPLE}_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
162163

0 commit comments

Comments
 (0)