[llvm] llvm-shlib: Fix libLLVM-${MAJOR}.so symlink on MacOS (PR #85163)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 13 17:51:08 PDT 2024
https://github.com/tstellar created https://github.com/llvm/llvm-project/pull/85163
This is a partial revert of 10c48a772742b7afe665a815b7eba2047f17dc4b with a fix for the symlink target name on MacOS
See #84637
>From 480c6b52b0411640269f1ee20ab869a0266941b0 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 14 Mar 2024 00:42:37 +0000
Subject: [PATCH] llvm-shlib: Fix libLLVM-${MAJOR}.so symlink on MacOS
This is a partial revert of 10c48a772742b7afe665a815b7eba2047f17dc4b
with a fix for the symlink target name on MacOS
See #84637
---
llvm/cmake/modules/AddLLVM.cmake | 6 +++---
llvm/tools/llvm-shlib/CMakeLists.txt | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index f6fb56eb51e833..5610880da71079 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -2090,7 +2090,7 @@ function(add_lit_testsuites project directory)
endfunction()
function(llvm_install_library_symlink name dest type)
- cmake_parse_arguments(ARG "" "COMPONENT;SOVERSION" "" ${ARGN})
+ cmake_parse_arguments(ARG "FULL_DEST" "COMPONENT" "" ${ARGN})
foreach(path ${CMAKE_MODULE_PATH})
if(EXISTS ${path}/LLVMInstallSymlink.cmake)
set(INSTALL_SYMLINK ${path}/LLVMInstallSymlink.cmake)
@@ -2104,8 +2104,8 @@ function(llvm_install_library_symlink name dest type)
endif()
set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
- if (ARG_SOVERSION)
- set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}.${ARG_SOVERSION})
+ if (ARG_FULL_DEST)
+ set(full_dest ${dest})
else()
set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
endif()
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
index eba1672faee7fa..9adce0617ff736 100644
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -35,8 +35,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
endif()
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB OUTPUT_NAME LLVM ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
# Add symlink for backwards compatibility with old library name
- get_target_property(LLVM_DYLIB_SOVERSION LLVM SOVERSION)
- llvm_install_library_symlink(LLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} LLVM SHARED COMPONENT LLVM SOVERSION ${LLVM_DYLIB_SOVERSION})
+ llvm_install_library_symlink(LLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} $<TARGET_SONAME_FILE_NAME:LLVM> SHARED FULL_DEST COMPONENT LLVM)
list(REMOVE_DUPLICATES LIB_NAMES)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
More information about the llvm-commits
mailing list