On Mon, Jan 11, 2021 at 05:09:45PM +0100, Konstantin Lepikhov wrote: > Hi Arseny! > > On 01/08/2021, at 12:18:41 AM you wrote: > > УМВР. Может, мой почтовый клиент сломал ссылку или ваш не так показал? > > > > Прикладываю файлом. > > > diff --git a/llvm11.spec b/llvm11.spec <...> > > +%global v_major 11 > > +%global v_majmin %v_major.0 > > +%global v_full %v_majmin.0 > > +%global rcsuffix %nil > а так ли нужны все эти приседания с версиями и rc? У нас же не daily > builds собираются. До поры до времени. Начинать готовить адаптацию спека лучше с каких-то достаточно поздних rc, особенно в случае, когда после выхода времени у мейнтейнера мало, а чуть раньше — много. > > > +%global llvm_name llvm%v_majmin > > +%global clang_name clang%v_majmin > > +%global clangd_name clangd%v_majmin > > +%global lld_name lld%v_majmin > т.е. планируется собирать раздельные версии clang/llvm/lld? не в рамках одного исходного пакета. <...> > > %def_disable tests > > %ifarch x86_64 aarch64 > > %def_without clang > почему? without_clang используется только если у нас bootstrap. Иначе > будет сборка без LTO. Внимательно посмотрите changelog и архив. Одна из возможных причин: http://git.altlinux.org/people/arseny/packages/?p=llvm11.0.git;a=commit;h=4b3c6c13e4d70fd201691c636d57b5b020e00709 Надо думать, что с этим делать. > > > @@ -18,44 +39,62 @@ > > %def_without clang > > %endif > > > > +%define tarversion %v_full%rcsuffix > > + > > Name: %llvm_name > > -Version: 11.0.0 > > -Release: alt1 > > -Summary: The Low Level Virtual Machine > > +Version: %v_full > > +Release: alt2 > > +Summary: The LLVM Compiler Infrastructure <...> > > %package libs > > Group: Development/C > > Summary: LLVM shared libraries > > +%requires_filesystem > > > > %description libs > > -Shared libraries for the LLVM compiler infrastructure. > > +This package contains shared libraries needed to develop new > > +native programs that use LLVM. > ? разве тут что-то неверно? старый description был слишком неточным и подходил к нескольким бинарным пакетам. > > > > > %package doc > > Summary: Documentation for LLVM > > Group: Documentation <...> > > > > %build > > +%define _cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=OFF > > %cmake -G Ninja \ > > -DLLVM_PARALLEL_LINK_JOBS=1 \ > > -DCMAKE_BUILD_TYPE=Release \ > > + -DCMAKE_INSTALL_PREFIX=%llvm_prefix \ > > + -DCMAKE_SKIP_INSTALL_RPATH:BOOL=OFF \ > > -DBUILD_SHARED_LIBS:BOOL=OFF \ > > - -DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF;NVPTX;" \ > > + -DLLVM_TARGETS_TO_BUILD="all" \ > Почему нам нужны все TARGETS? Я скоро буду собирать пакеты, которые этим будут пользоваться. Ну, и для "clang -target aarch64-unknown-linux-gnu" какого-нибудь. > > > -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='AVR' \ > > -DLLVM_ENABLE_LIBCXX:BOOL=OFF \ > > -DLLVM_ENABLE_ZLIB:BOOL=ON \ > > @@ -287,13 +395,13 @@ ninja -vvv -j %__nprocs -C BUILD > > > > %install > > pushd BUILD > > -cmake -DCMAKE_INSTALL_PREFIX=%buildroot%prefix ../ > > +cmake -DCMAKE_INSTALL_PREFIX=%buildroot%llvm_prefix ../ > > sed -i 's|man\ tools/lld/docs/docs-lld-html|man|' build.ninja > > sed -i '/^[[:space:]]*include.*tools\/lld\/docs\/cmake_install.cmake.*/d' tools/lld/cmake_install.cmake > > popd > > ninja -C BUILD install > > > > -# And prepare Clang documentation > > +# Prepare Clang documentation. > > rm -rf BUILD/clang-docs > > mkdir -p BUILD/clang-docs > > for f in LICENSE.TXT NOTES.txt README.txt; do > > @@ -301,113 +409,295 @@ for f in LICENSE.TXT NOTES.txt README.txt; do > > done > > rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools} > > > > -install -m 0755 BUILD/%_lib/LLVMHello.so %buildroot%_libdir/ > > -install -m 0755 BUILD/%_lib/BugpointPasses.so %buildroot%_libdir/ > > -mkdir -p %buildroot%_docdir/lld > > - > > -file %buildroot%_bindir/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d > > -file %buildroot%_libdir/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d > > +install -m 0755 BUILD/%_lib/LLVMHello.so %buildroot%llvm_libdir/ > > +install -m 0755 BUILD/%_lib/BugpointPasses.so %buildroot%llvm_libdir/ > > +mkdir -p %buildroot%llvm_docdir/lld > > > > %ifarch %ix86 > > -cd %buildroot%_libdir/clang/%version/lib/linux > > +cd %buildroot%llvm_libdir/clang/%v_full/lib/linux > > ls *-i[3-9]86* | while read f; do ln -s $f $(echo $f | sed 's|i[3-9]86|i386|') ; done > > %endif > > > > +# The following files are not used by LLVM builds for Linux. > > +rm -f %buildroot%llvm_bindir/argdumper > > +rm -f %buildroot%llvm_datadir/clang/clang-format-bbedit.applescript > > + > > +# Install the clang bash completion. > > +mkdir -p %buildroot%_datadir/bash-completion/completions > > +ln -sr %buildroot%llvm_datadir/clang/bash-autocomplete.sh %buildroot%_datadir/bash-completion/completions/clang-%v_major > > + > > +# Symlink executables to %_bindir. > > +mkdir -p %buildroot%_bindir > > +for b in %buildroot%llvm_bindir/*; do > > + bb="$(basename "$b")" > > + echo "$bb" | grep -q -- '-%v_major$' && continue # if already appended > > + ln -srv "$b" "%buildroot%_bindir/$bb-%v_major" > > +done Вот тут написано, почему man1dir не лишний: > > +# Symlink man pages to the man dirs. > > +for mand in %buildroot%llvm_datadir/man/man*; do > > + mand_index="${mand##*/man}" > > + for m in "$mand"/*.[1-9]*; do > > + # Let's force compress the man page, then symlink it. > > + # /usr/lib/llvm-11.0/share/man/manD/utilX.D.xz -> /usr/share/man/manD/utilX-11.D.xz > > + # Otherwise, brp-alt(compress) keeps fucking us up. > > + # It remakes the symlinks first, then compresses their targets, > > + # severing the symlinks. > > + /usr/lib/rpm/compress_files "$m" > > + > > + mb="$(basename "$m")" # e. g. llvm-ar.1.xz > > + new_mb="${mb%%.[1-9]*}-%v_major.$mand_index" # e. g. llvm-ar-11.1.xz > > + > > + mkdir -p "%buildroot%_mandir/man$mand_index" > > + ln -srv "$m" "%buildroot%_mandir/man$mand_index/$new_mb" > > + done > > +done > > + > > +# Symlink sonamed shared libraries in %llvm_prefix/%_libdir to %_libdir. > > +mkdir -p %buildroot%_libdir > > +find %buildroot%llvm_libdir/*.so* -type f | grep -E '^%buildroot%llvm_libdir/.*(%v_major)' | sort | tee %_tmppath/shared-objects \ > > + | sed 's)%llvm_libdir)%_libdir)' > %_tmppath/shared-object-links > > +paste %_tmppath/shared-objects %_tmppath/shared-object-links | while read object link; do > > + ln -srv "$object" "$link" > > +done > > + > > +# List all packaged binaries in this source package. > > +find %buildroot%_bindir/*-%v_major > %_tmppath/PATH-executables > > + > > +# For paranoic reasons library packaging policy covers peculiar directory paths. > > +# If there are $A.a and $A.so in %llvm_libdir/clang, they should not end up in the > > +# same package (but can be co-installed on a system). > > +# Let's list all the $A.so for which $A.a exists into a separate package. > > +# We also consider i386-symlinks for iN86. > > +find %buildroot%llvm_libdir/clang -type f,l -name '*.a' -or -name '*.so' | \ > > + sed -r -n 's/^(\/.+)\.a$/\1/p; s/^(.+)\.so$/\1/p' | sort | uniq -d > %_tmppath/libclang-support-dupes > > +sed < %_tmppath/libclang-support-dupes 's)^%buildroot)); s/$/.a/' > %_tmppath/libclang-support-static-runtimes > > +sed < %_tmppath/libclang-support-dupes 's)^%buildroot)); s/$/.so/' > %_tmppath/libclang-support-shared-runtimes > > +sed < %_tmppath/libclang-support-shared-runtimes 's/^/%%exclude /' > %_tmppath/dyn-files-libclang-support > > +echo "Expelling likely redundant Clang shared runtimes:" && cat %_tmppath/dyn-files-libclang-support > > + > > %check > > %if_enabled tests > > -LD_LIBRARY_PATH=%buildroot%_libdir:$LD_LIBRARY_PATH > > +LD_LIBRARY_PATH=%buildroot%llvm_libdir:$LD_LIBRARY_PATH > > export LD_LIBRARY_PATH > > ninja -C BUILD check-all || : > > %endif > > > > +# Do not generate dependencies for clang-{format,rename} plugins. > > +%add_findreq_skiplist %llvm_datadir/clang/* > > + > > +%files filesystem > > +%dir %llvm_prefix > > +%dir %llvm_bindir > > +%dir %llvm_libdir > > +%dir %llvm_includedir > > +%dir %llvm_libexecdir > > +%dir %llvm_datadir > > +%dir %llvm_datadir/clang > > +%dir %llvm_datadir/man > > +%dir %llvm_man1dir > > +%dir %llvm_docdir > > + > > %files > > %doc CREDITS.TXT LICENSE.TXT README.txt > > +%llvm_bindir/* > > %_bindir/* > > +%llvm_man1dir/* > > %_man1dir/* > %_man1dir/* - лишний man не смотрит в llvm_man1dir. Заморочиться и научить — вариант хуже, чем текущий, потому что программе man надо ещё ман от правильной версии достать. > > > +%exclude %llvm_bindir/llvm-config* > > %exclude %_bindir/llvm-config* > > +%exclude %llvm_bindir/*clang* > > %exclude %_bindir/*clang* > > -%exclude %_bindir/c-index-test > > +%exclude %llvm_bindir/*clangd* > > +%exclude %_bindir/*clangd* > > +%exclude %llvm_bindir/c-index-test > > +%exclude %_bindir/c-index-test-%v_major > > +%exclude %llvm_bindir/find-all-symbols > > +%exclude %_bindir/find-all-symbols-%v_major > > +%exclude %llvm_bindir/scan-* > > %exclude %_bindir/scan-* > > -%exclude %_man1dir/llvm-config.1.* > > -%exclude %_man1dir/clang.1* > > -%exclude %_man1dir/scan-build.1* > > +%exclude %llvm_man1dir/llvm-config.1.* > > +%exclude %_man1dir/llvm-config-%v_major.1.* > > +%exclude %llvm_man1dir/clang.1* > > +%exclude %_man1dir/clang-%v_major.1* > > +%exclude %llvm_man1dir/scan-build.1* > > +%exclude %_man1dir/scan-build-%v_major.1* > > +%exclude %llvm_bindir/lld* > > %exclude %_bindir/lld* > > -%exclude %_bindir/ld*.lld > > -%exclude %_bindir/wasm-ld > > +%exclude %llvm_bindir/ld*.lld > > +%exclude %_bindir/ld*.lld-%v_major > > +%exclude %llvm_bindir/wasm-ld > > +%exclude %_bindir/wasm-ld-%v_major > > <...>