Skip to content

[AIX] Opt in to per-target runtime dir #139620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion compiler-rt/cmake/Modules/CompilerRTUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,12 @@ macro(construct_compiler_rt_default_triple)
message(STATUS "cmake c compiler target: ${CMAKE_C_COMPILER_TARGET}")
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${CMAKE_C_COMPILER_TARGET})
else()
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${LLVM_TARGET_TRIPLE} CACHE STRING
set(target_triple ${LLVM_TARGET_TRIPLE})
# AIX triples can have OS version numbers we don't want for the compiler-rt target.
if (target_triple MATCHES "aix")
string(REGEX REPLACE "[0-9.]+$" "" target_triple "${target_triple}")
endif()
set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${target_triple} CACHE STRING
"Default triple for which compiler-rt runtimes will be built.")
endif()

Expand Down
2 changes: 1 addition & 1 deletion llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ endif()
set(LLVM_TARGET_TRIPLE_ENV CACHE STRING "The name of environment variable to override default target. Disabled by blank.")
mark_as_advanced(LLVM_TARGET_TRIPLE_ENV)

if(CMAKE_SYSTEM_NAME MATCHES "BSD|Linux|OS390")
if(CMAKE_SYSTEM_NAME MATCHES "BSD|Linux|OS390|AIX")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON)
else()
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF)
Expand Down
7 changes: 1 addition & 6 deletions llvm/runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ endfunction()
macro(set_enable_per_target_runtime_dir)
# May have been set by llvm/CMakeLists.txt.
if (NOT DEFINED LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
# AIX should fold 32-bit & 64-bit arch libraries into a single archive.
if (LLVM_TARGET_TRIPLE MATCHES "aix")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF)
else()
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON)
endif()
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON)
endif()
endmacro()

Expand Down