|
316 | 316 | #region main package |
317 | 317 | Name: %{pkg_name_llvm} |
318 | 318 | Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} |
319 | | -Release: 7%{?dist} |
| 319 | +Release: 8%{?dist} |
320 | 320 | Summary: The Low Level Virtual Machine |
321 | 321 |
|
322 | 322 | License: Apache-2.0 WITH LLVM-exception OR NCSA |
@@ -1330,8 +1330,15 @@ popd |
1330 | 1330 | -DCLANG_INCLUDE_TESTS:BOOL=ON \\\ |
1331 | 1331 | -DCLANG_PLUGIN_SUPPORT:BOOL=ON \\\ |
1332 | 1332 | -DCLANG_REPOSITORY_STRING="%{?dist_vendor} %{version}-%{release}" \\\ |
1333 | | - -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra \\\ |
| 1333 | + -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra |
| 1334 | + |
| 1335 | +%if %{with compat_build} |
| 1336 | +%global cmake_config_args %{cmake_config_args} \\\ |
1334 | 1337 | -DCLANG_RESOURCE_DIR=../../../lib/clang/%{maj_ver} |
| 1338 | +%else |
| 1339 | +%global cmake_config_args %{cmake_config_args} \\\ |
| 1340 | + -DCLANG_RESOURCE_DIR=../lib/clang/%{maj_ver} |
| 1341 | +%endif |
1335 | 1342 | #endregion clang options |
1336 | 1343 |
|
1337 | 1344 | #region compiler-rt options |
@@ -1938,8 +1945,12 @@ rm -Rvf %{buildroot}%{install_datadir}/clang-doc |
1938 | 1945 | # TODO: What are the Fedora guidelines for packaging bash autocomplete files? |
1939 | 1946 | rm -vf %{buildroot}%{install_datadir}/clang/bash-autocomplete.sh |
1940 | 1947 |
|
1941 | | -# Create sub-directories in the clang resource directory that will be |
1942 | | -# populated by other packages |
| 1948 | +%if %{without compat_build} |
| 1949 | +# Move clang resource directory to default prefix. |
| 1950 | +mkdir -p %{buildroot}%{_prefix}/lib/clang |
| 1951 | +mv %{buildroot}%{install_prefix}/lib/clang/%{maj_ver} %{buildroot}%{_prefix}/lib/clang/%{maj_ver} |
| 1952 | +%endif |
| 1953 | +# Create any missing sub-directories in the clang resource directory. |
1943 | 1954 | mkdir -p %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/{bin,include,lib,share}/ |
1944 | 1955 |
|
1945 | 1956 | # Add versioned resource directory macro |
@@ -2025,7 +2036,7 @@ rmdir %{buildroot}%{install_prefix}/%{_lib}/python%{python3_version} |
2025 | 2036 |
|
2026 | 2037 | # python: fix binary libraries location |
2027 | 2038 | liblldb=$(basename $(readlink -e %{buildroot}%{install_libdir}/liblldb.so)) |
2028 | | -ln -vsf "../../../llvm%{maj_ver}/lib/${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so |
| 2039 | +ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so |
2029 | 2040 | %py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb |
2030 | 2041 | %endif |
2031 | 2042 | %endif |
@@ -2066,62 +2077,69 @@ popd |
2066 | 2077 | rm -f %{buildroot}%{install_libdir}/libLLVMBOLT*.a |
2067 | 2078 | #endregion BOLT installation |
2068 | 2079 |
|
2069 | | -# Create symlinks from the system install prefix to the llvm install prefix. |
| 2080 | +# Move files from src to dest and replace the old files in src with relative |
| 2081 | +# symlinks. |
| 2082 | +move_and_replace_with_symlinks() { |
| 2083 | + local src="$1" |
| 2084 | + local dest="$2" |
| 2085 | + mkdir -p "$dest" |
| 2086 | + |
| 2087 | + # Change to source directory to simplify relative paths |
| 2088 | + (cd "$src" && \ |
| 2089 | + find * -type d -exec mkdir -p "$dest/{}" \; && \ |
| 2090 | + find * \( -type f -o -type l \) -exec mv "$src/{}" "$dest/{}" \; \ |
| 2091 | + -exec ln -s --relative "$dest/{}" "$src/{}" \;) |
| 2092 | +} |
| 2093 | + |
| 2094 | +%if %{without compat_build} |
| 2095 | +# Move files from the llvm prefix to the system prefix and replace them with |
| 2096 | +# symlinks. We do it this way around because symlinks between multilib packages |
| 2097 | +# would conflict otherwise. |
| 2098 | +move_and_replace_with_symlinks %{buildroot}%{install_bindir} %{buildroot}%{_bindir} |
| 2099 | +move_and_replace_with_symlinks %{buildroot}%{install_libdir} %{buildroot}%{_libdir} |
| 2100 | +move_and_replace_with_symlinks %{buildroot}%{install_libexecdir} %{buildroot}%{_libexecdir} |
| 2101 | +move_and_replace_with_symlinks %{buildroot}%{install_includedir} %{buildroot}%{_includedir} |
| 2102 | +move_and_replace_with_symlinks %{buildroot}%{install_datadir} %{buildroot}%{_datadir} |
| 2103 | +%endif |
| 2104 | + |
| 2105 | +# Create versioned symlinks for binaries. |
2070 | 2106 | # Do this at the end so it includes any files added by preceding steps. |
2071 | 2107 | mkdir -p %{buildroot}%{_bindir} |
2072 | 2108 | for f in %{buildroot}%{install_bindir}/*; do |
2073 | 2109 | filename=`basename $f` |
2074 | | - if [[ "$filename" == "clang-%{maj_ver}" ]]; then |
| 2110 | + if [[ "$filename" =~ ^(lit|ld|clang-%{maj_ver})$ ]]; then |
2075 | 2111 | continue |
2076 | 2112 | fi |
2077 | | - # Add symlink for binaries with version suffix. |
2078 | | - ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename-%{maj_ver} |
2079 | | - # For non-compat builds, also add a symlink without version suffix. |
2080 | | - %if %{without compat_build} |
2081 | | - ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename |
| 2113 | + %if %{with compat_build} |
| 2114 | + ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename-%{maj_ver} |
| 2115 | + %else |
| 2116 | + # clang-NN is already created by the build system. |
| 2117 | + if [[ "$filename" == "clang" ]]; then |
| 2118 | + continue |
| 2119 | + fi |
| 2120 | + ln -s $filename %{buildroot}/%{_bindir}/$filename-%{maj_ver} |
2082 | 2121 | %endif |
2083 | 2122 | done |
2084 | 2123 |
|
2085 | | -# Move man pages to system install prefix. |
2086 | 2124 | mkdir -p %{buildroot}%{_mandir}/man1 |
2087 | 2125 | for f in %{buildroot}%{install_mandir}/man1/*; do |
2088 | 2126 | filename=`basename $f` |
2089 | 2127 | filename=${filename%.1} |
2090 | | - mv $f %{buildroot}%{_mandir}/man1/$filename-%{maj_ver}.1 |
2091 | | - %if %{without compat_build} |
2092 | | - ln -s $filename-%{maj_ver}.1 %{buildroot}%{_mandir}/man1/$filename.1 |
| 2128 | + %if %{with compat_build} |
| 2129 | + # Move man pages to system install prefix. |
| 2130 | + mv $f %{buildroot}%{_mandir}/man1/$filename-%{maj_ver}.1 |
| 2131 | + %else |
| 2132 | + # Create suffixed symlink. |
| 2133 | + ln -s $filename.1 %{buildroot}%{_mandir}/man1/$filename-%{maj_ver}.1 |
2093 | 2134 | %endif |
2094 | 2135 | done |
2095 | | -rmdir %{buildroot}%{install_mandir}/man1 |
2096 | | -rmdir %{buildroot}%{install_mandir} |
| 2136 | +rm -rf %{buildroot}%{install_mandir} |
2097 | 2137 |
|
| 2138 | +# As an exception, always keep llvm-config in the versioned prefix. |
| 2139 | +# The llvm-config in the default prefix will be managed by alternatives. |
2098 | 2140 | %if %{without compat_build} |
2099 | | -# We don't create directory symlinks, because RPM does not support |
2100 | | -# switching between a directory and a symlink, causing upgrade/downgrade issues. |
2101 | | -# Instead, recursively copy the directories while creating symlinks. |
2102 | | -copy_with_relative_symlinks() { |
2103 | | - local src="$1" |
2104 | | - local dest="$2" |
2105 | | - mkdir -p "$dest" |
2106 | | - |
2107 | | - # Change to source directory to simplify relative paths |
2108 | | - (cd "$src" && \ |
2109 | | - find * -type d -exec mkdir -p "$dest/{}" \; && \ |
2110 | | - find * \( -type f -o -type l \) -exec ln -s --relative "$src/{}" "$dest/{}" \;) |
2111 | | -} |
2112 | | - |
2113 | | -# Add symlinks for libraries. |
2114 | | -copy_with_relative_symlinks %{buildroot}%{install_libdir} %{buildroot}%{_libdir} |
2115 | | -copy_with_relative_symlinks %{buildroot}%{install_libexecdir} %{buildroot}%{_libexecdir} |
2116 | | -copy_with_relative_symlinks %{buildroot}%{install_includedir} %{buildroot}%{_includedir} |
2117 | | -copy_with_relative_symlinks %{buildroot}%{install_datadir} %{buildroot}%{_datadir} |
2118 | | - |
2119 | | -%if %{maj_ver} >= 21 && %{with offload} |
2120 | | -# Remove offload libaries since we only want to ship these in the configured |
2121 | | -# install prefix. |
2122 | | -rm -Rf %{buildroot}%{_libdir}/amdgcn-amd-amdhsa |
2123 | | -rm -Rf %{buildroot}%{_libdir}/nvptx64-nvidia-cuda |
2124 | | -%endif |
| 2141 | +rm %{buildroot}%{install_bindir}/llvm-config |
| 2142 | +mv %{buildroot}%{_bindir}/llvm-config %{buildroot}%{install_bindir}/llvm-config |
2125 | 2143 | %endif |
2126 | 2144 |
|
2127 | 2145 | # ghost presence for llvm-config, managed by alternatives. |
@@ -3164,10 +3182,12 @@ fi |
3164 | 3182 | libomptarget-nvptx*.bc |
3165 | 3183 | }} |
3166 | 3184 | %else |
3167 | | -%{install_libdir}/amdgcn-amd-amdhsa/libompdevice.a |
3168 | | -%{install_libdir}/amdgcn-amd-amdhsa/libomptarget-amdgpu.bc |
3169 | | -%{install_libdir}/nvptx64-nvidia-cuda/libompdevice.a |
3170 | | -%{install_libdir}/nvptx64-nvidia-cuda/libomptarget-nvptx.bc |
| 3185 | +%{expand_libs %{expand: |
| 3186 | + amdgcn-amd-amdhsa/libompdevice.a |
| 3187 | + amdgcn-amd-amdhsa/libomptarget-amdgpu.bc |
| 3188 | + nvptx64-nvidia-cuda/libompdevice.a |
| 3189 | + nvptx64-nvidia-cuda/libomptarget-nvptx.bc |
| 3190 | +}} |
3171 | 3191 | %endif |
3172 | 3192 |
|
3173 | 3193 | %expand_includes offload |
@@ -3403,6 +3423,10 @@ fi |
3403 | 3423 |
|
3404 | 3424 | #region changelog |
3405 | 3425 | %changelog |
| 3426 | +* Tue Jun 10 2025 Nikita Popov <[email protected]> - 20.1.6-8 |
| 3427 | +- Invert symlink direction |
| 3428 | +- Fix i686 multilib installation (rhbz#2365079) |
| 3429 | + |
3406 | 3430 | * Thu Jun 05 2025 Timm Bäder <[email protected]> - 20.1.6-7 |
3407 | 3431 | - Backport patch to fix rhbz#2363895 |
3408 | 3432 |
|
|
0 commit comments