Commit c476030a authored by Niko Tyni's avatar Niko Tyni

Restore SIGUNUSED on glibc >= 2.26 to preserve ABI compatibility

SIGUNUSED is a long deprecated alias to SIGSYS that was removed in
glibc 2.26. Unfortunately the Perl ABI contains arrays of signal names
and numbers of length SIG_SIZE.  If an XS module is built with an older
glibc but Perl has been rebuilt, the XS module can iterate these arrays
out of bounds because it has a bigger SIG_SIZE compiled in.

The list of architectures needing this was gathered from the
debian/cross/*/config.sh.static files. SIGUNUSED is 31 (=SIGSYS) on all
of these architectures, so we hardcode that.

Closes: #875927
parent 3e2a41d6
......@@ -55,14 +55,30 @@ perladmin=root@localhost
mydomain=
myhostname=localhost
host_arch=${DEB_HOST_ARCH:-$(dpkg-architecture -qDEB_HOST_ARCH)}
# re-add SIGUNUSED for the 5.26 series to keep binary compatibility
# regardless of glibc 2.26 changes
# see #875927
if [ "$api_version" = "26" ] && ! echo "$sig_name" | grep -q UNUSED; then
case "$host_arch" in
amd64|arm64|armel|armhf|hppa|i386|m68k|powerpc|powerpcspe|ppc64|ppc64el|s390x|sh4|x32)
sig_name="${sig_name}UNUSED "
sig_name_init=$(echo ${sig_name_init} | sed 's#, 0#, "UNUSED", 0#')
sig_num="${sig_num}31 "
sig_num_init=$(echo ${sig_num_init} | sed 's#, 0#, 31, 0#')
sig_size=$(expr $sig_size + 1)
;;
esac
fi
# emulate 'uname -m' output for reproducibility regardless of (for example)
# 32-bit vs 64-bit kernel
#
# this is silly but oh well
# see #821182
host_arch=${DEB_HOST_ARCH:-$(dpkg-architecture -qDEB_HOST_ARCH)}
case "$host_arch" in
# hardcoded machine names on known architectures based on debian/cross results
alpha)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment