Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932176 - =dev-lang/perl-5.38.2-r3 =net-dns/libidn2-2.3.7 binaries handshake mismatch on x86
Summary: =dev-lang/perl-5.38.2-r3 =net-dns/libidn2-2.3.7 binaries handshake mismatch o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal critical with 1 vote (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-19 06:56 UTC by Alix
Modified: 2024-05-25 07:35 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alix 2024-05-19 06:56:56 UTC
On clean install of stage3-i686-openrc-20240513T170400Z.tar.xz perl modules depending on libidn2 don't work with handshake mismatch error:

loadable library and perl binaries are mismatched (got first handshake key 0x8b00000, needed 0x8b80000)

The problem seems to be specific to x86 arch.

There may be more handshake errors with other libs I haven't discovered them yet.

Relevant report: https://forums.gentoo.org/viewtopic-p-8827183.html

Reproducible: Always

Steps to Reproduce:
1. new install of stage3-i686-openrc-20240513T170400Z.tar.xz
2. emerge dev-perl/Net-DNS 
3. perl -e "use Net::DNS"
Actual Results:  
lib/Net/LibIDN2.c: loadable library and perl binaries are mismatched (got first handshake key 0x8b00000, needed 0x8b80000)


Portage 3.0.63 (python 3.11.9-final-0, default/linux/x86/23.0/i686, gcc-13, glibc-2.38-r13, 6.1.57-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-6.1.57-gentoo-x86_64-x86_64-AMD_Ryzen_5_5600X_6-Core_Processor-with-glibc2.38
KiB Mem:     3973588 total,    821860 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 19 May 2024 00:45:00 +0000
Head commit of repository gentoo: 0b33f4202e7726d452e9038171f0fcc11e2dbfba
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-build/autoconf:        2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.0-r1::gentoo
dev-lang/perl:             5.38.2-r3::gentoo
dev-lang/python:           3.11.9::gentoo, 3.12.3::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             13.2.1_p20240210::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r13::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 3
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/x86/binpackages/23.0/i686

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="acl bzip2 crypt gdbm iconv ipv6 libtirpc ncurses nls openmp pam pcre readline seccomp ssl test-rust unicode x86 xattr zlib" ABI_X86="32" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx sse" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-20 00:08:41 UTC
Could you share perl -V? Also, for future reference, please always enter 32-bit chroots on a 64-bit cpu with linux32/setarch.
Comment 3 Alix 2024-05-20 03:31:02 UTC
re "setarch i686 chroot ..." - noted. The actual problem for me happened on 32 bit host in 32 bit lxc container, but I figured that clean stage is the simplest way of illustrating the issue.


perl -V of stage3-i686-openrc-20240513T170400Z.tar.xz:

Summary of my perl5 (revision 5 version 38 subversion 2) configuration:
   
  Platform:
    osname=linux
    osvers=6.6.13-gentoo-dist
    archname=i686-linux
    uname='linux localhost 6.6.13-gentoo-dist #1 smp preempt_dynamic sat jan 20 14:30:33 -00 2024 i686 amd ryzen 9 7950x3d 16-core processor authenticamd gnulinux '
    config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Ui_xlocale -Ui_ndbm -Di_gdbm -Ui_db -DDEBUGGING=none -Dnoextensions=ODBM_File -Duseshrplib -Darchname=i686-linux -Dar=i686-pc-linux-gnu-ar -Dcc=i686-pc-linux-gnu-gcc -Dcpp=i686-pc-linux-gnu-gcc -E -Dnm=i686-pc-linux-gnu-nm -Dranlib=i686-pc-linux-gnu-ranlib -Accflags=-O2 -march=i686 -pipe -fno-strict-aliasing -DNO_PERL_RAND_SEED -Doptimize=-O2 -march=i686 -pipe -fno-strict-aliasing -Dldflags=-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib/perl5/5.38 -Darchlib=/usr/lib/perl5/5.38/i686-linux -Dsitelib=/usr/local/lib/perl5/5.38 -Dsitearch=/usr/local/lib/perl5/5.38/i686-linux -Dvendorlib=/usr/lib/perl5/vendor_perl/5.38 -Dvendorarch=/usr/lib/perl5/vendor_perl/5.38/i686-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.38.2 -Dlocincpth=/usr/include  -Dglibpth=/lib /usr/lib  -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=undef
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='i686-pc-linux-gnu-gcc'
    ccflags ='-O2 -march=i686 -pipe -fno-strict-aliasing -DNO_PERL_RAND_SEED -fwrapv -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2 -march=i686 -pipe -fno-strict-aliasing'
    cppflags='-O2 -march=i686 -pipe -fno-strict-aliasing -DNO_PERL_RAND_SEED -fwrapv'
    ccversion=''
    gccversion='13.2.1 20240210'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=1234
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=12
    longdblkind=3
    ivtype='long'
    ivsize=4
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=4
    prototype=define
  Linker and Libraries:
    ld='i686-pc-linux-gnu-gcc'
    ldflags ='-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs'
    libpth=/usr/lib
    libs=-lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-ldl -lm -lcrypt -lutil -lc
    libc=/lib/../lib/libc.so.6
    so=so
    useshrplib=true
    libperl=libperl.so.5.38.2
    gnulibc_version='2.38'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -march=i686 -pipe -fno-strict-aliasing -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_LONG_DOUBLE
    HAS_STRTOLD
    HAS_TIMES
    NO_PERL_RAND_SEED
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_ZAPHOD32
    PERL_HASH_USE_SBOX32
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Locally applied patches:
    0001-Fix-hpux-hints.patch
    - Fix hpux hints
    0002-aix-gcc-detection-and-shared-library-soname-support.patch
    - aix gcc detection and shared library soname support
    0003-cpan-ExtUtils-MakeMaker-drop-PORTAGE_TMPDIR-from-LD_.patch
    - cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH
    - Bug: https://bugs.gentoo.org/105054
    0004-Remove-rpath-and-append-LDFLAGS-to-lddlflags.patch
    - Remove -rpath and append LDFLAGS to lddlflags
    0005-Add-headers-for-opensolaris.patch
    - Add headers for opensolaris
    0006-List-packaged-patches-in-patchlevel.h.patch
    - List packaged patches for perl-5.38.2-r3(perl-5.38.0-patches-1) in patchlevel.h
    - Bug: https://bugs.debian.org/567489
    0007-Cleanup-PATH-and-shrpenv.patch
    - Cleanup PATH and shrpenv
    0008-Tweak-enc2xs-to-follow-symlinks-and-ignore-missing-I.patch
    - Tweak enc2xs to follow symlinks and ignore missing @INC directories.
    - Bug: https://bugs.debian.org/290336
    0009-darwin-Use-CC-to-link.patch
    - darwin: Use $CC to link
    - Bug: https://bugs.gentoo.org/297751
    0010-Provide-a-sensible-INSTALLDIRS-default-for-modules-i.patch
    - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
    0011-Fix-interix-hints.patch
    - Fix interix hints
    0012-Set-libperl-soname.patch
    - Set libperl soname
    - Bug: https://bugs.gentoo.org/286840
    0013-Add-etc-perl-to-INC.patch
    - Add /etc/perl to @INC
    0014-cpan-ExtUtils-MakeMaker-remove-targets-that-generate.patch
    - cpan/ExtUtils-MakeMaker: remove targets that generate perllocal.pod
    0015-Don-t-force-fstack-protector-on-everyone.patch
    - Don't force -fstack-protector on everyone
    - Bug: https://bugs.gentoo.org/348557
    0016-Do-not-set-custom-CFLAGS-in-cpan-Digest-SHA.patch
    - Do not set custom CFLAGS in cpan/Digest-SHA
    - Bug: https://bugs.gentoo.org/506818
    0017-Configure-Don-t-include-sources-in-usr-local-for-com.patch
    - Configure: Don't include sources in /usr/local/ for compiling perl
    0018-cpan-IO-Socket-IP-Disable-network-tests.patch
    - cpan/IO-Socket-IP: Disable network tests
    0019-Fix-EUMM-podlocal-tests.patch
    - Fix EUMM podlocal tests
    0020-Skip-auto-linking-cl-and-pthread.patch
    - Skip auto-linking nsl and cl
    - Bug: https://rt.perl.org/Public/Bug/Display.html?id=13148
    0021-Disable-porting-tests-which-create-fun-false-failure.patch
    - Disable porting tests which create fun false-failures all over travis
    0022-Disable-PathTools-tests-which-fails-under-sandboxing.patch
    - Disable PathTools tests which fails under sandboxing
    - Bug: https://bugs.gentoo.org/645084
    0023-Fix-CPAN-FirstTime-defaults-with-nonexisting-site-di.patch
    - Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable
    - Bug: https://bugs.debian.org/688842
    0024-Pass-LD-settings-through-to-subdirectories.patch
    - Pass LD settings through to subdirectories
    - Bug: https://bugs.debian.org/758471
    0025-Respect-umask-during-installation.patch
    - Respect umask during installation
    0026-Fix-parallel-building.patch
    - Fix parallel building
    0027-Add-support-for-Dgentoolibdirs-note-hashes-in-uconfi.patch
    - Add support for -Dgentoolibdirs
    0028-Fix-hashes-in-uconfig.h-hooray.patch
    - Fix tests
    100-5.36.0-fix-configure-for-clang.patch
    - Fix clang check in configure
    - Bug: https://github.com/Perl/perl5/issues/21099
  Built under linux
  Compiled at May 13 2024 19:08:47
  @INC:
    /etc/perl
    /usr/local/lib/perl5/5.38/i686-linux
    /usr/local/lib/perl5/5.38
    /usr/lib/perl5/vendor_perl/5.38/i686-linux
    /usr/lib/perl5/vendor_perl/5.38
    /usr/lib/perl5/5.38/i686-linux
    /usr/lib/perl5/5.38
Comment 4 Florian Gamböck 2024-05-21 15:33:03 UTC
Hi!

It's not exclusive to x86, my Raspberry Pi (arm) shows a similar message, but during emerge:

>>> Configuring source in /var/tmp/portage/dev-perl/Net-DNS-1.390.0/work/Net-DNS-1.39 ...
Using ExtUtils::MakeMaker
perl Makefile.PL AR=armv7a-unknown-linux-gnueabihf-ar CC=armv7a-unknown-linux-gnueabihf-gcc CPP=armv7a-unknown-linux-gnueabihf-gcc -E LD=armv7a-unknown-linux-
gnueabihf-gcc NM=armv7a-unknown-linux-gnueabihf-nm RANLIB=armv7a-unknown-linux-gnueabihf-ranlib OPTIMIZE=-march=armv8-a+crc+simd -O2 -pipe LDFLAGS=-Wl,-O1 -Wl,--as-needed PRE
FIX=/usr INSTALLDIRS=vendor INSTALLMAN3DIR=none --no-online-tests --no-IPv6-tests
Checking if your kit is complete...
Looks good
'CPP' is not a known MakeMaker parameter name.
'NM' is not a known MakeMaker parameter name.
lib/Net/LibIDN2.c: loadable library and perl binaries are mismatched (got first handshake key 0x9b80000, needed 0x9c80000)

Emerge will fail this package at this point, making it impossible to install packages like dev-perl/Net-DNS, dev-perl/Net-DNS-SEC, and packages that depend on them like mail-filter/spamassassin.

Is this related enough to be discussed here or should I open a new bug report for this issue?

perl -V:

Summary of my perl5 (revision 5 version 38 subversion 2) configuration:
   
  Platform:
    osname=linux
    osvers=6.6.30-gentoo-dist
    archname=armv7a-linux
    uname='linux localhost 6.6.30-gentoo-dist #1 smp preempt_dynamic tue may 14 21:37:14 cest 2024 armv7l intel(r) core(tm) i7-4790k cpu @ 4.00ghz gnulinux '
    config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Ui_xlocale -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dnoextensions=ODBM_File -Duseshrplib -Darchname=armv7a-linux -Dar=armv7a-unknown-linux-gnueabihf-ar -Dcc=armv7a-unknown-linux-gnueabihf-gcc -Dcpp=armv7a-unknown-linux-gnueabihf-gcc -E -Dnm=armv7a-unknown-linux-gnueabihf-nm -Dranlib=armv7a-unknown-linux-gnueabihf-ranlib -Accflags=-march=armv8-a+crc+simd -O2 -pipe -fno-strict-aliasing -DNO_PERL_RAND_SEED -Doptimize=-march=armv8-a+crc+simd -O2 -pipe -fno-strict-aliasing -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib/perl5/5.38 -Darchlib=/usr/lib/perl5/5.38/armv7a-linux -Dsitelib=/usr/local/lib/perl5/5.38 -Dsitearch=/usr/local/lib/perl5/5.38/armv7a-linux -Dvendorlib=/usr/lib/perl5/vendor_perl/5.38 -Dvendorarch=/usr/lib/perl5/vendor_perl/5.38/armv7a-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.38.2 -Dlocincpth=/usr/include  -Dglibpth=/lib /usr/lib  -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=undef
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='armv7a-unknown-linux-gnueabihf-gcc'
    ccflags ='-march=armv8-a+crc+simd -O2 -pipe -fno-strict-aliasing -DNO_PERL_RAND_SEED -fwrapv -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-march=armv8-a+crc+simd -O2 -pipe -fno-strict-aliasing'
    cppflags='-march=armv8-a+crc+simd -O2 -pipe -fno-strict-aliasing -DNO_PERL_RAND_SEED -fwrapv'
    ccversion=''
    gccversion='13.2.1 20240210'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=1234
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=4
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='armv7a-unknown-linux-gnueabihf-gcc'
    ldflags ='-Wl,-O1 -Wl,--as-needed'
    libpth=/usr/lib /lib
    libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc.so.6
    so=so
    useshrplib=true
    libperl=libperl.so.5.38.2
    gnulibc_version='2.38'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -march=armv8-a+crc+simd -O2 -pipe -fno-strict-aliasing -Wl,-O1 -Wl,--as-needed'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_LONG_DOUBLE
    HAS_STRTOLD
    HAS_TIMES
    NO_PERL_RAND_SEED
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_ZAPHOD32
    PERL_HASH_USE_SBOX32
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Locally applied patches:
    0001-Fix-hpux-hints.patch
    - Fix hpux hints
    0002-aix-gcc-detection-and-shared-library-soname-support.patch
    - aix gcc detection and shared library soname support
    0003-cpan-ExtUtils-MakeMaker-drop-PORTAGE_TMPDIR-from-LD_.patch
    - cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH
    - Bug: https://bugs.gentoo.org/105054
    0004-Remove-rpath-and-append-LDFLAGS-to-lddlflags.patch
    - Remove -rpath and append LDFLAGS to lddlflags
    0005-Add-headers-for-opensolaris.patch
    - Add headers for opensolaris
    0006-List-packaged-patches-in-patchlevel.h.patch
    - List packaged patches for perl-5.38.2-r3(perl-5.38.0-patches-1) in patchlevel.h
    - Bug: https://bugs.debian.org/567489
    0007-Cleanup-PATH-and-shrpenv.patch
    - Cleanup PATH and shrpenv
    0008-Tweak-enc2xs-to-follow-symlinks-and-ignore-missing-I.patch
    - Tweak enc2xs to follow symlinks and ignore missing @INC directories.
    - Bug: https://bugs.debian.org/290336
    0009-darwin-Use-CC-to-link.patch
    - darwin: Use $CC to link
    - Bug: https://bugs.gentoo.org/297751
    0010-Provide-a-sensible-INSTALLDIRS-default-for-modules-i.patch
    - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
    0011-Fix-interix-hints.patch
    - Fix interix hints
    0012-Set-libperl-soname.patch
    - Set libperl soname
    - Bug: https://bugs.gentoo.org/286840
    0013-Add-etc-perl-to-INC.patch
    - Add /etc/perl to @INC
    0014-cpan-ExtUtils-MakeMaker-remove-targets-that-generate.patch
    - cpan/ExtUtils-MakeMaker: remove targets that generate perllocal.pod
    0015-Don-t-force-fstack-protector-on-everyone.patch
    - Don't force -fstack-protector on everyone
    - Bug: https://bugs.gentoo.org/348557
    0016-Do-not-set-custom-CFLAGS-in-cpan-Digest-SHA.patch
    - Do not set custom CFLAGS in cpan/Digest-SHA
    - Bug: https://bugs.gentoo.org/506818
    0017-Configure-Don-t-include-sources-in-usr-local-for-com.patch
    - Configure: Don't include sources in /usr/local/ for compiling perl
    0018-cpan-IO-Socket-IP-Disable-network-tests.patch
    - cpan/IO-Socket-IP: Disable network tests
    0019-Fix-EUMM-podlocal-tests.patch
    - Fix EUMM podlocal tests
    0020-Skip-auto-linking-cl-and-pthread.patch
    - Skip auto-linking nsl and cl
    - Bug: https://rt.perl.org/Public/Bug/Display.html?id=13148
    0021-Disable-porting-tests-which-create-fun-false-failure.patch
    - Disable porting tests which create fun false-failures all over travis
    0022-Disable-PathTools-tests-which-fails-under-sandboxing.patch
    - Disable PathTools tests which fails under sandboxing
    - Bug: https://bugs.gentoo.org/645084
    0023-Fix-CPAN-FirstTime-defaults-with-nonexisting-site-di.patch
    - Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable
    - Bug: https://bugs.debian.org/688842
    0024-Pass-LD-settings-through-to-subdirectories.patch
    - Pass LD settings through to subdirectories
    - Bug: https://bugs.debian.org/758471
    0025-Respect-umask-during-installation.patch
    - Respect umask during installation
    0026-Fix-parallel-building.patch
    - Fix parallel building
    0027-Add-support-for-Dgentoolibdirs-note-hashes-in-uconfi.patch
    - Add support for -Dgentoolibdirs
    0028-Fix-hashes-in-uconfig.h-hooray.patch
    - Fix tests
    100-5.36.0-fix-configure-for-clang.patch
    - Fix clang check in configure
    - Bug: https://github.com/Perl/perl5/issues/21099
  Built under linux
  Compiled at May 21 2024 03:07:51
  @INC:
    /etc/perl
    /usr/local/lib/perl5/5.38/armv7a-linux
    /usr/local/lib/perl5/5.38
    /usr/lib/perl5/vendor_perl/5.38/armv7a-linux
    /usr/lib/perl5/vendor_perl/5.38
    /usr/lib/perl5/5.38/armv7a-linux
    /usr/lib/perl5/5.38
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-22 01:04:23 UTC
Thanks Florian. No additional information required (yet). I hope to look at this tonight now.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-22 01:39:26 UTC
So, we have:
```
loadable library and perl binaries are mismatched (got first handshake key 0x8b00000, needed 0x8b80000)
```

The handshake verification is done in Perl_xs_handshake (util.c), and we fail the first one:

```
    PERL_ARGS_ASSERT_XS_HANDSHAKE;
    va_start(args, file);

    got = INT2PTR(void*, (UV)(key & HSm_KEY_MATCH));
    need = (void *)(HS_KEY(FALSE, FALSE, "", "") & HSm_KEY_MATCH);
    if (UNLIKELY(got != need))
        goto bad_handshake;
```

i.e. Perl says 0x8b80000, the XS module (dev-perl/Net-LibIDN2) says 0x8b00000.

The difference is 0x80000 which https://github.com/perl/perl5/issues/14714#issuecomment-544071062 makes clear means it's likely a #define inconsistency.

Two issues:
1) We set ccflags *and* optimize for Module::Build (which dev-perl/Net-DNS uses), while we only set OPTIMIZE (case is fine) for MM (which dev-perl/Net-LibIDN2 uses). (ccflags clobbers the Perl default, while optimize appends. We should just set optimize - to not clobber what Perl sets, but also for consistency between the two build systems).
2) dev-perl/Net-LibIDN2 doesn't use the Module::Build support in the eclass, so we should fix that. This means it doesn't get all the flag variables, but it ends up not being the problem here.
Comment 7 Larry the Git Cow gentoo-dev 2024-05-22 01:44:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69d4cc312072ad28491d2dce5798dd49d63713e5

commit 69d4cc312072ad28491d2dce5798dd49d63713e5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-22 01:40:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-22 01:43:56 +0000

    perl-module.eclass: don't set 'ccflags' for Module::Build
    
    TL;DR: If we set 'ccflags', we're clobbering the Perl default. We're already
    setting 'optimize' which is what we're supposed to use here.
    
    We set ccflags *and* optimize for Module::Build (which dev-perl/Net-DNS uses),
    while we only set OPTIMIZE (case is fine) for MM (which dev-perl/Net-LibIDN2 uses).
    
    ccflags clobbers the Perl default, while optimize appends. We should just set optimize -
    to not clobber what Perl sets, but also for consistency between the two build systems).
    
    (Unfortunately, this does mean we also inherit things we don't really
    want to, which don't affect ABI, like -fno-strict-aliasing, but let's
    live with it for now...)
    
    Bug: https://bugs.gentoo.org/261375
    Bug: https://bugs.gentoo.org/877659
    Closes: https://bugs.gentoo.org/932176
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/perl-module.eclass | 1 -
 1 file changed, 1 deletion(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a03690c377ae3b4d8472eb247b104ddfb8d8764

commit 1a03690c377ae3b4d8472eb247b104ddfb8d8764
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-22 01:43:15 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-22 01:44:03 +0000

    dev-perl/Net-LibIDN2: use eclass phase functions
    
    As I noted in the bug:
    > dev-perl/Net-LibIDN2 doesn't use the Module::Build support in the eclass,
    > so we should fix that. This means it doesn't get all the flag variables,
    > but it ends up not being the problem here.
    
    It's also just clutter to unnecessarily (and not as comprehensively) do
    the same thing the eclass does, so clean it up.
    
    Bug: https://bugs.gentoo.org/932176
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-perl/Net-LibIDN2/Net-LibIDN2-1.20.0-r1.ebuild | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-22 01:47:39 UTC
Thanks, and I'm sorry for the breakage.
Comment 9 Alix 2024-05-22 06:38:41 UTC
Thank you for investigation and explanation, Sam. Handshake issue with dev-perl/Net-DNS is resolved.

dev-perl/Encode-Detect from report on forums.gentoo.org installs fine as well.

I've noticed that dev-perl/Module-Build is listed twice within BDEPEND definition, is this intentional? https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a03690c377ae3b4d8472eb247b104ddfb8d8764
Comment 10 Florian Gamböck 2024-05-23 17:45:45 UTC
I confirm that =dev-perl/Net-LibIDN2-1.20.0-r1 fixes the problem for arm. Thanks for your quick effort and greetings from my Raspi!
Comment 11 Larry the Git Cow gentoo-dev 2024-05-25 07:35:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8b596d02fd9f3cda0d81eb4f510cb141e3e1034

commit f8b596d02fd9f3cda0d81eb4f510cb141e3e1034
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-25 07:28:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-25 07:34:43 +0000

    dev-perl/Net-LibIDN2: drop duplicate Module-Build BDEPEND
    
    Bug: https://bugs.gentoo.org/932176
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-perl/Net-LibIDN2/Net-LibIDN2-1.20.0-r1.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-25 07:35:31 UTC
Thanks folks!