From 0622cb343e20d05c912d3b2d9ac557f6fb4f65bc Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 18 Jul 2025 22:50:02 +0200 Subject: [PATCH] AIX: Drop unnecessary -l from CMAKE_DL_LIBS The `-lld` linker flag was added from the previous command-line script that have all values in `CMAKE_DL_LIBS` prepended with `-l`. On AIX, the `dlopen()` is otherwise in C library (default). But it seems that also `libld` library was once needed on some versions to have dynamic loading working. Sync `CMAKE_DL_LIBS` value style with all other current usages. --- Help/variable/CMAKE_DL_LIBS.rst | 2 +- Modules/Platform/AIX.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Help/variable/CMAKE_DL_LIBS.rst b/Help/variable/CMAKE_DL_LIBS.rst index 2574192eb0..11fc7427cb 100644 --- a/Help/variable/CMAKE_DL_LIBS.rst +++ b/Help/variable/CMAKE_DL_LIBS.rst @@ -10,7 +10,7 @@ Few examples of the values this variable is set to: On most Unix-like systems. ``-lld`` - On AIX. + On AIX, prior to CMake 4.2. ``dld`` On HP-UX. diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index dcc9837259..a8561a09ce 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -3,7 +3,7 @@ set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so set(CMAKE_SHARED_LIBRARY_ARCHIVE_SUFFIX ".a") # .a set(CMAKE_AIX_IMPORT_FILE_PREFIX "") set(CMAKE_AIX_IMPORT_FILE_SUFFIX ".imp") -set(CMAKE_DL_LIBS "-lld") +set(CMAKE_DL_LIBS "ld") # RPATH support on AIX is called libpath. By default the runtime # libpath is paths specified by -L followed by /usr/lib and /lib. In