diff --git a/debian/llvm-compile-lto-elf.sh b/debian/llvm-compile-lto-elf.sh index c585f5e4..d0ae0ca3 100644 --- a/debian/llvm-compile-lto-elf.sh +++ b/debian/llvm-compile-lto-elf.sh @@ -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 diff --git a/debian/rules b/debian/rules index 74e0c3b0..7121da5f 100755 --- a/debian/rules +++ b/debian/rules @@ -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