sys-cluster/ceph: fix exec format error on musl

see patch for details

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/2309
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Z. Liu
2026-11-07 05:11:28 +00:00
committed by Sam James
parent 108031b8cb
commit 3ff4033fef
5 changed files with 54 additions and 0 deletions
+1
View File
@@ -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() {
+1
View File
@@ -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() {
+1
View File
@@ -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() {
+1
View File
@@ -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() {
@@ -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