add more checks in the script

This commit is contained in:
Sylvestre Ledru 2022-10-11 11:22:31 +02:00
parent a235abc1ef
commit 71e2f5a23e
2 changed files with 18 additions and 4 deletions

View File

@ -1,10 +1,25 @@
#!/usr/bin/bash -eu
# Initial version:
# https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/brp-llvm-compile-lto-elf
# https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/brp-llvm-compile-lto-elf
CLANG_FLAGS=$@
if test -z $P_TO_LLVM; then
echo "P_TO_LLVM isn't set"
exit 1
fi
if test -z $NJOBS; then
echo "NJOBS isn't set"
exit 1
fi
if test -z $VERSION; then
echo "VERSION isn't set"
exit 1
fi
NCPUS=$NJOBS
check_convert_bitcode () {
@ -40,6 +55,5 @@ check_convert_bitcode () {
echo "Checking for LLVM bitcode artifacts"
export -f check_convert_bitcode
export P
find "${P_TO_LLVM}/debian/" -type f -name "*.[ao]" -print0 | \
find "$P_TO_LLVM/debian/" -type f -name "*.[ao]" -print0 | \
xargs -0 -r -n1 -P$NCPUS bash -c "check_convert_bitcode \$@ $CLANG_FLAGS" ARG0

2
debian/rules vendored
View File

@ -823,7 +823,7 @@ override_dh_auto_install:
ifeq (${LTO_ENABLE},yes)
# with LTO, .a contains llvm ir instead of native code. So, recompile them
NJOBS="$(NJOBS)" P_TO_LLVM="$(CURDIR)" VERSION=$(LLVM_VERSION) bash debian/llvm-compile-lto-elf.sh $(CXXFLAGS_EXTRA)
NJOBS="$(NJOBS)" P_TO_LLVM="$(CURDIR)" VERSION=$(LLVM_VERSION) bash -v debian/llvm-compile-lto-elf.sh $(CXXFLAGS_EXTRA)
endif
# install/fast enables a make install without recompiling temporary files