From 3ff4033fef72b14c7739fa39cd5883ed5fa89afb Mon Sep 17 00:00:00 2001 From: "Z. Liu" Date: Tue, 3 Nov 2026 23:37:46 +0800 Subject: [PATCH] sys-cluster/ceph: fix exec format error on musl see patch for details Signed-off-by: Z. Liu Part-of: https://codeberg.org/gentoo/gentoo/pulls/2309 Signed-off-by: Sam James --- sys-cluster/ceph/ceph-20.1.1-r1.ebuild | 1 + sys-cluster/ceph/ceph-20.2.1-r5.ebuild | 1 + sys-cluster/ceph/ceph-20.2.4-r3.ebuild | 1 + sys-cluster/ceph/ceph-20.2.5.ebuild | 1 + .../ceph-20.1.1-qatlib-autogen-shebang.patch | 50 +++++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 sys-cluster/ceph/files/ceph-20.1.1-qatlib-autogen-shebang.patch diff --git a/sys-cluster/ceph/ceph-20.1.1-r1.ebuild b/sys-cluster/ceph/ceph-20.1.1-r1.ebuild index b1f236c298a45..6b2aca5191d57 100644 --- a/sys-cluster/ceph/ceph-20.1.1-r1.ebuild +++ b/sys-cluster/ceph/ceph-20.1.1-r1.ebuild @@ -242,6 +242,7 @@ PATCHES=( "${FILESDIR}/ceph-20.1.1-rgw-driver-d4n-d4n_directory-use-auto-instead-of-std.patch" "${FILESDIR}/ceph-20.1.1-rgw-cast-time-spans-to-ceph-timespan-before-adding.patch" "${FILESDIR}/ceph-20.1.1-common-io_exerciser-add-missing-includes.patch" + "${FILESDIR}/ceph-20.1.1-qatlib-autogen-shebang.patch" ) check-reqs_export_vars() { diff --git a/sys-cluster/ceph/ceph-20.2.1-r5.ebuild b/sys-cluster/ceph/ceph-20.2.1-r5.ebuild index 6ed32a706a303..d133e0f5754a8 100644 --- a/sys-cluster/ceph/ceph-20.2.1-r5.ebuild +++ b/sys-cluster/ceph/ceph-20.2.1-r5.ebuild @@ -236,6 +236,7 @@ PATCHES=( "${FILESDIR}/ceph-20.2.1-clang++-libcxx.patch" "${FILESDIR}/ceph-20.2.1-qatzip-werror.patch" "${FILESDIR}/ceph-20.1.1-build-add-Mold-linker-compatibility.patch" + "${FILESDIR}/ceph-20.1.1-qatlib-autogen-shebang.patch" ) check-reqs_export_vars() { diff --git a/sys-cluster/ceph/ceph-20.2.4-r3.ebuild b/sys-cluster/ceph/ceph-20.2.4-r3.ebuild index bd1da4d3dffb9..19733fe9eb5ec 100644 --- a/sys-cluster/ceph/ceph-20.2.4-r3.ebuild +++ b/sys-cluster/ceph/ceph-20.2.4-r3.ebuild @@ -238,6 +238,7 @@ PATCHES=( "${FILESDIR}/ceph-20.2.4-clang++-libcxx.patch" "${FILESDIR}/ceph-20.2.1-qatzip-werror.patch" "${FILESDIR}/ceph-20.1.1-build-add-Mold-linker-compatibility.patch" + "${FILESDIR}/ceph-20.1.1-qatlib-autogen-shebang.patch" ) check-reqs_export_vars() { diff --git a/sys-cluster/ceph/ceph-20.2.5.ebuild b/sys-cluster/ceph/ceph-20.2.5.ebuild index 692e1d7d9e0a6..83594701485ae 100644 --- a/sys-cluster/ceph/ceph-20.2.5.ebuild +++ b/sys-cluster/ceph/ceph-20.2.5.ebuild @@ -239,6 +239,7 @@ PATCHES=( "${FILESDIR}/ceph-20.2.4-clang++-libcxx.patch" "${FILESDIR}/ceph-20.2.1-qatzip-werror.patch" "${FILESDIR}/ceph-20.1.1-build-add-Mold-linker-compatibility.patch" + "${FILESDIR}/ceph-20.1.1-qatlib-autogen-shebang.patch" ) check-reqs_export_vars() { diff --git a/sys-cluster/ceph/files/ceph-20.1.1-qatlib-autogen-shebang.patch b/sys-cluster/ceph/files/ceph-20.1.1-qatlib-autogen-shebang.patch new file mode 100644 index 0000000000000..1d6fcacbe0e87 --- /dev/null +++ b/sys-cluster/ceph/files/ceph-20.1.1-qatlib-autogen-shebang.patch @@ -0,0 +1,50 @@ +qatlib's and qatzip's autogen.sh have the license comment before the +shebang line. As a result, the kernel returns ENOEXEC when these +scripts are executed directly. + +glibc's execvp() handles ENOEXEC by falling back to /bin/sh, while +musl's execvp() does not. +Consequently, CMake's execute_process() fails with an "Exec format +error" on musl: + + CMake Error at .../qatlib_ext-stamp/qatlib_ext-configure-RelWithDebInfo-impl.cmake:9 (message): + Command failed (exec format error): + + './autogen.sh' + +Move the shebang to the beginning of both scripts so they can be +executed directly regardless of the libc implementation. + +See also: + https://www.openwall.com/lists/musl/2020/02/12/9 + +--- a/src/qatlib/autogen.sh 2026-10-22 10:33:17.310734773 +0000 ++++ b/src/qatlib/autogen.sh 2026-10-22 10:33:19.846777880 +0000 +@@ -1,3 +1,5 @@ ++#!/bin/sh ++ + ################################################################# + # + # BSD LICENSE +@@ -33,6 +35,4 @@ + # + # + ################################################################# +-#!/bin/sh +- + autoreconf -if +--- a/src/qatzip/autogen.sh ++++ b/src/qatzip/autogen.sh +@@ -1,3 +1,5 @@ ++#!/bin/sh ++ + ################################################################ + # BSD LICENSE + # +@@ -31,6 +33,5 @@ + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + ################################################################ +-#!/bin/sh + mkdir -p m4 + autoreconf -vif