llvm18/llvm-normally-versioned-libllvm.patch
Aaron Puchert d908d9fcff - Update to version 18.1.8.
* Fix a regression from the 18.1.6 release, which could result in
    compiler crashes in the PPCMergeStringPool pass when compiling
    for PowerPC targets.
  * Fixes clang-format regressions (since 18.1.1) on breaking
    before a stream insertion operator (<<) when both operands are
    string literals.
  * Fixes a clang-format regression (since 17.0.6) on formatting
    goto labels in macro definitions.
- Rebase llvm-do-not-install-static-libraries.patch.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm18?expand=0&rev=17
2024-06-30 18:04:58 +00:00

67 lines
3.0 KiB
Diff

Before llvm4, both major and minor version updates of llvm were regularly
breaking API. Because of that, the libLLVM library was named in following
format: libLLVM-${major}-${minor}.so
(https://bugs.llvm.org/show_bug.cgi?id=25059)
(https://reviews.llvm.org/D13841)
The package containing this library was called libLLVM${major}_${minor} which
follows our guidelines.
Since llvm4, llvm decided to follow semantic versioning and only break API if
the major version was increased. In addition they do not intend to ever have
minor version other than 0.
(http://blog.llvm.org/2016/12/llvms-new-versioning-scheme.html)
The package was renamed to libLLVM${major}, which no longer follows the naming
guidelines, but since the package contained multiple libraries, it was not
detected.
Since bnc#1049703 the libLLVM${major} package contains only the
libLLVM-${major}-${minor}.so library and no others. This triggers the
shlib-policy-name-error check in our packaging system.
Because the reasons for using the libLLVM-${major}-${minor}.so format are no
longer valid, lets revert back to libLLVM.so.${major}.${minor}.${version}
format. That way the package name matches our guidelines.
With llvm18, the minor version is now always 1 for releases, and upstream
decided to rename the library to libLLVM.so.${major}.${minor}, but keep the
old name as symbolic link for backwards compatibility. That is of course
not relevant for us.
Index: llvm-8.0.0rc3.src/tools/llvm-config/llvm-config.cpp
===================================================================
--- llvm-8.0.0rc3.src.orig/tools/llvm-config/llvm-config.cpp
+++ llvm-8.0.0rc3.src/tools/llvm-config/llvm-config.cpp
@@ -380,7 +380,6 @@ int main(int argc, char **argv) {
} else {
// default to the unix values:
SharedExt = "so";
- SharedVersionedExt = LLVM_DYLIB_VERSION ".so";
StaticExt = "a";
StaticDir = SharedDir = ActiveLibDir;
StaticPrefix = SharedPrefix = "lib";
@@ -393,7 +392,7 @@ int main(int argc, char **argv) {
bool DyLibExists = false;
const std::string DyLibName =
- (SharedPrefix + "LLVM-" + SharedVersionedExt).str();
+ (SharedPrefix + "LLVM." + SharedExt).str();
// If LLVM_LINK_DYLIB is ON, the single shared library will be returned
// for "--libs", etc, if they exist. This behaviour can be overridden with
Index: llvm-18.1.2.src/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm-18.1.2.src.orig/tools/llvm-shlib/CMakeLists.txt
+++ llvm-18.1.2.src/tools/llvm-shlib/CMakeLists.txt
@@ -37,8 +37,6 @@ if (WIN32)
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
else()
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
- llvm_install_library_symlink(LLVM-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} $<TARGET_FILE_NAME:LLVM> SHARED FULL_DEST COMPONENT LLVM)
endif()
list(REMOVE_DUPLICATES LIB_NAMES)