diff --git a/debian/changelog b/debian/changelog index 1e63c373..3ee93d66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -275,6 +275,8 @@ llvm-toolchain-13 (1:13.0.1~+rc1-1~exp2) experimental; urgency=medium * Fix run-clang-tidy symlink. it moved from /usr/lib/llvm-13/share/clang/run-clang-tidy to /usr/lib/llvm-13/bin/run-clang-tidy (Closes: #1001748) + * Install LLVMgold in usr/lib/bfd-plugins to help various tools to understand the + format (Closes: #919020) -- Sylvestre Ledru Thu, 16 Dec 2021 14:28:09 +0100 diff --git a/debian/llvm-X.Y-linker-tools.links.in b/debian/llvm-X.Y-linker-tools.links.in new file mode 100644 index 00000000..507baf4c --- /dev/null +++ b/debian/llvm-X.Y-linker-tools.links.in @@ -0,0 +1,3 @@ +#!/usr/bin/dh-exec + +[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/LLVMgold.so usr/lib/bfd-plugins diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 3197f7f3..f4ed98ae 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -522,6 +522,15 @@ clang-$VERSION -flto=thin -O2 foo.c main.c -o foo ./foo > /dev/null clang-$VERSION -flto=thin -O2 foo.c main.c -c +# understand LTO files +# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919020 +clang-$VERSION foo.c -flto -c +file foo.o|grep -q "LLVM IR bitcode" +if ! nm foo.o|grep -q "00000000 T foo"; then + echo "gold linker isn't understood" + exit 1 +fi + echo "Testing lld-$VERSION ..." if test ! -f /usr/bin/lld-$VERSION; then @@ -531,7 +540,7 @@ fi clang-$VERSION -fuse-ld=lld -O2 foo.c main.c -o foo ./foo > /dev/null -if ls -al1 /usr/bin/ld.lld|grep ld.lld-$VERSION; then +if ls -al1 /usr/bin/ld.lld|grep -q ld.lld-$VERSION; then # https://bugs.llvm.org/show_bug.cgi?id=40659 # -fuse-ld=lld will call lld # Mismatch of version can fail the check diff --git a/debian/rules b/debian/rules index affecb47..c847ac2a 100755 --- a/debian/rules +++ b/debian/rules @@ -427,7 +427,8 @@ preconfigure: debian/libclang-common-$(LLVM_VERSION)-dev.install \ debian/libomp-$(LLVM_VERSION)-dev.install \ debian/llvm-$(LLVM_VERSION)-dev.install \ - debian/llvm-$(LLVM_VERSION)-linker-tools.install + debian/llvm-$(LLVM_VERSION)-linker-tools.install \ + debian/llvm-$(LLVM_VERSION)-linker-tools.links # workaround the breaks/replaces/conflicts introduced with the omp-device-info move # we update the version to make it work with apt.llvm.org