Skip to content

Commit a68ccba

Browse files
committed
[compiler-rt] Fix COMPILER_RT_OS_DIR for Android
Android has its own CMAKE_SYSTEM_NAME, but the OS is Linux (Android target triples look like aarch64-none-linux-android21). The driver will therefore search for compiler-rt libraries in the "linux" directory and not the "android" directory, so the default placement of Android compiler-rt libraries was incorrect. You could fix it by specifying COMPILER_RT_OS_DIR manually, but it also makes sense to fix the default, to save others from having to discover and fix the issue for themselves.
1 parent cc238a6 commit a68ccba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler-rt/cmake/base-config-ix.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ function(extend_install_path joined_path current_segment)
100100
endfunction()
101101

102102
if(NOT DEFINED COMPILER_RT_OS_DIR)
103-
string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR)
103+
if(ANDROID)
104+
# The CMAKE_SYSTEM_NAME for Android is Android, but the OS is Linux and the
105+
# driver will search for compiler-rt libraries in the "linux" directory.
106+
set(COMPILER_RT_OS_DIR linux)
107+
else()
108+
string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR)
109+
endif()
104110
endif()
105111
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
106112
set(COMPILER_RT_OUTPUT_LIBRARY_DIR

0 commit comments

Comments
 (0)