From 341435996f2ebbb92a8529bd9e357ae4e914bb1bc9d4dff8b763b498ba8539ca Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sun, 14 Aug 2022 15:21:22 +0000 Subject: [PATCH 1/9] Accepting request 995044 from home:aaronpuchert:branches:devel:tools:compiler - Use black RPM macro magic to deduplicate binary lists. This should have no effect on the generated RPM but shaves ~400 lines off the specfile and hopefully makes future maintenance easier. OBS-URL: https://build.opensuse.org/request/show/995044 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=28 --- llvm14.changes | 7 + llvm14.spec | 912 ++++++++++++++----------------------------------- 2 files changed, 269 insertions(+), 650 deletions(-) diff --git a/llvm14.changes b/llvm14.changes index 4e501ba..fba13af 100644 --- a/llvm14.changes +++ b/llvm14.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Aug 13 21:53:05 UTC 2022 - Aaron Puchert + +- Use black RPM macro magic to deduplicate binary lists. This + should have no effect on the generated RPM but shaves ~400 lines + off the specfile and hopefully makes future maintenance easier. + ------------------------------------------------------------------- Wed Aug 10 20:21:59 UTC 2022 - Aaron Puchert diff --git a/llvm14.spec b/llvm14.spec index 022aac3..37e2fe4 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -111,6 +111,186 @@ test "$max_%{1}_jobs" -le 0 && max_%{1}_jobs=1 && echo "Warning: Not %{1}ing in parallel at all because of memory limits" \ fi +# Recursion utils. +%global _stop0 1 +%define _lapply_rec(p:f:) %{expand:%{%{-p*} %{-f*}} %%{?!_stop%#:%%{_lapply_rec -p %{-p*} -f %*}}} + +# Usage: +# %%global pattern foo_%%1 +# %%{lapply -p pattern a b c} +# produces foo_a foo_b foo_c. +%define lapply(p:) %{_lapply_rec -p %{-p*} -f %{shrink:%*}} + +# Due to RPMs recursion limit, we have to split the lists into portions of 19. +%global llvm_ua_anchor llvm-ar +%global llvm_binfiles_1 \ + bugpoint \ + dsymutil \ + llc \ + lli \ + llvm-addr2line \ + llvm-as \ + llvm-bcanalyzer \ + llvm-bitcode-strip \ + llvm-c-test \ + llvm-cat \ + llvm-cfi-verify \ + llvm-cov \ + llvm-cxxdump \ + llvm-cxxfilt \ + llvm-cxxmap \ + llvm-debuginfod-find \ + llvm-cvtres \ + llvm-diff +%global llvm_binfiles_2 \ + llvm-dis \ + llvm-dlltool \ + llvm-dwarfdump \ + llvm-dwp \ + llvm-extract \ + llvm-gsymutil \ + llvm-ifs \ + llvm-install-name-tool \ + llvm-jitlink \ + llvm-lib \ + llvm-libtool-darwin \ + llvm-link \ + llvm-lipo \ + llvm-lto \ + llvm-lto2 \ + llvm-mc \ + llvm-mca \ + llvm-ml \ + llvm-mt +%global llvm_binfiles_3 \ + llvm-modextract \ + llvm-nm \ + llvm-objcopy \ + llvm-objdump \ + llvm-opt-report \ + llvm-otool \ + llvm-pdbutil \ + llvm-profdata \ + llvm-profgen \ + llvm-ranlib \ + llvm-rc \ + llvm-readelf \ + llvm-readobj \ + llvm-reduce \ + llvm-rtdyld \ + llvm-sim \ + llvm-size \ + llvm-split \ + llvm-stress +%global llvm_binfiles_4 \ + llvm-strings \ + llvm-strip \ + llvm-symbolizer \ + llvm-tapi-diff \ + llvm-tblgen \ + llvm-tli-checker \ + llvm-undname \ + llvm-windres \ + llvm-xray \ + opt \ + sancov \ + sanstats \ + split-file \ + verify-uselistorder +%global clang_ua_anchor clang +%global clang_binfiles \ + c-index-test \ + clang++ \ + clang-check \ + clang-cl \ + clang-extdef-mapping \ + clang-format \ + clang-linker-wrapper \ + clang-nvlink-wrapper \ + clang-offload-bundler \ + clang-offload-wrapper \ + clang-refactor \ + clang-rename \ + clang-repl \ + clang-scan-deps \ + diagtool +%global clang_tools_extra_binfiles \ + clang-apply-replacements \ + clang-change-namespace \ + clang-include-fixer \ + clang-move \ + clang-query \ + clang-reorder-fields \ + clang-tidy \ + clangd \ + find-all-symbols \ + modularize \ + pp-trace +%if %{with lld} +%global lld_ua_anchor lld +%global lld_binfiles \ + ld.lld \ + lld-link \ + ld64.lld \ + wasm-ld +%endif +%if %{with lldb} +%global lldb_ua_anchor lldb +%global lldb_binfiles \ + lldb-argdumper \ + lldb-instr \ + lldb-server \ + lldb-vscode +%endif +%global binfiles \ + %{llvm_ua_anchor} %{llvm_binfiles_1} %{llvm_binfiles_2} %{llvm_binfiles_3} %{llvm_binfiles_4} \ + %{clang_ua_anchor} %{clang_binfiles} %{clang_tools_extra_binfiles} \ + %{?lld_ua_anchor} %{?lld_binfiles} %{?lldb_ua_anchor} %{?lldb_binfiles} + +%global llvm_manfiles_1 \ + bugpoint \ + dsymutil \ + llc \ + lli \ + llvm-addr2line \ + llvm-ar \ + llvm-as \ + llvm-bcanalyzer \ + llvm-cov \ + llvm-cxxfilt \ + llvm-cxxmap \ + llvm-diff \ + llvm-dis \ + llvm-dwarfdump \ + llvm-extract \ + llvm-install-name-tool \ + llvm-lib \ + llvm-libtool-darwin \ + llvm-link +%global llvm_manfiles_2 \ + llvm-lipo \ + llvm-mca \ + llvm-nm \ + llvm-objcopy \ + llvm-objdump \ + llvm-otool \ + llvm-pdbutil \ + llvm-profdata \ + llvm-profgen \ + llvm-ranlib \ + llvm-readelf \ + llvm-readobj \ + llvm-size \ + llvm-stress \ + llvm-strings \ + llvm-strip \ + llvm-symbolizer \ + llvm-tblgen \ + llvm-tli-checker \ + opt +%global clang_manfiles clang diagtool +%global manfiles %{llvm_manfiles_1} %{llvm_manfiles_2} %{clang_manfiles} + %define _dwz_low_mem_die_limit 40000000 %define _dwz_max_die_limit 200000000 @@ -1006,37 +1186,6 @@ rm %{buildroot}%{_libdir}/libarcher_static.a # Prepare for update-alternatives usage mkdir -p %{buildroot}%{_sysconfdir}/alternatives -binfiles=( bugpoint dsymutil llc lli \ - llvm-addr2line llvm-ar llvm-as llvm-bcanalyzer llvm-bitcode-strip llvm-c-test llvm-cat llvm-cfi-verify - llvm-cov llvm-cxxdump llvm-cxxfilt llvm-cxxmap llvm-debuginfod-find llvm-cvtres llvm-diff llvm-dis \ - llvm-dlltool llvm-dwarfdump llvm-dwp llvm-extract llvm-gsymutil llvm-ifs \ - llvm-install-name-tool llvm-jitlink llvm-lib llvm-libtool-darwin \ - llvm-link llvm-lipo llvm-lto llvm-lto2 llvm-mc llvm-mca \ - llvm-ml llvm-mt llvm-modextract llvm-nm llvm-objcopy llvm-objdump llvm-opt-report llvm-otool \ - llvm-pdbutil llvm-profdata llvm-profgen llvm-ranlib llvm-rc llvm-readelf llvm-readobj llvm-reduce \ - llvm-rtdyld llvm-sim llvm-size llvm-split llvm-stress llvm-strings llvm-strip \ - llvm-symbolizer llvm-tapi-diff llvm-tblgen llvm-tli-checker llvm-undname llvm-windres \ - llvm-xray opt sancov sanstats split-file verify-uselistorder \ - c-index-test clang clangd clang++ clang-apply-replacements \ - clang-change-namespace clang-check clang-cl clang-extdef-mapping clang-format \ - clang-include-fixer clang-linker-wrapper clang-move clang-nvlink-wrapper clang-offload-bundler \ - clang-offload-wrapper clang-query clang-refactor clang-repl clang-scan-deps clang-rename \ - clang-reorder-fields clang-tidy diagtool find-all-symbols modularize pp-trace \ -%if %{with lldb} - lldb lldb-argdumper lldb-instr lldb-server lldb-vscode \ -%endif -%if %{with lld} - ld.lld lld lld-link ld64.lld wasm-ld \ -%endif - ) -manfiles=( bugpoint dsymutil llc lli \ - llvm-addr2line llvm-ar llvm-as llvm-bcanalyzer llvm-cov llvm-cxxfilt llvm-cxxmap llvm-diff \ - llvm-dis llvm-dwarfdump llvm-extract llvm-install-name-tool \ - llvm-lib llvm-libtool-darwin llvm-link llvm-lipo llvm-mca \ - llvm-nm llvm-objcopy llvm-objdump llvm-otool llvm-pdbutil \ - llvm-profdata llvm-profgen llvm-ranlib llvm-readelf llvm-readobj \ - llvm-size llvm-stress llvm-strings llvm-strip llvm-symbolizer llvm-tblgen llvm-tli-checker opt \ - clang diagtool ) # Fix the clang -> clang-X.Y symlink to work with update-alternatives mv %{buildroot}%{_bindir}/clang-%{_sonum} %{buildroot}%{_bindir}/clang @@ -1049,23 +1198,23 @@ ln -s %{_bindir}/clang++-%{_relver} %{buildroot}%{_bindir}/clang++-%{_sonum} ln -s %{_bindir}/clang++-%{_relver} %{buildroot}%{_bindir}/clang++-%{_minor} # Rewrite symlinks to point to new location -for p in "${binfiles[@]}" ; do +for p in %{shrink:%binfiles} ; do if [ -h "%{buildroot}%{_bindir}/$p" ] ; then ln -f -s %{_bindir}/$(readlink %{buildroot}%{_bindir}/$p)-%{_relver} %{buildroot}%{_bindir}/$p fi done -for p in "${binfiles[@]}" ; do +for p in %{shrink:%binfiles} ; do mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{_relver} ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p done -for p in "${manfiles[@]}" ; do +for p in %{shrink:%manfiles} ; do mv %{buildroot}%{_mandir}/man1/$p.1 %{buildroot}%{_mandir}/man1/$p-%{_relver}.1 ln -s -f %{_sysconfdir}/alternatives/$p.1%{ext_man} %{buildroot}%{_mandir}/man1/$p.1%{ext_man} done # Also rewrite the CMake files referring to the binaries. sed -i "$( - for p in "${binfiles[@]}"; do + for p in %{shrink:%binfiles}; do echo "s|\"\${_IMPORT_PREFIX}/bin/$p\"|\"\${_IMPORT_PREFIX}/bin/$p-%{_relver}\"|g" done )" %{buildroot}%{_libdir}/cmake/{llvm/LLVMExports,clang/ClangTargets}-relwithdebinfo.cmake @@ -1245,175 +1394,46 @@ rm -rf ./stage1 ./build %postun polly-devel -p /sbin/ldconfig %endif +%global ua_install() %{_sbindir}/update-alternatives \\\ + --install %{_bindir}/%1 %1 %{_bindir}/%1-%{_relver} %{_uaver} +%global ua_bin_slave() \\\ + --slave %{_bindir}/%1 %1 %{_bindir}/%1-%{_relver} +%global ua_man_slave() \\\ + --slave %{_mandir}/man1/%1.1%{ext_man} %1.1%{ext_man} %{_mandir}/man1/%1-%{_relver}.1%{ext_man} +%global ua_remove() \ +if [ ! -f %{_bindir}/%1-%{_relver} ] ; then \ + %{_sbindir}/update-alternatives --remove %1 %{_bindir}/%1-%{_relver} \ +fi + %post -%{_sbindir}/update-alternatives \ - --install %{_bindir}/llvm-ar llvm-ar %{_bindir}/llvm-ar-%{_relver} %{_uaver} \ - --slave %{_bindir}/bugpoint bugpoint %{_bindir}/bugpoint-%{_relver} \ - --slave %{_bindir}/dsymutil dsymutil %{_bindir}/dsymutil-%{_relver} \ - --slave %{_bindir}/llc llc %{_bindir}/llc-%{_relver} \ - --slave %{_bindir}/lli lli %{_bindir}/lli-%{_relver} \ - --slave %{_bindir}/llvm-addr2line llvm-addr2line %{_bindir}/llvm-addr2line-%{_relver} \ - --slave %{_bindir}/llvm-as llvm-as %{_bindir}/llvm-as-%{_relver} \ - --slave %{_bindir}/llvm-bcanalyzer llvm-bcanalyzer %{_bindir}/llvm-bcanalyzer-%{_relver} \ - --slave %{_bindir}/llvm-bitcode-strip llvm-bitcode-strip %{_bindir}/llvm-bitcode-strip-%{_relver} \ - --slave %{_bindir}/llvm-c-test llvm-c-test %{_bindir}/llvm-c-test-%{_relver} \ - --slave %{_bindir}/llvm-cat llvm-cat %{_bindir}/llvm-cat-%{_relver} \ - --slave %{_bindir}/llvm-cfi-verify llvm-cfi-verify %{_bindir}/llvm-cfi-verify-%{_relver} \ - --slave %{_bindir}/llvm-cov llvm-cov %{_bindir}/llvm-cov-%{_relver} \ - --slave %{_bindir}/llvm-cvtres llvm-cvtres %{_bindir}/llvm-cvtres-%{_relver} \ - --slave %{_bindir}/llvm-cxxdump llvm-cxxdump %{_bindir}/llvm-cxxdump-%{_relver} \ - --slave %{_bindir}/llvm-cxxfilt llvm-cxxfilt %{_bindir}/llvm-cxxfilt-%{_relver} \ - --slave %{_bindir}/llvm-cxxmap llvm-cxxmap %{_bindir}/llvm-cxxmap-%{_relver} \ - --slave %{_bindir}/llvm-debuginfod-find llvm-debuginfod-find %{_bindir}/llvm-debuginfod-find-%{_relver} \ - --slave %{_bindir}/llvm-diff llvm-diff %{_bindir}/llvm-diff-%{_relver} \ - --slave %{_bindir}/llvm-dis llvm-dis %{_bindir}/llvm-dis-%{_relver} \ - --slave %{_bindir}/llvm-dlltool llvm-dlltool %{_bindir}/llvm-dlltool-%{_relver} \ - --slave %{_bindir}/llvm-dwarfdump llvm-dwarfdump %{_bindir}/llvm-dwarfdump-%{_relver} \ - --slave %{_bindir}/llvm-dwp llvm-dwp %{_bindir}/llvm-dwp-%{_relver} \ - --slave %{_bindir}/llvm-extract llvm-extract %{_bindir}/llvm-extract-%{_relver} \ - --slave %{_bindir}/llvm-gsymutil llvm-gsymutil %{_bindir}/llvm-gsymutil-%{_relver} \ - --slave %{_bindir}/llvm-ifs llvm-ifs %{_bindir}/llvm-ifs-%{_relver} \ - --slave %{_bindir}/llvm-install-name-tool llvm-install-name-tool %{_bindir}/llvm-install-name-tool-%{_relver} \ - --slave %{_bindir}/llvm-jitlink llvm-jitlink %{_bindir}/llvm-jitlink-%{_relver} \ - --slave %{_bindir}/llvm-lib llvm-lib %{_bindir}/llvm-lib-%{_relver} \ - --slave %{_bindir}/llvm-libtool-darwin llvm-libtool-darwin %{_bindir}/llvm-libtool-darwin-%{_relver} \ - --slave %{_bindir}/llvm-link llvm-link %{_bindir}/llvm-link-%{_relver} \ - --slave %{_bindir}/llvm-lipo llvm-lipo %{_bindir}/llvm-lipo-%{_relver} \ - --slave %{_bindir}/llvm-lto llvm-lto %{_bindir}/llvm-lto-%{_relver} \ - --slave %{_bindir}/llvm-lto2 llvm-lto2 %{_bindir}/llvm-lto2-%{_relver} \ - --slave %{_bindir}/llvm-mc llvm-mc %{_bindir}/llvm-mc-%{_relver} \ - --slave %{_bindir}/llvm-mca llvm-mca %{_bindir}/llvm-mca-%{_relver} \ - --slave %{_bindir}/llvm-ml llvm-ml %{_bindir}/llvm-ml-%{_relver} \ - --slave %{_bindir}/llvm-mt llvm-mt %{_bindir}/llvm-mt-%{_relver} \ - --slave %{_bindir}/llvm-modextract llvm-modextract %{_bindir}/llvm-modextract-%{_relver} \ - --slave %{_bindir}/llvm-nm llvm-nm %{_bindir}/llvm-nm-%{_relver} \ - --slave %{_bindir}/llvm-objcopy llvm-objcopy %{_bindir}/llvm-objcopy-%{_relver} \ - --slave %{_bindir}/llvm-objdump llvm-objdump %{_bindir}/llvm-objdump-%{_relver} \ - --slave %{_bindir}/llvm-opt-report llvm-opt-report %{_bindir}/llvm-opt-report-%{_relver} \ - --slave %{_bindir}/llvm-otool llvm-otool %{_bindir}/llvm-otool-%{_relver} \ - --slave %{_bindir}/llvm-pdbutil llvm-pdbutil %{_bindir}/llvm-pdbutil-%{_relver} \ - --slave %{_bindir}/llvm-profdata llvm-profdata %{_bindir}/llvm-profdata-%{_relver} \ - --slave %{_bindir}/llvm-profgen llvm-profgen %{_bindir}/llvm-profgen-%{_relver} \ - --slave %{_bindir}/llvm-ranlib llvm-ranlib %{_bindir}/llvm-ranlib-%{_relver} \ - --slave %{_bindir}/llvm-rc llvm-rc %{_bindir}/llvm-rc-%{_relver} \ - --slave %{_bindir}/llvm-readelf llvm-readelf %{_bindir}/llvm-readelf-%{_relver} \ - --slave %{_bindir}/llvm-readobj llvm-readobj %{_bindir}/llvm-readobj-%{_relver} \ - --slave %{_bindir}/llvm-reduce llvm-reduce %{_bindir}/llvm-reduce-%{_relver} \ - --slave %{_bindir}/llvm-rtdyld llvm-rtdyld %{_bindir}/llvm-rtdyld-%{_relver} \ - --slave %{_bindir}/llvm-sim llvm-sim %{_bindir}/llvm-sim-%{_relver} \ - --slave %{_bindir}/llvm-size llvm-size %{_bindir}/llvm-size-%{_relver} \ - --slave %{_bindir}/llvm-split llvm-split %{_bindir}/llvm-split-%{_relver} \ - --slave %{_bindir}/llvm-stress llvm-stress %{_bindir}/llvm-stress-%{_relver} \ - --slave %{_bindir}/llvm-strings llvm-strings %{_bindir}/llvm-strings-%{_relver} \ - --slave %{_bindir}/llvm-strip llvm-strip %{_bindir}/llvm-strip-%{_relver} \ - --slave %{_bindir}/llvm-symbolizer llvm-symbolizer %{_bindir}/llvm-symbolizer-%{_relver} \ - --slave %{_bindir}/llvm-tapi-diff llvm-tapi-diff %{_bindir}/llvm-tapi-diff-%{_relver} \ - --slave %{_bindir}/llvm-tblgen llvm-tblgen %{_bindir}/llvm-tblgen-%{_relver} \ - --slave %{_bindir}/llvm-tli-checker llvm-tli-checker %{_bindir}/llvm-tli-checker-%{_relver} \ - --slave %{_bindir}/llvm-undname llvm-undname %{_bindir}/llvm-undname-%{_relver} \ - --slave %{_bindir}/llvm-windres llvm-windres %{_bindir}/llvm-windres-%{_relver} \ - --slave %{_bindir}/llvm-xray llvm-xray %{_bindir}/llvm-xray-%{_relver} \ - --slave %{_bindir}/opt opt %{_bindir}/opt-%{_relver} \ - --slave %{_bindir}/sancov sancov %{_bindir}/sancov-%{_relver} \ - --slave %{_bindir}/sanstats sanstats %{_bindir}/sanstats-%{_relver} \ - --slave %{_bindir}/split-file split-file %{_bindir}/split-file-%{_relver} \ - --slave %{_bindir}/verify-uselistorder verify-uselistorder %{_bindir}/verify-uselistorder-%{_relver} \ - --slave %{_mandir}/man1/bugpoint.1%{ext_man} bugpoint.1%{ext_man} %{_mandir}/man1/bugpoint-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/dsymutil.1%{ext_man} dsymutil.1%{ext_man} %{_mandir}/man1/dsymutil-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llc.1%{ext_man} llc.1%{ext_man} %{_mandir}/man1/llc-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/lli.1%{ext_man} lli.1%{ext_man} %{_mandir}/man1/lli-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-addr2line.1%{ext_man} llvm-addr2line.1%{ext_man} %{_mandir}/man1/llvm-addr2line-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-ar.1%{ext_man} llvm-ar.1%{ext_man} %{_mandir}/man1/llvm-ar-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-as.1%{ext_man} llvm-as.1%{ext_man} %{_mandir}/man1/llvm-as-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-bcanalyzer.1%{ext_man} llvm-bcanalyzer.1%{ext_man} %{_mandir}/man1/llvm-bcanalyzer-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-cov.1%{ext_man} llvm-cov.1%{ext_man} %{_mandir}/man1/llvm-cov-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-cxxfilt.1%{ext_man} llvm-cxxfilt.1%{ext_man} %{_mandir}/man1/llvm-cxxfilt-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-cxxmap.1%{ext_man} llvm-cxxmap.1%{ext_man} %{_mandir}/man1/llvm-cxxmap-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-diff.1%{ext_man} llvm-diff.1%{ext_man} %{_mandir}/man1/llvm-diff-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-dis.1%{ext_man} llvm-dis.1%{ext_man} %{_mandir}/man1/llvm-dis-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-dwarfdump.1%{ext_man} llvm-dwarfdump.1%{ext_man} %{_mandir}/man1/llvm-dwarfdump-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-extract.1%{ext_man} llvm-extract.1%{ext_man} %{_mandir}/man1/llvm-extract-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-install-name-tool.1%{ext_man} llvm-install-name-tool.1%{ext_man} %{_mandir}/man1/llvm-install-name-tool-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-lib.1%{ext_man} llvm-lib.1%{ext_man} %{_mandir}/man1/llvm-lib-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-libtool-darwin.1%{ext_man} llvm-libtool-darwin.1%{ext_man} %{_mandir}/man1/llvm-libtool-darwin-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-link.1%{ext_man} llvm-link.1%{ext_man} %{_mandir}/man1/llvm-link-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-lipo.1%{ext_man} llvm-lipo.1%{ext_man} %{_mandir}/man1/llvm-lipo-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-mca.1%{ext_man} llvm-mca.1%{ext_man} %{_mandir}/man1/llvm-mca-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-nm.1%{ext_man} llvm-nm.1%{ext_man} %{_mandir}/man1/llvm-nm-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-objcopy.1%{ext_man} llvm-objcopy.1%{ext_man} %{_mandir}/man1/llvm-objcopy-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-objdump.1%{ext_man} llvm-objdump.1%{ext_man} %{_mandir}/man1/llvm-objdump-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-otool.1%{ext_man} llvm-otool.1%{ext_man} %{_mandir}/man1/llvm-otool-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-pdbutil.1%{ext_man} llvm-pdbutil.1%{ext_man} %{_mandir}/man1/llvm-pdbutil-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-profdata.1%{ext_man} llvm-profdata.1%{ext_man} %{_mandir}/man1/llvm-profdata-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-profgen.1%{ext_man} llvm-profgen.1%{ext_man} %{_mandir}/man1/llvm-profgen-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-ranlib.1%{ext_man} llvm-ranlib.1%{ext_man} %{_mandir}/man1/llvm-ranlib-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-readelf.1%{ext_man} llvm-readelf.1%{ext_man} %{_mandir}/man1/llvm-readelf-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-readobj.1%{ext_man} llvm-readobj.1%{ext_man} %{_mandir}/man1/llvm-readobj-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-size.1%{ext_man} llvm-size.1%{ext_man} %{_mandir}/man1/llvm-size-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-stress.1%{ext_man} llvm-stress.1%{ext_man} %{_mandir}/man1/llvm-stress-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-strings.1%{ext_man} llvm-strings.1%{ext_man} %{_mandir}/man1/llvm-strings-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-strip.1%{ext_man} llvm-strip.1%{ext_man} %{_mandir}/man1/llvm-strip-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-symbolizer.1%{ext_man} llvm-symbolizer.1%{ext_man} %{_mandir}/man1/llvm-symbolizer-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-tblgen.1%{ext_man} llvm-tblgen.1%{ext_man} %{_mandir}/man1/llvm-tblgen-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/llvm-tli-checker.1%{ext_man} llvm-tli-checker.1%{ext_man} %{_mandir}/man1/llvm-tli-checker-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/opt.1%{ext_man} opt.1%{ext_man} %{_mandir}/man1/opt-%{_relver}.1%{ext_man} +%{ua_install %llvm_ua_anchor} \ + %{lapply -p ua_bin_slave %llvm_binfiles_1} \ + %{lapply -p ua_bin_slave %llvm_binfiles_2} \ + %{lapply -p ua_bin_slave %llvm_binfiles_3} \ + %{lapply -p ua_bin_slave %llvm_binfiles_4} \ + %{lapply -p ua_man_slave %llvm_manfiles_1} \ + %{lapply -p ua_man_slave %llvm_manfiles_2} %postun -if [ ! -f %{_bindir}/llvm-ar-%{_relver} ] ; then - %{_sbindir}/update-alternatives --remove llvm-ar %{_bindir}/llvm-ar-%{_relver} -fi +%{ua_remove %llvm_ua_anchor} %post -n clang%{_sonum} -%{_sbindir}/update-alternatives \ - --install %{_bindir}/clang clang %{_bindir}/clang-%{_relver} %{_uaver} \ - --slave %{_bindir}/clangd clangd %{_bindir}/clangd-%{_relver} \ - --slave %{_bindir}/c-index-test c-index-test %{_bindir}/c-index-test-%{_relver} \ - --slave %{_bindir}/clang++ clang++ %{_bindir}/clang++-%{_relver} \ - --slave %{_bindir}/clang-apply-replacements clang-apply-replacements %{_bindir}/clang-apply-replacements-%{_relver} \ - --slave %{_bindir}/clang-change-namespace clang-change-namespace %{_bindir}/clang-change-namespace-%{_relver} \ - --slave %{_bindir}/clang-check clang-check %{_bindir}/clang-check-%{_relver} \ - --slave %{_bindir}/clang-cl clang-cl %{_bindir}/clang-cl-%{_relver} \ - --slave %{_bindir}/clang-extdef-mapping clang-extdef-mapping %{_bindir}/clang-extdef-mapping-%{_relver} \ - --slave %{_bindir}/clang-format clang-format %{_bindir}/clang-format-%{_relver} \ - --slave %{_bindir}/clang-include-fixer clang-include-fixer %{_bindir}/clang-include-fixer-%{_relver} \ - --slave %{_bindir}/clang-linker-wrapper clang-linker-wrapper %{_bindir}/clang-linker-wrapper-%{_relver} \ - --slave %{_bindir}/clang-move clang-move %{_bindir}/clang-move-%{_relver} \ - --slave %{_bindir}/clang-nvlink-wrapper clang-nvlink-wrapper %{_bindir}/clang-nvlink-wrapper-%{_relver} \ - --slave %{_bindir}/clang-offload-bundler clang-offload-bundler %{_bindir}/clang-offload-bundler-%{_relver} \ - --slave %{_bindir}/clang-offload-wrapper clang-offload-wrapper %{_bindir}/clang-offload-wrapper-%{_relver} \ - --slave %{_bindir}/clang-query clang-query %{_bindir}/clang-query-%{_relver} \ - --slave %{_bindir}/clang-refactor clang-refactor %{_bindir}/clang-refactor-%{_relver} \ - --slave %{_bindir}/clang-repl clang-repl %{_bindir}/clang-repl-%{_relver} \ - --slave %{_bindir}/clang-rename clang-rename %{_bindir}/clang-rename-%{_relver} \ - --slave %{_bindir}/clang-reorder-fields clang-reorder-fields %{_bindir}/clang-reorder-fields-%{_relver} \ - --slave %{_bindir}/clang-scan-deps clang-scan-deps %{_bindir}/clang-scan-deps-%{_relver} \ - --slave %{_bindir}/clang-tidy clang-tidy %{_bindir}/clang-tidy-%{_relver} \ - --slave %{_bindir}/diagtool diagtool %{_bindir}/diagtool-%{_relver} \ - --slave %{_bindir}/find-all-symbols find-all-symbols %{_bindir}/find-all-symbols-%{_relver} \ - --slave %{_bindir}/modularize modularize %{_bindir}/modularize-%{_relver} \ - --slave %{_bindir}/pp-trace pp-trace %{_bindir}/pp-trace-%{_relver} \ - --slave %{_mandir}/man1/clang.1%{ext_man} clang.1%{ext_man} %{_mandir}/man1/clang-%{_relver}.1%{ext_man} \ - --slave %{_mandir}/man1/diagtool.1%{ext_man} diagtool.1%{ext_man} %{_mandir}/man1/diagtool-%{_relver}.1%{ext_man} +%{ua_install %clang_ua_anchor} \ + %{lapply -p ua_bin_slave %clang_binfiles} \ + %{lapply -p ua_bin_slave %clang_tools_extra_binfiles} \ + %{lapply -p ua_man_slave %clang_manfiles} %postun -n clang%{_sonum} -if [ ! -f %{_bindir}/clang-%{_relver} ] ; then - %{_sbindir}/update-alternatives --remove clang %{_bindir}/clang-%{_relver} -fi +%{ua_remove %clang_ua_anchor} %if %{with lld} %post -n lld%{_sonum} -%{_sbindir}/update-alternatives \ - --install %{_bindir}/lld lld %{_bindir}/lld-%{_relver} %{_uaver} \ - --slave %{_bindir}/ld.lld ld.lld %{_bindir}/ld.lld-%{_relver} \ - --slave %{_bindir}/ld64.lld ld64.lld %{_bindir}/ld64.lld-%{_relver} \ - --slave %{_bindir}/lld-link lld-link %{_bindir}/lld-link-%{_relver} \ - --slave %{_bindir}/wasm-ld wasm-ld %{_bindir}/wasm-ld-%{_relver} +%{ua_install %lld_ua_anchor} \ + %{lapply -p ua_bin_slave %lld_binfiles} %{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1 %postun -n lld%{_sonum} -if [ ! -f %{_bindir}/lld-%{_relver} ] ; then - %{_sbindir}/update-alternatives --remove lld %{_bindir}/lld-%{_relver} -fi +%{ua_remove %lld_ua_anchor} if [ ! -f %{_bindir}/lld ] ; then %{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld fi @@ -1421,355 +1441,47 @@ fi %if %{with lldb} %post -n lldb%{_sonum} -%_sbindir/update-alternatives \ - --install %{_bindir}/lldb lldb %{_bindir}/lldb-%{_relver} %{_uaver} \ - --slave %{_bindir}/lldb-argdumper lldb-argdumper %{_bindir}/lldb-argdumper-%{_relver} \ - --slave %{_bindir}/lldb-instr lldb-instr %{_bindir}/lldb-instr-%{_relver} \ - --slave %{_bindir}/lldb-server lldb-server %{_bindir}/lldb-server-%{_relver} \ - --slave %{_bindir}/lldb-vscode lldb-vscode %{_bindir}/lldb-vscode-%{_relver} +%{ua_install %lldb_ua_anchor} \ + %{lapply -p ua_bin_slave %lldb_binfiles} %postun -n lldb%{_sonum} -if [ $1 -eq 0 ] ; then - %_sbindir/update-alternatives --remove lldb %{_bindir}/lldb-%{_relver} -fi +%{ua_remove %lldb_ua_anchor} %endif +%global bin_path() \ +%{_bindir}/%1 +%global bin_relver_path() \ +%{_bindir}/%1-%{_relver} +%global ghost_ua_bin_link() \ +%ghost %{_sysconfdir}/alternatives/%1 +%global man_path() \ +%{_mandir}/man1/%1.1%{ext_man} +%global man_relver_path() \ +%{_mandir}/man1/%1-%{_relver}.1%{ext_man} +%global ghost_ua_man_link() \ +%ghost %{_sysconfdir}/alternatives/%1.1%{ext_man} + %files %license CREDITS.TXT LICENSE.TXT +%{lapply -p bin_path %llvm_ua_anchor %llvm_binfiles_1} +%{lapply -p bin_path %llvm_binfiles_2} +%{lapply -p bin_path %llvm_binfiles_3} +%{lapply -p bin_path %llvm_binfiles_4} +%{lapply -p bin_relver_path %llvm_ua_anchor %llvm_binfiles_1} +%{lapply -p bin_relver_path %llvm_binfiles_2} +%{lapply -p bin_relver_path %llvm_binfiles_3} +%{lapply -p bin_relver_path %llvm_binfiles_4} +%{lapply -p ghost_ua_bin_link %llvm_ua_anchor %llvm_binfiles_1} +%{lapply -p ghost_ua_bin_link %llvm_binfiles_2} +%{lapply -p ghost_ua_bin_link %llvm_binfiles_3} +%{lapply -p ghost_ua_bin_link %llvm_binfiles_4} -%{_bindir}/bugpoint -%{_bindir}/dsymutil -%{_bindir}/llc -%{_bindir}/lli -%{_bindir}/llvm-addr2line -%{_bindir}/llvm-ar -%{_bindir}/llvm-as -%{_bindir}/llvm-bcanalyzer -%{_bindir}/llvm-bitcode-strip -%{_bindir}/llvm-c-test -%{_bindir}/llvm-cat -%{_bindir}/llvm-cfi-verify -%{_bindir}/llvm-cov -%{_bindir}/llvm-cvtres -%{_bindir}/llvm-cxxdump -%{_bindir}/llvm-cxxfilt -%{_bindir}/llvm-cxxmap -%{_bindir}/llvm-debuginfod-find -%{_bindir}/llvm-diff -%{_bindir}/llvm-dis -%{_bindir}/llvm-dlltool -%{_bindir}/llvm-dwarfdump -%{_bindir}/llvm-dwp -%{_bindir}/llvm-extract -%{_bindir}/llvm-gsymutil -%{_bindir}/llvm-ifs -%{_bindir}/llvm-install-name-tool -%{_bindir}/llvm-jitlink -%{_bindir}/llvm-lib -%{_bindir}/llvm-libtool-darwin -%{_bindir}/llvm-link -%{_bindir}/llvm-lipo -%{_bindir}/llvm-lto -%{_bindir}/llvm-lto2 -%{_bindir}/llvm-mc -%{_bindir}/llvm-mca -%{_bindir}/llvm-ml -%{_bindir}/llvm-mt -%{_bindir}/llvm-modextract -%{_bindir}/llvm-nm -%{_bindir}/llvm-objcopy -%{_bindir}/llvm-objdump -%{_bindir}/llvm-opt-report -%{_bindir}/llvm-otool -%{_bindir}/llvm-pdbutil -%{_bindir}/llvm-profdata -%{_bindir}/llvm-profgen -%{_bindir}/llvm-ranlib -%{_bindir}/llvm-rc -%{_bindir}/llvm-readelf -%{_bindir}/llvm-readobj -%{_bindir}/llvm-reduce -%{_bindir}/llvm-rtdyld -%{_bindir}/llvm-sim -%{_bindir}/llvm-size -%{_bindir}/llvm-split -%{_bindir}/llvm-stress -%{_bindir}/llvm-strings -%{_bindir}/llvm-strip -%{_bindir}/llvm-symbolizer -%{_bindir}/llvm-tapi-diff -%{_bindir}/llvm-tblgen -%{_bindir}/llvm-tli-checker -%{_bindir}/llvm-undname -%{_bindir}/llvm-windres -%{_bindir}/llvm-xray -%{_bindir}/opt -%{_bindir}/sancov -%{_bindir}/sanstats -%{_bindir}/split-file -%{_bindir}/verify-uselistorder - -%{_bindir}/bugpoint-%{_relver} -%{_bindir}/dsymutil-%{_relver} -%{_bindir}/llc-%{_relver} -%{_bindir}/lli-%{_relver} -%{_bindir}/llvm-addr2line-%{_relver} -%{_bindir}/llvm-ar-%{_relver} -%{_bindir}/llvm-as-%{_relver} -%{_bindir}/llvm-bcanalyzer-%{_relver} -%{_bindir}/llvm-bitcode-strip-%{_relver} -%{_bindir}/llvm-c-test-%{_relver} -%{_bindir}/llvm-cat-%{_relver} -%{_bindir}/llvm-cfi-verify-%{_relver} -%{_bindir}/llvm-cov-%{_relver} -%{_bindir}/llvm-cvtres-%{_relver} -%{_bindir}/llvm-cxxdump-%{_relver} -%{_bindir}/llvm-cxxfilt-%{_relver} -%{_bindir}/llvm-cxxmap-%{_relver} -%{_bindir}/llvm-debuginfod-find-%{_relver} -%{_bindir}/llvm-diff-%{_relver} -%{_bindir}/llvm-dis-%{_relver} -%{_bindir}/llvm-dlltool-%{_relver} -%{_bindir}/llvm-dwarfdump-%{_relver} -%{_bindir}/llvm-dwp-%{_relver} -%{_bindir}/llvm-extract-%{_relver} -%{_bindir}/llvm-gsymutil-%{_relver} -%{_bindir}/llvm-ifs-%{_relver} -%{_bindir}/llvm-install-name-tool-%{_relver} -%{_bindir}/llvm-jitlink-%{_relver} -%{_bindir}/llvm-lib-%{_relver} -%{_bindir}/llvm-libtool-darwin-%{_relver} -%{_bindir}/llvm-link-%{_relver} -%{_bindir}/llvm-lipo-%{_relver} -%{_bindir}/llvm-lto-%{_relver} -%{_bindir}/llvm-lto2-%{_relver} -%{_bindir}/llvm-mc-%{_relver} -%{_bindir}/llvm-mca-%{_relver} -%{_bindir}/llvm-ml-%{_relver} -%{_bindir}/llvm-mt-%{_relver} -%{_bindir}/llvm-modextract-%{_relver} -%{_bindir}/llvm-nm-%{_relver} -%{_bindir}/llvm-objcopy-%{_relver} -%{_bindir}/llvm-objdump-%{_relver} -%{_bindir}/llvm-opt-report-%{_relver} -%{_bindir}/llvm-otool-%{_relver} -%{_bindir}/llvm-pdbutil-%{_relver} -%{_bindir}/llvm-profdata-%{_relver} -%{_bindir}/llvm-profgen-%{_relver} -%{_bindir}/llvm-ranlib-%{_relver} -%{_bindir}/llvm-rc-%{_relver} -%{_bindir}/llvm-readelf-%{_relver} -%{_bindir}/llvm-readobj-%{_relver} -%{_bindir}/llvm-reduce-%{_relver} -%{_bindir}/llvm-rtdyld-%{_relver} -%{_bindir}/llvm-sim-%{_relver} -%{_bindir}/llvm-size-%{_relver} -%{_bindir}/llvm-split-%{_relver} -%{_bindir}/llvm-stress-%{_relver} -%{_bindir}/llvm-strings-%{_relver} -%{_bindir}/llvm-strip-%{_relver} -%{_bindir}/llvm-symbolizer-%{_relver} -%{_bindir}/llvm-tapi-diff-%{_relver} -%{_bindir}/llvm-tblgen-%{_relver} -%{_bindir}/llvm-tli-checker-%{_relver} -%{_bindir}/llvm-undname-%{_relver} -%{_bindir}/llvm-windres-%{_relver} -%{_bindir}/llvm-xray-%{_relver} -%{_bindir}/opt-%{_relver} -%{_bindir}/sancov-%{_relver} -%{_bindir}/sanstats-%{_relver} -%{_bindir}/split-file-%{_relver} -%{_bindir}/verify-uselistorder-%{_relver} - -%ghost %{_sysconfdir}/alternatives/bugpoint -%ghost %{_sysconfdir}/alternatives/dsymutil -%ghost %{_sysconfdir}/alternatives/llc -%ghost %{_sysconfdir}/alternatives/lli -%ghost %{_sysconfdir}/alternatives/llvm-addr2line -%ghost %{_sysconfdir}/alternatives/llvm-ar -%ghost %{_sysconfdir}/alternatives/llvm-as -%ghost %{_sysconfdir}/alternatives/llvm-bcanalyzer -%ghost %{_sysconfdir}/alternatives/llvm-bitcode-strip -%ghost %{_sysconfdir}/alternatives/llvm-c-test -%ghost %{_sysconfdir}/alternatives/llvm-cat -%ghost %{_sysconfdir}/alternatives/llvm-cfi-verify -%ghost %{_sysconfdir}/alternatives/llvm-cov -%ghost %{_sysconfdir}/alternatives/llvm-cvtres -%ghost %{_sysconfdir}/alternatives/llvm-cxxdump -%ghost %{_sysconfdir}/alternatives/llvm-cxxfilt -%ghost %{_sysconfdir}/alternatives/llvm-cxxmap -%ghost %{_sysconfdir}/alternatives/llvm-debuginfod-find -%ghost %{_sysconfdir}/alternatives/llvm-diff -%ghost %{_sysconfdir}/alternatives/llvm-dis -%ghost %{_sysconfdir}/alternatives/llvm-dlltool -%ghost %{_sysconfdir}/alternatives/llvm-dwarfdump -%ghost %{_sysconfdir}/alternatives/llvm-dwp -%ghost %{_sysconfdir}/alternatives/llvm-extract -%ghost %{_sysconfdir}/alternatives/llvm-gsymutil -%ghost %{_sysconfdir}/alternatives/llvm-ifs -%ghost %{_sysconfdir}/alternatives/llvm-install-name-tool -%ghost %{_sysconfdir}/alternatives/llvm-jitlink -%ghost %{_sysconfdir}/alternatives/llvm-lib -%ghost %{_sysconfdir}/alternatives/llvm-libtool-darwin -%ghost %{_sysconfdir}/alternatives/llvm-link -%ghost %{_sysconfdir}/alternatives/llvm-lipo -%ghost %{_sysconfdir}/alternatives/llvm-lto -%ghost %{_sysconfdir}/alternatives/llvm-lto2 -%ghost %{_sysconfdir}/alternatives/llvm-mc -%ghost %{_sysconfdir}/alternatives/llvm-mca -%ghost %{_sysconfdir}/alternatives/llvm-ml -%ghost %{_sysconfdir}/alternatives/llvm-mt -%ghost %{_sysconfdir}/alternatives/llvm-modextract -%ghost %{_sysconfdir}/alternatives/llvm-nm -%ghost %{_sysconfdir}/alternatives/llvm-objcopy -%ghost %{_sysconfdir}/alternatives/llvm-objdump -%ghost %{_sysconfdir}/alternatives/llvm-opt-report -%ghost %{_sysconfdir}/alternatives/llvm-otool -%ghost %{_sysconfdir}/alternatives/llvm-pdbutil -%ghost %{_sysconfdir}/alternatives/llvm-profdata -%ghost %{_sysconfdir}/alternatives/llvm-profgen -%ghost %{_sysconfdir}/alternatives/llvm-ranlib -%ghost %{_sysconfdir}/alternatives/llvm-rc -%ghost %{_sysconfdir}/alternatives/llvm-readelf -%ghost %{_sysconfdir}/alternatives/llvm-readobj -%ghost %{_sysconfdir}/alternatives/llvm-reduce -%ghost %{_sysconfdir}/alternatives/llvm-rtdyld -%ghost %{_sysconfdir}/alternatives/llvm-sim -%ghost %{_sysconfdir}/alternatives/llvm-size -%ghost %{_sysconfdir}/alternatives/llvm-split -%ghost %{_sysconfdir}/alternatives/llvm-stress -%ghost %{_sysconfdir}/alternatives/llvm-strings -%ghost %{_sysconfdir}/alternatives/llvm-strip -%ghost %{_sysconfdir}/alternatives/llvm-symbolizer -%ghost %{_sysconfdir}/alternatives/llvm-tapi-diff -%ghost %{_sysconfdir}/alternatives/llvm-tblgen -%ghost %{_sysconfdir}/alternatives/llvm-tli-checker -%ghost %{_sysconfdir}/alternatives/llvm-undname -%ghost %{_sysconfdir}/alternatives/llvm-windres -%ghost %{_sysconfdir}/alternatives/llvm-xray -%ghost %{_sysconfdir}/alternatives/opt -%ghost %{_sysconfdir}/alternatives/sancov -%ghost %{_sysconfdir}/alternatives/sanstats -%ghost %{_sysconfdir}/alternatives/split-file -%ghost %{_sysconfdir}/alternatives/verify-uselistorder - -%{_mandir}/man1/bugpoint.1%{ext_man} -%{_mandir}/man1/dsymutil.1%{ext_man} -%{_mandir}/man1/llc.1%{ext_man} -%{_mandir}/man1/lli.1%{ext_man} -%{_mandir}/man1/llvm-addr2line.1%{ext_man} -%{_mandir}/man1/llvm-ar.1%{ext_man} -%{_mandir}/man1/llvm-as.1%{ext_man} -%{_mandir}/man1/llvm-bcanalyzer.1%{ext_man} -%{_mandir}/man1/llvm-cov.1%{ext_man} -%{_mandir}/man1/llvm-cxxfilt.1%{ext_man} -%{_mandir}/man1/llvm-cxxmap.1%{ext_man} -%{_mandir}/man1/llvm-diff.1%{ext_man} -%{_mandir}/man1/llvm-dis.1%{ext_man} -%{_mandir}/man1/llvm-dwarfdump.1%{ext_man} -%{_mandir}/man1/llvm-extract.1%{ext_man} -%{_mandir}/man1/llvm-install-name-tool.1%{ext_man} -%{_mandir}/man1/llvm-lib.1%{ext_man} -%{_mandir}/man1/llvm-libtool-darwin.1%{ext_man} -%{_mandir}/man1/llvm-link.1%{ext_man} -%{_mandir}/man1/llvm-lipo.1%{ext_man} -%{_mandir}/man1/llvm-mca.1%{ext_man} -%{_mandir}/man1/llvm-nm.1%{ext_man} -%{_mandir}/man1/llvm-objcopy.1%{ext_man} -%{_mandir}/man1/llvm-objdump.1%{ext_man} -%{_mandir}/man1/llvm-otool.1%{ext_man} -%{_mandir}/man1/llvm-pdbutil.1%{ext_man} -%{_mandir}/man1/llvm-profdata.1%{ext_man} -%{_mandir}/man1/llvm-profgen.1%{ext_man} -%{_mandir}/man1/llvm-ranlib.1%{ext_man} -%{_mandir}/man1/llvm-readelf.1%{ext_man} -%{_mandir}/man1/llvm-readobj.1%{ext_man} -%{_mandir}/man1/llvm-size.1%{ext_man} -%{_mandir}/man1/llvm-stress.1%{ext_man} -%{_mandir}/man1/llvm-strings.1%{ext_man} -%{_mandir}/man1/llvm-strip.1%{ext_man} -%{_mandir}/man1/llvm-symbolizer.1%{ext_man} -%{_mandir}/man1/llvm-tblgen.1%{ext_man} -%{_mandir}/man1/llvm-tli-checker.1%{ext_man} -%{_mandir}/man1/opt.1%{ext_man} -%{_mandir}/man1/bugpoint-%{_relver}.1%{ext_man} -%{_mandir}/man1/dsymutil-%{_relver}.1%{ext_man} -%{_mandir}/man1/llc-%{_relver}.1%{ext_man} -%{_mandir}/man1/lli-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-addr2line-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-ar-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-as-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-bcanalyzer-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-cov-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-cxxfilt-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-cxxmap-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-diff-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-dis-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-dwarfdump-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-extract-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-install-name-tool-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-lib-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-libtool-darwin-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-link-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-lipo-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-mca-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-nm-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-objcopy-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-objdump-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-otool-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-pdbutil-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-profdata-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-profgen-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-ranlib-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-readelf-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-readobj-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-size-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-stress-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-strings-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-strip-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-symbolizer-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-tblgen-%{_relver}.1%{ext_man} -%{_mandir}/man1/llvm-tli-checker-%{_relver}.1%{ext_man} -%{_mandir}/man1/opt-%{_relver}.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/bugpoint.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/dsymutil.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llc.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/lli.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-addr2line.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-ar.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-as.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-bcanalyzer.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-cov.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-cxxfilt.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-cxxmap.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-diff.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-dis.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-dwarfdump.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-extract.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-install-name-tool.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-lib.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-libtool-darwin.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-link.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-lipo.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-mca.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-nm.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-objcopy.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-objdump.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-otool.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-pdbutil.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-profdata.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-profgen.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-ranlib.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-readelf.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-readobj.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-size.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-stress.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-strings.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-strip.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-symbolizer.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-tblgen.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/llvm-tli-checker.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/opt.1%{ext_man} +%{lapply -p man_path %llvm_manfiles_1} +%{lapply -p man_path %llvm_manfiles_2} +%{lapply -p man_relver_path %llvm_manfiles_1} +%{lapply -p man_relver_path %llvm_manfiles_2} +%{lapply -p ghost_ua_man_link %llvm_manfiles_1} +%{lapply -p ghost_ua_man_link %llvm_manfiles_2} %files -n clang%{_sonum} %license CREDITS.TXT LICENSE.TXT @@ -1777,94 +1489,18 @@ fi %{_bindir}/clang-%{_sonum} %{_bindir}/clang++-%{_minor} %{_bindir}/clang++-%{_sonum} -%{_bindir}/c-index-test -%{_bindir}/clang -%{_bindir}/clangd -%{_bindir}/clang++ -%{_bindir}/clang-apply-replacements -%{_bindir}/clang-change-namespace -%{_bindir}/clang-check -%{_bindir}/clang-cl %{_bindir}/clang-cpp -%{_bindir}/clang-extdef-mapping -%{_bindir}/clang-format -%{_bindir}/clang-include-fixer -%{_bindir}/clang-linker-wrapper -%{_bindir}/clang-move -%{_bindir}/clang-nvlink-wrapper -%{_bindir}/clang-offload-bundler -%{_bindir}/clang-offload-wrapper -%{_bindir}/clang-query -%{_bindir}/clang-refactor -%{_bindir}/clang-repl -%{_bindir}/clang-rename -%{_bindir}/clang-reorder-fields -%{_bindir}/clang-scan-deps -%{_bindir}/clang-tidy -%{_bindir}/diagtool -%{_bindir}/find-all-symbols -%{_bindir}/modularize -%{_bindir}/pp-trace -%{_bindir}/c-index-test-%{_relver} -%{_bindir}/clang-%{_relver} -%{_bindir}/clangd-%{_relver} -%{_bindir}/clang++-%{_relver} -%{_bindir}/clang-apply-replacements-%{_relver} -%{_bindir}/clang-change-namespace-%{_relver} -%{_bindir}/clang-check-%{_relver} -%{_bindir}/clang-cl-%{_relver} -%{_bindir}/clang-extdef-mapping-%{_relver} -%{_bindir}/clang-format-%{_relver} -%{_bindir}/clang-include-fixer-%{_relver} -%{_bindir}/clang-linker-wrapper-%{_relver} -%{_bindir}/clang-move-%{_relver} -%{_bindir}/clang-nvlink-wrapper-%{_relver} -%{_bindir}/clang-offload-bundler-%{_relver} -%{_bindir}/clang-offload-wrapper-%{_relver} -%{_bindir}/clang-query-%{_relver} -%{_bindir}/clang-refactor-%{_relver} -%{_bindir}/clang-repl-%{_relver} -%{_bindir}/clang-rename-%{_relver} -%{_bindir}/clang-reorder-fields-%{_relver} -%{_bindir}/clang-scan-deps-%{_relver} -%{_bindir}/clang-tidy-%{_relver} -%{_bindir}/diagtool-%{_relver} -%{_bindir}/find-all-symbols-%{_relver} -%{_bindir}/modularize-%{_relver} -%{_bindir}/pp-trace-%{_relver} -%ghost %{_sysconfdir}/alternatives/c-index-test -%ghost %{_sysconfdir}/alternatives/clang -%ghost %{_sysconfdir}/alternatives/clangd -%ghost %{_sysconfdir}/alternatives/clang++ -%ghost %{_sysconfdir}/alternatives/clang-apply-replacements -%ghost %{_sysconfdir}/alternatives/clang-change-namespace -%ghost %{_sysconfdir}/alternatives/clang-check -%ghost %{_sysconfdir}/alternatives/clang-cl -%ghost %{_sysconfdir}/alternatives/clang-extdef-mapping -%ghost %{_sysconfdir}/alternatives/clang-format -%ghost %{_sysconfdir}/alternatives/clang-include-fixer -%ghost %{_sysconfdir}/alternatives/clang-linker-wrapper -%ghost %{_sysconfdir}/alternatives/clang-move -%ghost %{_sysconfdir}/alternatives/clang-nvlink-wrapper -%ghost %{_sysconfdir}/alternatives/clang-offload-bundler -%ghost %{_sysconfdir}/alternatives/clang-offload-wrapper -%ghost %{_sysconfdir}/alternatives/clang-query -%ghost %{_sysconfdir}/alternatives/clang-refactor -%ghost %{_sysconfdir}/alternatives/clang-repl -%ghost %{_sysconfdir}/alternatives/clang-rename -%ghost %{_sysconfdir}/alternatives/clang-reorder-fields -%ghost %{_sysconfdir}/alternatives/clang-scan-deps -%ghost %{_sysconfdir}/alternatives/clang-tidy -%ghost %{_sysconfdir}/alternatives/diagtool -%ghost %{_sysconfdir}/alternatives/find-all-symbols -%ghost %{_sysconfdir}/alternatives/modularize -%ghost %{_sysconfdir}/alternatives/pp-trace -%{_mandir}/man1/clang.1%{ext_man} -%{_mandir}/man1/diagtool.1%{ext_man} -%{_mandir}/man1/clang-%{_relver}.1%{ext_man} -%{_mandir}/man1/diagtool-%{_relver}.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/clang.1%{ext_man} -%ghost %{_sysconfdir}/alternatives/diagtool.1%{ext_man} +%{lapply -p bin_path %clang_ua_anchor %clang_binfiles} +%{lapply -p bin_path %clang_tools_extra_binfiles} +%{lapply -p bin_relver_path %clang_ua_anchor %clang_binfiles} +%{lapply -p bin_relver_path %clang_tools_extra_binfiles} +%{lapply -p ghost_ua_bin_link %clang_ua_anchor %clang_binfiles} +%{lapply -p ghost_ua_bin_link %clang_tools_extra_binfiles} + +%{lapply -p man_path %clang_manfiles} +%{lapply -p man_relver_path %clang_manfiles} +%{lapply -p ghost_ua_man_link %clang_manfiles} + %dir %{_libdir}/clang/ %dir %{_libdir}/clang/%{_relver}/ %ifarch aarch64 x86_64 @@ -2016,41 +1652,17 @@ fi %if %{with lld} %files -n lld%{_sonum} %license CREDITS.TXT LICENSE.TXT -%{_bindir}/ld.lld -%{_bindir}/ld64.lld -%{_bindir}/lld -%{_bindir}/lld-link -%{_bindir}/wasm-ld -%{_bindir}/ld.lld-%{_relver} -%{_bindir}/ld64.lld-%{_relver} -%{_bindir}/lld-%{_relver} -%{_bindir}/lld-link-%{_relver} -%{_bindir}/wasm-ld-%{_relver} -%ghost %{_sysconfdir}/alternatives/ld.lld -%ghost %{_sysconfdir}/alternatives/ld64.lld -%ghost %{_sysconfdir}/alternatives/lld -%ghost %{_sysconfdir}/alternatives/lld-link -%ghost %{_sysconfdir}/alternatives/wasm-ld +%{lapply -p bin_path %lld_ua_anchor %lld_binfiles} +%{lapply -p bin_relver_path %lld_ua_anchor %lld_binfiles} +%{lapply -p ghost_ua_bin_link %lld_ua_anchor %lld_binfiles} %endif %if %{with lldb} %files -n lldb%{_sonum} %license CREDITS.TXT LICENSE.TXT -%{_bindir}/lldb -%{_bindir}/lldb-argdumper -%{_bindir}/lldb-instr -%{_bindir}/lldb-server -%{_bindir}/lldb-vscode -%{_bindir}/lldb-%{_relver} -%{_bindir}/lldb-argdumper-%{_relver} -%{_bindir}/lldb-instr-%{_relver} -%{_bindir}/lldb-server-%{_relver} -%{_bindir}/lldb-vscode-%{_relver} -%ghost %{_sysconfdir}/alternatives/lldb -%ghost %{_sysconfdir}/alternatives/lldb-argdumper -%ghost %{_sysconfdir}/alternatives/lldb-instr -%ghost %{_sysconfdir}/alternatives/lldb-server -%ghost %{_sysconfdir}/alternatives/lldb-vscode +%{lapply -p bin_path %lldb_ua_anchor %lldb_binfiles} +%{lapply -p bin_relver_path %lldb_ua_anchor %lldb_binfiles} +%{lapply -p ghost_ua_bin_link %lldb_ua_anchor %lldb_binfiles} %if %{with lldb_python} %files -n python3-lldb%{_sonum} From 40d55dde860bf553b786e180b9cd16eadaea24c38cdcad8012187342d9ac09e3 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Wed, 24 Aug 2022 01:24:16 +0000 Subject: [PATCH 2/9] - Group LLVM binaries by topic. - Don't declare python3-clang as noarch: Python packages are installed into %{_libdir}. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=29 --- llvm14.changes | 6 ++ llvm14.spec | 228 +++++++++++++++++++++++++++---------------------- 2 files changed, 130 insertions(+), 104 deletions(-) diff --git a/llvm14.changes b/llvm14.changes index fba13af..6a78ef3 100644 --- a/llvm14.changes +++ b/llvm14.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Aug 23 21:20:47 UTC 2022 - Aaron Puchert + +- Don't declare python3-clang as noarch: Python packages are + installed into %{_libdir}. + ------------------------------------------------------------------- Sat Aug 13 21:53:05 UTC 2022 - Aaron Puchert diff --git a/llvm14.spec b/llvm14.spec index 37e2fe4..9f3e114 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -121,82 +121,92 @@ # produces foo_a foo_b foo_c. %define lapply(p:) %{_lapply_rec -p %{-p*} -f %{shrink:%*}} -# Due to RPMs recursion limit, we have to split the lists into portions of 19. +# Due to RPMs recursion limit, we have to split the lists into portions of ≤ 20. %global llvm_ua_anchor llvm-ar -%global llvm_binfiles_1 \ - bugpoint \ - dsymutil \ +%global llvm_tools \ +%dnl Optimizer, compiler, interpreter, linker \ llc \ lli \ - llvm-addr2line \ + llvm-jitlink \ + llvm-link \ + llvm-lto \ + llvm-lto2 \ + llvm-rtdyld \ + opt \ +%dnl LLVM IR tools \ llvm-as \ llvm-bcanalyzer \ llvm-bitcode-strip \ - llvm-c-test \ llvm-cat \ - llvm-cfi-verify \ - llvm-cov \ - llvm-cxxdump \ - llvm-cxxfilt \ - llvm-cxxmap \ - llvm-debuginfod-find \ - llvm-cvtres \ - llvm-diff -%global llvm_binfiles_2 \ + llvm-diff \ llvm-dis \ - llvm-dlltool \ - llvm-dwarfdump \ - llvm-dwp \ llvm-extract \ - llvm-gsymutil \ - llvm-ifs \ - llvm-install-name-tool \ - llvm-jitlink \ - llvm-lib \ - llvm-libtool-darwin \ - llvm-link \ - llvm-lipo \ - llvm-lto \ - llvm-lto2 \ - llvm-mc \ - llvm-mca \ - llvm-ml \ - llvm-mt -%global llvm_binfiles_3 \ llvm-modextract \ + llvm-sim \ + llvm-split +%global llvm_elf_dwarf_tools \ +%dnl ELF tools \ + llvm-cfi-verify \ + llvm-ifs \ llvm-nm \ llvm-objcopy \ llvm-objdump \ - llvm-opt-report \ - llvm-otool \ - llvm-pdbutil \ - llvm-profdata \ - llvm-profgen \ llvm-ranlib \ - llvm-rc \ llvm-readelf \ llvm-readobj \ - llvm-reduce \ - llvm-rtdyld \ - llvm-sim \ llvm-size \ - llvm-split \ - llvm-stress -%global llvm_binfiles_4 \ - llvm-strings \ llvm-strip \ - llvm-symbolizer \ - llvm-tapi-diff \ - llvm-tblgen \ - llvm-tli-checker \ +%dnl Debug info tools \ + dsymutil \ + llvm-addr2line \ + llvm-debuginfod-find \ + llvm-dwarfdump \ + llvm-dwp \ + llvm-gsymutil +%global llvm_cxxabi_coff_macho_tools \ +%dnl ABI tools \ + llvm-cxxdump \ + llvm-cxxfilt \ + llvm-cxxmap \ +%dnl Windows/COFF \ + llvm-cvtres \ + llvm-dlltool \ + llvm-lib \ + llvm-ml \ + llvm-mt \ + llvm-pdbutil \ + llvm-rc \ llvm-undname \ llvm-windres \ +%dnl Apple/Mach-O \ + llvm-install-name-tool \ + llvm-libtool-darwin \ + llvm-lipo \ + llvm-otool \ + llvm-tapi-diff +%global llvm_instrumentation_development_tools \ +%dnl Instrumentation and introspection \ + llvm-cov \ + llvm-opt-report \ + llvm-profdata \ + llvm-profgen \ + llvm-symbolizer \ llvm-xray \ - opt \ sancov \ sanstats \ +%dnl Development utilities \ + bugpoint \ + llvm-c-test \ + llvm-mc \ + llvm-mca \ + llvm-reduce \ + llvm-stress \ + llvm-strings \ + llvm-tblgen \ + llvm-tli-checker \ split-file \ verify-uselistorder + %global clang_ua_anchor clang %global clang_binfiles \ c-index-test \ @@ -243,53 +253,64 @@ lldb-vscode %endif %global binfiles \ - %{llvm_ua_anchor} %{llvm_binfiles_1} %{llvm_binfiles_2} %{llvm_binfiles_3} %{llvm_binfiles_4} \ + %{llvm_ua_anchor} %{llvm_tools} %{llvm_elf_dwarf_tools} \ + %{llvm_cxxabi_coff_macho_tools} %{llvm_instrumentation_development_tools} \ %{clang_ua_anchor} %{clang_binfiles} %{clang_tools_extra_binfiles} \ %{?lld_ua_anchor} %{?lld_binfiles} %{?lldb_ua_anchor} %{?lldb_binfiles} -%global llvm_manfiles_1 \ - bugpoint \ - dsymutil \ +%global llvm_main_man \ +%dnl Optimizer, compiler, interpreter, linker \ llc \ lli \ - llvm-addr2line \ - llvm-ar \ + llvm-link \ + opt \ +%dnl LLVM IR tools \ llvm-as \ llvm-bcanalyzer \ - llvm-cov \ - llvm-cxxfilt \ - llvm-cxxmap \ - llvm-diff \ llvm-dis \ - llvm-dwarfdump \ llvm-extract \ - llvm-install-name-tool \ - llvm-lib \ - llvm-libtool-darwin \ - llvm-link -%global llvm_manfiles_2 \ - llvm-lipo \ +%dnl Instrumentation and introspection \ + llvm-cov \ + llvm-profdata \ + llvm-profgen \ + llvm-symbolizer \ +%dnl Development utilities \ + bugpoint \ + llvm-diff \ llvm-mca \ + llvm-stress \ + llvm-strings \ + llvm-tblgen \ + llvm-tli-checker +%global llvm_aux_man \ +%dnl ELF tools \ + llvm-ar \ llvm-nm \ llvm-objcopy \ llvm-objdump \ - llvm-otool \ - llvm-pdbutil \ - llvm-profdata \ - llvm-profgen \ llvm-ranlib \ llvm-readelf \ llvm-readobj \ llvm-size \ - llvm-stress \ - llvm-strings \ llvm-strip \ - llvm-symbolizer \ - llvm-tblgen \ - llvm-tli-checker \ - opt +%dnl Debug info tools \ + dsymutil \ + llvm-addr2line \ + llvm-dwarfdump \ +%dnl ABI tools \ + llvm-cxxfilt \ + llvm-cxxmap \ +%dnl Windows/COFF \ + llvm-lib \ + llvm-pdbutil \ +%dnl Apple/Mach-O \ + llvm-install-name-tool \ + llvm-libtool-darwin \ + llvm-lipo \ + llvm-otool + %global clang_manfiles clang diagtool -%global manfiles %{llvm_manfiles_1} %{llvm_manfiles_2} %{clang_manfiles} +%global manfiles %{llvm_main_man} %{llvm_aux_man} %{clang_manfiles} %define _dwz_low_mem_die_limit 40000000 %define _dwz_max_die_limit 200000000 @@ -644,7 +665,6 @@ Requires: libclang%{_soclang} >= %{version} Requires: python3-base Conflicts: %{python3_sitearch}/clang/ Provides: %{python3_sitearch}/clang/ -BuildArch: noarch %description -n python3-clang%{_sonum} This package contains the Python bindings to clang (C language) @@ -1407,12 +1427,12 @@ fi %post %{ua_install %llvm_ua_anchor} \ - %{lapply -p ua_bin_slave %llvm_binfiles_1} \ - %{lapply -p ua_bin_slave %llvm_binfiles_2} \ - %{lapply -p ua_bin_slave %llvm_binfiles_3} \ - %{lapply -p ua_bin_slave %llvm_binfiles_4} \ - %{lapply -p ua_man_slave %llvm_manfiles_1} \ - %{lapply -p ua_man_slave %llvm_manfiles_2} + %{lapply -p ua_bin_slave %llvm_tools} \ + %{lapply -p ua_bin_slave %llvm_elf_dwarf_tools} \ + %{lapply -p ua_bin_slave %llvm_cxxabi_coff_macho_tools} \ + %{lapply -p ua_bin_slave %llvm_instrumentation_development_tools} \ + %{lapply -p ua_man_slave %llvm_main_man} \ + %{lapply -p ua_man_slave %llvm_aux_man} %postun %{ua_remove %llvm_ua_anchor} @@ -1463,25 +1483,25 @@ fi %files %license CREDITS.TXT LICENSE.TXT -%{lapply -p bin_path %llvm_ua_anchor %llvm_binfiles_1} -%{lapply -p bin_path %llvm_binfiles_2} -%{lapply -p bin_path %llvm_binfiles_3} -%{lapply -p bin_path %llvm_binfiles_4} -%{lapply -p bin_relver_path %llvm_ua_anchor %llvm_binfiles_1} -%{lapply -p bin_relver_path %llvm_binfiles_2} -%{lapply -p bin_relver_path %llvm_binfiles_3} -%{lapply -p bin_relver_path %llvm_binfiles_4} -%{lapply -p ghost_ua_bin_link %llvm_ua_anchor %llvm_binfiles_1} -%{lapply -p ghost_ua_bin_link %llvm_binfiles_2} -%{lapply -p ghost_ua_bin_link %llvm_binfiles_3} -%{lapply -p ghost_ua_bin_link %llvm_binfiles_4} +%{lapply -p bin_path %llvm_ua_anchor %llvm_tools} +%{lapply -p bin_path %llvm_elf_dwarf_tools} +%{lapply -p bin_path %llvm_cxxabi_coff_macho_tools} +%{lapply -p bin_path %llvm_instrumentation_development_tools} +%{lapply -p bin_relver_path %llvm_ua_anchor %llvm_tools} +%{lapply -p bin_relver_path %llvm_elf_dwarf_tools} +%{lapply -p bin_relver_path %llvm_cxxabi_coff_macho_tools} +%{lapply -p bin_relver_path %llvm_instrumentation_development_tools} +%{lapply -p ghost_ua_bin_link %llvm_ua_anchor %llvm_tools} +%{lapply -p ghost_ua_bin_link %llvm_elf_dwarf_tools} +%{lapply -p ghost_ua_bin_link %llvm_cxxabi_coff_macho_tools} +%{lapply -p ghost_ua_bin_link %llvm_instrumentation_development_tools} -%{lapply -p man_path %llvm_manfiles_1} -%{lapply -p man_path %llvm_manfiles_2} -%{lapply -p man_relver_path %llvm_manfiles_1} -%{lapply -p man_relver_path %llvm_manfiles_2} -%{lapply -p ghost_ua_man_link %llvm_manfiles_1} -%{lapply -p ghost_ua_man_link %llvm_manfiles_2} +%{lapply -p man_path %llvm_main_man} +%{lapply -p man_path %llvm_aux_man} +%{lapply -p man_relver_path %llvm_main_man} +%{lapply -p man_relver_path %llvm_aux_man} +%{lapply -p ghost_ua_man_link %llvm_main_man} +%{lapply -p ghost_ua_man_link %llvm_aux_man} %files -n clang%{_sonum} %license CREDITS.TXT LICENSE.TXT From 37a5c072e8258ee91803dbbe61607f89fffc8aebde13144d3a8bfbfc2af854c3 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Wed, 24 Aug 2022 01:45:29 +0000 Subject: [PATCH 3/9] - Split man pages in three groups. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=30 --- llvm14.spec | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/llvm14.spec b/llvm14.spec index 9f3e114..a8ac780 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -163,7 +163,7 @@ llvm-dwarfdump \ llvm-dwp \ llvm-gsymutil -%global llvm_cxxabi_coff_macho_tools \ +%global llvm_abi_coff_macho_tools \ %dnl ABI tools \ llvm-cxxdump \ llvm-cxxfilt \ @@ -254,7 +254,7 @@ %endif %global binfiles \ %{llvm_ua_anchor} %{llvm_tools} %{llvm_elf_dwarf_tools} \ - %{llvm_cxxabi_coff_macho_tools} %{llvm_instrumentation_development_tools} \ + %{llvm_abi_coff_macho_tools} %{llvm_instrumentation_development_tools} \ %{clang_ua_anchor} %{clang_binfiles} %{clang_tools_extra_binfiles} \ %{?lld_ua_anchor} %{?lld_binfiles} %{?lldb_ua_anchor} %{?lldb_binfiles} @@ -273,15 +273,7 @@ llvm-cov \ llvm-profdata \ llvm-profgen \ - llvm-symbolizer \ -%dnl Development utilities \ - bugpoint \ - llvm-diff \ - llvm-mca \ - llvm-stress \ - llvm-strings \ - llvm-tblgen \ - llvm-tli-checker + llvm-symbolizer %global llvm_aux_man \ %dnl ELF tools \ llvm-ar \ @@ -297,9 +289,6 @@ dsymutil \ llvm-addr2line \ llvm-dwarfdump \ -%dnl ABI tools \ - llvm-cxxfilt \ - llvm-cxxmap \ %dnl Windows/COFF \ llvm-lib \ llvm-pdbutil \ @@ -308,9 +297,21 @@ llvm-libtool-darwin \ llvm-lipo \ llvm-otool +%global llvm_util_man \ +%dnl ABI tools \ + llvm-cxxfilt \ + llvm-cxxmap \ +%dnl Development utilities \ + bugpoint \ + llvm-diff \ + llvm-mca \ + llvm-stress \ + llvm-strings \ + llvm-tblgen \ + llvm-tli-checker %global clang_manfiles clang diagtool -%global manfiles %{llvm_main_man} %{llvm_aux_man} %{clang_manfiles} +%global manfiles %{llvm_main_man} %{llvm_aux_man} %{llvm_util_man} %{clang_manfiles} %define _dwz_low_mem_die_limit 40000000 %define _dwz_max_die_limit 200000000 @@ -1429,10 +1430,11 @@ fi %{ua_install %llvm_ua_anchor} \ %{lapply -p ua_bin_slave %llvm_tools} \ %{lapply -p ua_bin_slave %llvm_elf_dwarf_tools} \ - %{lapply -p ua_bin_slave %llvm_cxxabi_coff_macho_tools} \ + %{lapply -p ua_bin_slave %llvm_abi_coff_macho_tools} \ %{lapply -p ua_bin_slave %llvm_instrumentation_development_tools} \ %{lapply -p ua_man_slave %llvm_main_man} \ - %{lapply -p ua_man_slave %llvm_aux_man} + %{lapply -p ua_man_slave %llvm_aux_man} \ + %{lapply -p ua_man_slave %llvm_util_man} %postun %{ua_remove %llvm_ua_anchor} @@ -1485,23 +1487,26 @@ fi %license CREDITS.TXT LICENSE.TXT %{lapply -p bin_path %llvm_ua_anchor %llvm_tools} %{lapply -p bin_path %llvm_elf_dwarf_tools} -%{lapply -p bin_path %llvm_cxxabi_coff_macho_tools} +%{lapply -p bin_path %llvm_abi_coff_macho_tools} %{lapply -p bin_path %llvm_instrumentation_development_tools} %{lapply -p bin_relver_path %llvm_ua_anchor %llvm_tools} %{lapply -p bin_relver_path %llvm_elf_dwarf_tools} -%{lapply -p bin_relver_path %llvm_cxxabi_coff_macho_tools} +%{lapply -p bin_relver_path %llvm_abi_coff_macho_tools} %{lapply -p bin_relver_path %llvm_instrumentation_development_tools} %{lapply -p ghost_ua_bin_link %llvm_ua_anchor %llvm_tools} %{lapply -p ghost_ua_bin_link %llvm_elf_dwarf_tools} -%{lapply -p ghost_ua_bin_link %llvm_cxxabi_coff_macho_tools} +%{lapply -p ghost_ua_bin_link %llvm_abi_coff_macho_tools} %{lapply -p ghost_ua_bin_link %llvm_instrumentation_development_tools} %{lapply -p man_path %llvm_main_man} %{lapply -p man_path %llvm_aux_man} +%{lapply -p man_path %llvm_util_man} %{lapply -p man_relver_path %llvm_main_man} %{lapply -p man_relver_path %llvm_aux_man} +%{lapply -p man_relver_path %llvm_util_man} %{lapply -p ghost_ua_man_link %llvm_main_man} %{lapply -p ghost_ua_man_link %llvm_aux_man} +%{lapply -p ghost_ua_man_link %llvm_util_man} %files -n clang%{_sonum} %license CREDITS.TXT LICENSE.TXT From c5f877a9d0a131a455073008cd57a16cefbc351821792bddc7d4754da65082c8 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Wed, 24 Aug 2022 01:48:35 +0000 Subject: [PATCH 4/9] - Seems that llvm-ifs is more ABI-related than about ELF. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=31 --- llvm14.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm14.spec b/llvm14.spec index a8ac780..fc4d554 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -147,7 +147,6 @@ %global llvm_elf_dwarf_tools \ %dnl ELF tools \ llvm-cfi-verify \ - llvm-ifs \ llvm-nm \ llvm-objcopy \ llvm-objdump \ @@ -168,6 +167,7 @@ llvm-cxxdump \ llvm-cxxfilt \ llvm-cxxmap \ + llvm-ifs \ %dnl Windows/COFF \ llvm-cvtres \ llvm-dlltool \ From 64c035b70e2d3b90eb1fbc1c86684feac82060f810d4580ec718aee2a3b711bb Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Fri, 26 Aug 2022 00:27:31 +0000 Subject: [PATCH 5/9] - Replace %dnl in lists by something Leap's RPM understands. - Rename groups a bit. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=32 --- llvm14.spec | 82 +++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/llvm14.spec b/llvm14.spec index fc4d554..32dd2d2 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -121,10 +121,12 @@ # produces foo_a foo_b foo_c. %define lapply(p:) %{_lapply_rec -p %{-p*} -f %{shrink:%*}} +%define comment() %{nil} + # Due to RPMs recursion limit, we have to split the lists into portions of ≤ 20. %global llvm_ua_anchor llvm-ar %global llvm_tools \ -%dnl Optimizer, compiler, interpreter, linker \ +%{comment Optimizer, compiler, interpreter, linker} \ llc \ lli \ llvm-jitlink \ @@ -133,7 +135,7 @@ llvm-lto2 \ llvm-rtdyld \ opt \ -%dnl LLVM IR tools \ +%{comment LLVM IR tools} \ llvm-as \ llvm-bcanalyzer \ llvm-bitcode-strip \ @@ -145,7 +147,7 @@ llvm-sim \ llvm-split %global llvm_elf_dwarf_tools \ -%dnl ELF tools \ +%{comment ELF tools} \ llvm-cfi-verify \ llvm-nm \ llvm-objcopy \ @@ -155,7 +157,7 @@ llvm-readobj \ llvm-size \ llvm-strip \ -%dnl Debug info tools \ +%{comment Debug info tools} \ dsymutil \ llvm-addr2line \ llvm-debuginfod-find \ @@ -163,12 +165,12 @@ llvm-dwp \ llvm-gsymutil %global llvm_abi_coff_macho_tools \ -%dnl ABI tools \ +%{comment ABI tools} \ llvm-cxxdump \ llvm-cxxfilt \ llvm-cxxmap \ llvm-ifs \ -%dnl Windows/COFF \ +%{comment Windows/COFF} \ llvm-cvtres \ llvm-dlltool \ llvm-lib \ @@ -178,14 +180,14 @@ llvm-rc \ llvm-undname \ llvm-windres \ -%dnl Apple/Mach-O \ +%{comment Apple/Mach-O} \ llvm-install-name-tool \ llvm-libtool-darwin \ llvm-lipo \ llvm-otool \ llvm-tapi-diff -%global llvm_instrumentation_development_tools \ -%dnl Instrumentation and introspection \ +%global llvm_instr_devel_tools \ +%{comment Instrumentation and introspection} \ llvm-cov \ llvm-opt-report \ llvm-profdata \ @@ -194,7 +196,7 @@ llvm-xray \ sancov \ sanstats \ -%dnl Development utilities \ +%{comment Development utilities} \ bugpoint \ llvm-c-test \ llvm-mc \ @@ -254,28 +256,28 @@ %endif %global binfiles \ %{llvm_ua_anchor} %{llvm_tools} %{llvm_elf_dwarf_tools} \ - %{llvm_abi_coff_macho_tools} %{llvm_instrumentation_development_tools} \ + %{llvm_abi_coff_macho_tools} %{llvm_instr_devel_tools} \ %{clang_ua_anchor} %{clang_binfiles} %{clang_tools_extra_binfiles} \ %{?lld_ua_anchor} %{?lld_binfiles} %{?lldb_ua_anchor} %{?lldb_binfiles} -%global llvm_main_man \ -%dnl Optimizer, compiler, interpreter, linker \ +%global llvm_man \ +%{comment Optimizer, compiler, interpreter, linker} \ llc \ lli \ llvm-link \ opt \ -%dnl LLVM IR tools \ +%{comment LLVM IR tools} \ llvm-as \ llvm-bcanalyzer \ llvm-dis \ llvm-extract \ -%dnl Instrumentation and introspection \ +%{comment Instrumentation and introspection} \ llvm-cov \ llvm-profdata \ llvm-profgen \ llvm-symbolizer -%global llvm_aux_man \ -%dnl ELF tools \ +%global llvm_bin_utils_man \ +%{comment ELF tools} \ llvm-ar \ llvm-nm \ llvm-objcopy \ @@ -285,23 +287,23 @@ llvm-readobj \ llvm-size \ llvm-strip \ -%dnl Debug info tools \ +%{comment Debug info tools} \ dsymutil \ llvm-addr2line \ llvm-dwarfdump \ -%dnl Windows/COFF \ +%{comment Windows/COFF} \ llvm-lib \ llvm-pdbutil \ -%dnl Apple/Mach-O \ +%{comment Apple/Mach-O} \ llvm-install-name-tool \ llvm-libtool-darwin \ llvm-lipo \ llvm-otool -%global llvm_util_man \ -%dnl ABI tools \ +%global llvm_devel_utils_man \ +%{comment ABI tools} \ llvm-cxxfilt \ llvm-cxxmap \ -%dnl Development utilities \ +%{comment Development utilities} \ bugpoint \ llvm-diff \ llvm-mca \ @@ -311,7 +313,7 @@ llvm-tli-checker %global clang_manfiles clang diagtool -%global manfiles %{llvm_main_man} %{llvm_aux_man} %{llvm_util_man} %{clang_manfiles} +%global manfiles %{llvm_man} %{llvm_bin_utils_man} %{llvm_devel_utils_man} %{clang_manfiles} %define _dwz_low_mem_die_limit 40000000 %define _dwz_max_die_limit 200000000 @@ -1431,10 +1433,10 @@ fi %{lapply -p ua_bin_slave %llvm_tools} \ %{lapply -p ua_bin_slave %llvm_elf_dwarf_tools} \ %{lapply -p ua_bin_slave %llvm_abi_coff_macho_tools} \ - %{lapply -p ua_bin_slave %llvm_instrumentation_development_tools} \ - %{lapply -p ua_man_slave %llvm_main_man} \ - %{lapply -p ua_man_slave %llvm_aux_man} \ - %{lapply -p ua_man_slave %llvm_util_man} + %{lapply -p ua_bin_slave %llvm_instr_devel_tools} \ + %{lapply -p ua_man_slave %llvm_man} \ + %{lapply -p ua_man_slave %llvm_bin_utils_man} \ + %{lapply -p ua_man_slave %llvm_devel_utils_man} %postun %{ua_remove %llvm_ua_anchor} @@ -1488,25 +1490,25 @@ fi %{lapply -p bin_path %llvm_ua_anchor %llvm_tools} %{lapply -p bin_path %llvm_elf_dwarf_tools} %{lapply -p bin_path %llvm_abi_coff_macho_tools} -%{lapply -p bin_path %llvm_instrumentation_development_tools} +%{lapply -p bin_path %llvm_instr_devel_tools} %{lapply -p bin_relver_path %llvm_ua_anchor %llvm_tools} %{lapply -p bin_relver_path %llvm_elf_dwarf_tools} %{lapply -p bin_relver_path %llvm_abi_coff_macho_tools} -%{lapply -p bin_relver_path %llvm_instrumentation_development_tools} +%{lapply -p bin_relver_path %llvm_instr_devel_tools} %{lapply -p ghost_ua_bin_link %llvm_ua_anchor %llvm_tools} %{lapply -p ghost_ua_bin_link %llvm_elf_dwarf_tools} %{lapply -p ghost_ua_bin_link %llvm_abi_coff_macho_tools} -%{lapply -p ghost_ua_bin_link %llvm_instrumentation_development_tools} +%{lapply -p ghost_ua_bin_link %llvm_instr_devel_tools} -%{lapply -p man_path %llvm_main_man} -%{lapply -p man_path %llvm_aux_man} -%{lapply -p man_path %llvm_util_man} -%{lapply -p man_relver_path %llvm_main_man} -%{lapply -p man_relver_path %llvm_aux_man} -%{lapply -p man_relver_path %llvm_util_man} -%{lapply -p ghost_ua_man_link %llvm_main_man} -%{lapply -p ghost_ua_man_link %llvm_aux_man} -%{lapply -p ghost_ua_man_link %llvm_util_man} +%{lapply -p man_path %llvm_man} +%{lapply -p man_path %llvm_bin_utils_man} +%{lapply -p man_path %llvm_devel_utils_man} +%{lapply -p man_relver_path %llvm_man} +%{lapply -p man_relver_path %llvm_bin_utils_man} +%{lapply -p man_relver_path %llvm_devel_utils_man} +%{lapply -p ghost_ua_man_link %llvm_man} +%{lapply -p ghost_ua_man_link %llvm_bin_utils_man} +%{lapply -p ghost_ua_man_link %llvm_devel_utils_man} %files -n clang%{_sonum} %license CREDITS.TXT LICENSE.TXT From 4e37c37b165c1e7f68ea55997bfdc6b2e61d636ef41e177301463f5397178c89 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Fri, 26 Aug 2022 23:23:42 +0000 Subject: [PATCH 6/9] - Add llvm-lifetime-for-rust.patch to have Rust memory management functions considered as lifetime markers. This should aid dead store elimination to dynamically allocated memory in Rust code. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=33 --- llvm-lifetime-for-rust.patch | 90 ++++++++++++++++++++++++++++++++++++ llvm14.changes | 7 +++ llvm14.spec | 3 ++ 3 files changed, 100 insertions(+) create mode 100644 llvm-lifetime-for-rust.patch diff --git a/llvm-lifetime-for-rust.patch b/llvm-lifetime-for-rust.patch new file mode 100644 index 0000000..23c8c07 --- /dev/null +++ b/llvm-lifetime-for-rust.patch @@ -0,0 +1,90 @@ +From 59b1d748157ddce5f701dfcaa4fae9a553fc9775 Mon Sep 17 00:00:00 2001 +From: Simonas Kazlauskas +Date: Sat, 3 Jun 2017 18:55:08 +0300 +Subject: [PATCH] [rust] Add knowledge of __rust_{alloc,realloc,dealloc} + +--- + .../llvm/Analysis/TargetLibraryInfo.def | 13 ++++++++++++ + llvm/lib/Analysis/MemoryBuiltins.cpp | 6 +++++- + llvm/lib/Analysis/TargetLibraryInfo.cpp | 20 +++++++++++++++++++ + 3 files changed, 38 insertions(+), 1 deletion(-) + +diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +index 9c1abef33b288..70a79112ded85 100644 +--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def ++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +@@ -391,6 +391,19 @@ TLI_DEFINE_STRING_INTERNAL("__powf_finite") + /// long double __powl_finite(long double x, long double y); + TLI_DEFINE_ENUM_INTERNAL(powl_finite) + TLI_DEFINE_STRING_INTERNAL("__powl_finite") ++ ++TLI_DEFINE_ENUM_INTERNAL(rust_alloc) ++TLI_DEFINE_STRING_INTERNAL("__rust_alloc") ++ ++TLI_DEFINE_ENUM_INTERNAL(rust_alloc_zeroed) ++TLI_DEFINE_STRING_INTERNAL("__rust_alloc_zeroed") ++ ++TLI_DEFINE_ENUM_INTERNAL(rust_dealloc) ++TLI_DEFINE_STRING_INTERNAL("__rust_dealloc") ++ ++TLI_DEFINE_ENUM_INTERNAL(rust_realloc) ++TLI_DEFINE_STRING_INTERNAL("__rust_realloc") ++ + /// double __sincospi_stret(double x); + TLI_DEFINE_ENUM_INTERNAL(sincospi_stret) + TLI_DEFINE_STRING_INTERNAL("__sincospi_stret") +diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp +index 9e26f292b789a..4b08e6417ebf6 100644 +--- a/llvm/lib/Analysis/MemoryBuiltins.cpp ++++ b/llvm/lib/Analysis/MemoryBuiltins.cpp +@@ -111,6 +111,9 @@ static const std::pair AllocationFnData[] = { + {LibFunc_strdup, {StrDupLike, 1, -1, -1, -1}}, + {LibFunc_strndup, {StrDupLike, 2, 1, -1, -1}}, + {LibFunc___kmpc_alloc_shared, {MallocLike, 1, 0, -1, -1}}, ++ {LibFunc_rust_alloc, {MallocLike, 2, 0, -1, 1}}, ++ {LibFunc_rust_alloc_zeroed, {CallocLike, 2, 0, -1, 1}}, ++ {LibFunc_rust_realloc, {ReallocLike, 4, 3, -1, 2}}, + // TODO: Handle "int posix_memalign(void **, size_t, size_t)" + }; + +@@ -429,7 +432,8 @@ bool llvm::isLibFreeFunction(const Function *F, const LibFunc TLIFn) { + TLIFn == LibFunc_ZdlPvjSt11align_val_t || // delete(void*, unsigned long, align_val_t) + TLIFn == LibFunc_ZdlPvmSt11align_val_t || // delete(void*, unsigned long, align_val_t) + TLIFn == LibFunc_ZdaPvjSt11align_val_t || // delete[](void*, unsigned int, align_val_t) +- TLIFn == LibFunc_ZdaPvmSt11align_val_t) // delete[](void*, unsigned long, align_val_t) ++ TLIFn == LibFunc_ZdaPvmSt11align_val_t || // delete[](void*, unsigned long, align_val_t) ++ TLIFn == LibFunc_rust_dealloc) + ExpectedNumParams = 3; + else + return false; +diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp +index 02923c2c7eb14..22d6a5f04152a 100644 +--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp ++++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp +@@ -1793,6 +1793,26 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, + else + return false; + } ++ ++ case LibFunc_rust_alloc: ++ case LibFunc_rust_alloc_zeroed: ++ return (NumParams == 2 && FTy.getReturnType()->isPointerTy() && ++ FTy.getParamType(0)->isIntegerTy() && ++ FTy.getParamType(1)->isIntegerTy()); ++ ++ case LibFunc_rust_dealloc: ++ return (NumParams == 3 && FTy.getReturnType()->isVoidTy() && ++ FTy.getParamType(0)->isPointerTy() && ++ FTy.getParamType(1)->isIntegerTy() && ++ FTy.getParamType(2)->isIntegerTy()); ++ ++ case LibFunc_rust_realloc: ++ return (NumParams == 4 && FTy.getReturnType()->isPointerTy() && ++ FTy.getParamType(0)->isPointerTy() && ++ FTy.getParamType(1)->isIntegerTy() && ++ FTy.getParamType(2)->isIntegerTy() && ++ FTy.getParamType(3)->isIntegerTy()); ++ + case LibFunc::NumLibFuncs: + case LibFunc::NotLibFunc: + break; diff --git a/llvm14.changes b/llvm14.changes index 6a78ef3..b85f892 100644 --- a/llvm14.changes +++ b/llvm14.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Aug 26 21:18:56 UTC 2022 - Aaron Puchert + +- Add llvm-lifetime-for-rust.patch to have Rust memory management + functions considered as lifetime markers. This should aid dead + store elimination to dynamically allocated memory in Rust code. + ------------------------------------------------------------------- Tue Aug 23 21:20:47 UTC 2022 - Aaron Puchert diff --git a/llvm14.spec b/llvm14.spec index 32dd2d2..61968b1 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -344,6 +344,8 @@ Source100: %{name}-rpmlintrc Source101: baselibs.conf # PATCH-FIX-OPENSUSE lto-disable-cache.patch -- Disable ThinLTO cache Patch0: lto-disable-cache.patch +# PATCH-FIX-OPENSUSE -- Consider Rust memory management functions as lifetime markers. (From https://github.com/rust-lang/llvm-project.) +Patch1: llvm-lifetime-for-rust.patch # PATCH-FIX-OPENSUSE assume-opensuse.patch idoenmez@suse.de -- Always enable openSUSE/SUSE features Patch2: assume-opensuse.patch # PATCH-FIX-OPENSUSE default-to-i586.patch -- Use i586 as default target for 32bit @@ -790,6 +792,7 @@ This package contains the development files for Polly. %prep %setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -b 50 -b 51 -n llvm-%{_version}.src %patch0 -p2 +%patch1 -p2 %patch5 -p1 %patch13 -p1 %patch14 -p1 From 998bf98934de02a724547f4c11806208fcd57eeefec79f214e26de2bbb9960a8 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sat, 27 Aug 2022 02:07:40 +0000 Subject: [PATCH 7/9] - Try to fix test failure after llvm-lifetime-for-rust.patch. We don't care whether the PlayStation SDK has Rust functions. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=34 --- llvm-lifetime-for-rust.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/llvm-lifetime-for-rust.patch b/llvm-lifetime-for-rust.patch index 23c8c07..640a3cc 100644 --- a/llvm-lifetime-for-rust.patch +++ b/llvm-lifetime-for-rust.patch @@ -88,3 +88,23 @@ index 02923c2c7eb14..22d6a5f04152a 100644 case LibFunc::NumLibFuncs: case LibFunc::NotLibFunc: break; +diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml +index d21c2c05ff29..9ee1bb190722 100644 +--- a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml ++++ b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml +@@ -32,13 +32,13 @@ + # RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt + # RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt + # +-# CHECK: << Total TLI yes SDK no: 0 ++# CHECK: << Total TLI yes SDK no: 4 + # CHECK: >> Total TLI no SDK yes: 0 + # CHECK: == Total TLI yes SDK yes: 235 + # + # WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' aka operator delete[](void*) + # WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int) +-# WRONG_SUMMARY: << Total TLI yes SDK no: 1{{$}} ++# WRONG_SUMMARY: << Total TLI yes SDK no: 5{{$}} + # WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}} + # WRONG_SUMMARY: == Total TLI yes SDK yes: 234 + # From 636a08ee6928ff4c9d3ced9bf8040d35017cb189564b62d090ff51b171853ad0 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sat, 27 Aug 2022 10:59:28 +0000 Subject: [PATCH 8/9] - Make llvm-lifetime-for-rust.patch even more correct. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=35 --- llvm-lifetime-for-rust.patch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm-lifetime-for-rust.patch b/llvm-lifetime-for-rust.patch index 640a3cc..f0f44a9 100644 --- a/llvm-lifetime-for-rust.patch +++ b/llvm-lifetime-for-rust.patch @@ -89,10 +89,10 @@ index 02923c2c7eb14..22d6a5f04152a 100644 case LibFunc::NotLibFunc: break; diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml -index d21c2c05ff29..9ee1bb190722 100644 +index d21c2c05ff29..39d3b267daf6 100644 --- a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml +++ b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml -@@ -32,13 +32,13 @@ +@@ -32,13 +32,17 @@ # RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt # RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt # @@ -104,6 +104,10 @@ index d21c2c05ff29..9ee1bb190722 100644 # WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' aka operator delete[](void*) # WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int) -# WRONG_SUMMARY: << Total TLI yes SDK no: 1{{$}} ++# WRONG_DETAIL: << TLI yes SDK no : '__rust_alloc' ++# WRONG_DETAIL: << TLI yes SDK no : '__rust_alloc_zeroed' ++# WRONG_DETAIL: << TLI yes SDK no : '__rust_dealloc' ++# WRONG_DETAIL: << TLI yes SDK no : '__rust_realloc' +# WRONG_SUMMARY: << Total TLI yes SDK no: 5{{$}} # WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}} # WRONG_SUMMARY: == Total TLI yes SDK yes: 234 From 111d72ecd8fbfd8097b37fb14b3c3d61dcf1243869b5201603bb5802b8c3c87c Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sat, 27 Aug 2022 14:49:23 +0000 Subject: [PATCH 9/9] - More changes to llvm-lifetime-for-rust.patch. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm14?expand=0&rev=36 --- llvm-lifetime-for-rust.patch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/llvm-lifetime-for-rust.patch b/llvm-lifetime-for-rust.patch index f0f44a9..dec3b65 100644 --- a/llvm-lifetime-for-rust.patch +++ b/llvm-lifetime-for-rust.patch @@ -89,7 +89,7 @@ index 02923c2c7eb14..22d6a5f04152a 100644 case LibFunc::NotLibFunc: break; diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml -index d21c2c05ff29..39d3b267daf6 100644 +index d21c2c05ff29..807f746b4460 100644 --- a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml +++ b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml @@ -32,13 +32,17 @@ @@ -112,3 +112,14 @@ index d21c2c05ff29..39d3b267daf6 100644 # WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}} # WRONG_SUMMARY: == Total TLI yes SDK yes: 234 # +@@ -46,8 +50,8 @@ + ## the exact count first; the two directives should add up to that. + ## Yes, this means additions to TLI will fail this test, but the argument + ## to -COUNT can't be an expression. +-# AVAIL: TLI knows 468 symbols, 235 available +-# AVAIL-COUNT-235: {{^}} available ++# AVAIL: TLI knows 472 symbols, 239 available ++# AVAIL-COUNT-239: {{^}} available + # AVAIL-NOT: {{^}} available + # UNAVAIL-COUNT-233: not available + # UNAVAIL-NOT: not available