From f60d81e883a685a3d233a3f3f28fbd0a654fe7c2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sun, 5 Jun 2022 20:50:24 +0200 Subject: [PATCH] Add support for systemd-binfmt Closes: #1012367 --- debian/control | 2 +- debian/llvm-X.Y-runtime.binfmt.conf.in | 1 + debian/llvm-X.Y-runtime.install.in | 1 + debian/qualify-clang.sh | 4 +--- debian/tests/control | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 debian/llvm-X.Y-runtime.binfmt.conf.in diff --git a/debian/control b/debian/control index 1edbbffd..2e8c53da 100644 --- a/debian/control +++ b/debian/control @@ -340,7 +340,7 @@ Description: Modular compiler and toolchain technologies Package: llvm-13-runtime Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Recommends: binfmt-support +Recommends: binfmt-support | systemd Description: Modular compiler and toolchain technologies, IR interpreter LLVM is a collection of libraries and tools that make it easy to build compilers, optimizers, just-in-time code generators, and many other diff --git a/debian/llvm-X.Y-runtime.binfmt.conf.in b/debian/llvm-X.Y-runtime.binfmt.conf.in new file mode 100644 index 00000000..9f712796 --- /dev/null +++ b/debian/llvm-X.Y-runtime.binfmt.conf.in @@ -0,0 +1 @@ +:llvm-@LLVM_VERSION@-runtime.binfmt:M::BC::/usr/bin/lli-@LLVM_VERSION@: diff --git a/debian/llvm-X.Y-runtime.install.in b/debian/llvm-X.Y-runtime.install.in index d8e16a7c..fde07b98 100644 --- a/debian/llvm-X.Y-runtime.install.in +++ b/debian/llvm-X.Y-runtime.install.in @@ -5,4 +5,5 @@ usr/bin/lli-@LLVM_VERSION@ usr/bin/lli-child-target-@LLVM_VERSION@ debian/llvm-@LLVM_VERSION@-runtime.binfmt usr/share/binfmts/ +debian/llvm-@LLVM_VERSION@-runtime.binfmt.conf usr/lib/binfmt.d/ diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 4d9bc2df..68a25373 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -305,9 +305,7 @@ fi clang-$VERSION -O3 -emit-llvm foo.c -c -o foo.bc chmod +x foo.bc # only run if the binfmt is installed correctly -/usr/sbin/update-binfmts --display llvm-$VERSION-runtime.binfmt &> foo.log || true -if grep -q "interpreter = /usr/bin/lli-" foo.log; then - /usr/sbin/update-binfmts --enable llvm-$VERSION-runtime.binfmt || true +if grep -q "enabled" /proc/sys/fs/binfmt_misc/llvm-${VERSION}-runtime.binfmt; then if ! ./foo.bc|grep -q "lli foo"; then echo "executing ./foo.bc failed" ./foo.bc || true diff --git a/debian/tests/control b/debian/tests/control index 6bff47a6..cf51af18 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,5 +1,5 @@ Test-Command: bash -v ./debian/qualify-clang.sh -Depends: @, cmake, make, g++, file, dpkg-dev, binfmt-support +Depends: @, cmake, make, g++, file, dpkg-dev # Comment the dbgsym package because of bug #917528 # dbgsym packages not being available in testing # clang-13-dbgsym, libclang1-13-dbgsym