Skip Menu |

This queue is for tickets about the Net-SSLeay CPAN distribution.

Report information
The Basics
Id: 131558
Status: open
Priority: 0/
Queue: Net-SSLeay

People
Owner: Nobody in particular
Requestors: david [...] ixit.cz
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: LTO optimization failure
Date: Fri, 24 Jan 2020 22:59:33 +0100
To: bug-Net-SSLeay [...] rt.cpan.org
From: David Heidelberg <david [...] ixit.cz>
When SSLeay is compiled with GCC parameter -flto it fails due to probably not correctly marked functions (they get optimized away, as they're not used inside code). $ cat test.pl #!/usr/bin/perl require IO::Socket::SSL; $ ./test.pl Can't find 'boot_Net__SSLeay' symbol in /usr/lib64/perl5/vendor_perl/5.30.1/x86_64-linux-thread-multi/auto/Net/SSLeay/SSLeay.so at /usr/lib64/perl5/vendor_perl/5.30.1/IO/Socket/SSL.pm line 19. Compilation failed in require at /usr/lib64/perl5/vendor_perl/5.30.1/IO/Socket/SSL.pm line 19. BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/5.30.1/IO/Socket/SSL.pm line 19. Compilation failed in require at ./test.pl line 2. Ref: https://bugs.gentoo.org/706268
Thanks for the report, David. On Fri Jan 24 22:09:05 2020, david@ixit.cz wrote: Show quoted text
> When SSLeay is compiled with GCC parameter -flto it fails due to > probably not correctly marked functions (they get optimized away, as > they're not used inside code).
Could you give me the following details about your setup, please? - The output of "perl -V" - The output of "perl -MConfig -e 'print $Config{ar}, "\n", $Config{full_ar}, "\n"' - The arguments you're passing to Makefile.PL
Subject: Re: [rt.cpan.org #131558] LTO optimization failure
Date: Sat, 25 Jan 2020 15:43:53 +0100
To: bug-Net-SSLeay [...] rt.cpan.org
From: David Heidelberg <david [...] ixit.cz>
$ perl -V Summary of my perl5 (revision 5 version 30 subversion 1) configuration: Platform: osname=linux osvers=5.4.7 archname=x86_64-linux-thread-multi uname='linux tester 5.4.7 #1 smp preempt tue dec 31 17:50:00 cet 2019 x86_64 intel(r) core(tm) i7-6600u cpu @ 2.60ghz genuineintel gnulinux ' config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Ui_xlocale -Ui_ndbm -Di_gdbm -Ui_db -Dusethreads -DDEBUGGING=none -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-linux-thread -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-march=native -O2 -fno-stack-protector -pipe -fno-lto -fno-use-linker-plugin -Dldflags=-Wl,-O1 -Wl,--as-needed -fno-lto -fno-use-linker-plugin -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.30.1 -Darchlib=/usr/lib64/perl5/5.30.1/x86_64-linux-thread-multi -Dsitelib=/usr/local/lib64/perl5/5.30.1 -Dsitearch=/usr/local/lib64/perl5/5.30.1/x86_64-linux-thread-multi -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.30.1 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.30.1/x86_64-linux-thread-multi -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.30.1 -Dlocincpth=/usr/include -Dglibpth=/lib64 /usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm -Ui_xlocale -Ui_ndbm -Di_gdbm -Ui_db -Dusethreads -DDEBUGGING=none -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='x86_64-pc-linux-gnu-gcc' ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' optimize='-march=native -O2 -fno-stack-protector -pipe -fno-lto -fno-use-linker-plugin' cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe' ccversion='' gccversion='9.2.0' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='x86_64-pc-linux-gnu-gcc' ldflags ='-Wl,-O1 -Wl,--as-needed -fno-lto -fno-use-linker-plugin' libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib libs=-lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc libc=libc-2.30.so so=so useshrplib=true libperl=libperl.so.5.30.1 gnulibc_version='2.30' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -march=native -O2 -fno-stack-protector -pipe -fno-lto -fno-use-linker-plugin -Wl,-O1 -Wl,--as-needed -fno-lto -fno-use-linker-plugin' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API USE_THREAD_SAFE_LOCALE Locally applied patches: gentoo/hints_hpux - Fix hpux hints gentoo/aix_soname - aix gcc detection and shared library soname support gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054 cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags gentoo/opensolaris_headers - Add headers for opensolaris gentoo/patchlevel - List packaged patches for perl-5.30.1(#1) in patchlevel.h gentoo/cleanup-paths - Cleanup PATH and shrpenv gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing @INC directories. gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin: Use $CC to link gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN. gentoo/interix - Fix interix hints gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set libperl soname gentoo/mod_paths - Add /etc/perl to @INC gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker: remove targets that generate perllocal.pod gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557 Don't force -fstack-protector on everyone gentoo/usr_local - Configure: Don't include sources in /usr/local/ for compiling perl gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set custom CFLAGS in cpan/Digest-SHA gentoo/io_socket_ip_tests - cpan/IO-Socket-IP: Disable network tests gentoo/tests - Fix EUMM podlocal tests gentoo/no-nsl-cl.patch - gentoo/no_porting_tests - Disable porting tests which create fun false-failures all over travis gentoo/pathtools_enoent - Disable PathTools tests which fails under sandboxing debian/cpan-missing-site-dirs - Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable debian/makemaker-pasthru - Pass LD settings through to subdirectories fixes/memoize_storable_nstore - [rt.cpan.org #77790] Memoize::Storable: respect 'nstore' option not respected fixes/podman-pipe - Better errors for man pages from standard input fixes/respect_umask - Respect umask during installation fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net::SMTP 'Port' option fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags} fixes/parallel-manisort.patch - Fix parallel building Built under linux Compiled at Jan 24 2020 22:00:57 @INC: /etc/perl /usr/local/lib64/perl5/5.30.1/x86_64-linux-thread-multi /usr/local/lib64/perl5/5.30.1 /usr/lib64/perl5/vendor_perl/5.30.1/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.30.1 /usr/lib64/perl5/5.30.1/x86_64-linux-thread-multi /usr/lib64/perl5/5.30.1 $ perl -MConfig -e 'print $Config{ar}, "\n", $Config{full_ar}, "\n"' ar /usr/bin/ar Show quoted text
>>> Preparing source in
/var/tmp/portage/dev-perl/Net-SSLeay-1.880.0/work/Net-SSLeay-1.88 ... * Applying Net-SSLeay-1.88-fix-network-tests.patch ... [ ok ] * Applying Net-SSLeay-1.88-fix-libdir.patch ... patching file Makefile.PL Hunk #1 succeeded at 136 with fuzz 1 (offset -5 lines). [ ok ] * Removing un-needed t/local/01_pod.t * Removing un-needed t/local/02_pod_coverage.t * Removing un-needed t/local/kwalitee.t * Fixing Manifest Show quoted text
>>> Source prepared. >>> Configuring source in
/var/tmp/portage/dev-perl/Net-SSLeay-1.880.0/work/Net-SSLeay-1.88 ... * Using ExtUtils::MakeMaker * perl Makefile.PL PREFIX=/usr INSTALLDIRS=vendor INSTALLMAN3DIR=none DESTDIR=/var/tmp/portage/dev-perl/Net-SSLeay-1.880.0/image/ *** Found OpenSSL-1.1.1d installed in /usr *** Be sure to use the same compiler and options to compile your OpenSSL, perl, and Net::SSLeay. Mixing and matching compilers is not supported. Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Net::SSLeay Writing MYMETA.yml and MYMETA.json Show quoted text
>>> Source configured. >>> Compiling source in
/var/tmp/portage/dev-perl/Net-SSLeay-1.880.0/work/Net-SSLeay-1.88 ... * emake OTHERLDFLAGS=-Wl,-O1 -Wl,--as-needed -fno-lto -fno-use-linker-plugin OPTIMIZE=-march=native -O2 -flto -fno-stack-protector -pipe -fno-lto -fno-use-linker-plugin OPENSSL_PREFIX=/usr make -j4 'OTHERLDFLAGS=-Wl,-O1 -Wl,--as-needed -fno-lto -fno-use-linker-plugin' 'OPTIMIZE=-march=native -O2 -flto -fno-stack-protector -pipe -fno-lto -fno-use-linker-plugin' OPENSSL_PREFIX=/usr "/usr/bin/perl" "/usr/lib64/perl5/5.30.1/ExtUtils/xsubpp" -typemap '/usr/lib64/perl5/5.30.1/ExtUtils/typemap' -typemap '/var/tmp/portage/dev-perl/Net-SSLeay-1.880.0/work/Net-SSLeay-1.88/typemap' SSLeay.xs > SSLeay.xsc Running Mkbootstrap for SSLeay () cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay) chmod 644 "SSLeay.bs" blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters: directory blib/lib/auto/Net/SSLeay: do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.al, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate to get_http head_https.al, head_https3.al, head_https4.al, head_http.al, head_http3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al truncate to head_htt post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al truncate to post_htt put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate to put_http ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs 644 mv SSLeay.xsc SSLeay.c x86_64-pc-linux-gnu-gcc -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=native -O2 -flto -fno-stack-protector -pipe -fno-lto -fno-use-linker-plugin -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" -fPIC "-I/usr/lib64/perl5/5.30.1/x86_64-linux-thread-multi/CORE" SSLeay.c That's working version. Not working version just doesn't have "-fno-lto" in compilation line. Chris Novakovic via RT <bug-Net-SSLeay@rt.cpan.org> napsal Pá, 24. led 2020 v 19∶21: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131558 > > > Thanks for the report, David. > > On Fri Jan 24 22:09:05 2020, david@ixit.cz wrote:
>> When SSLeay is compiled with GCC parameter -flto it fails due to >> probably not correctly marked functions (they get optimized away, as >> they're not used inside code).
> > Could you give me the following details about your setup, please? > > - The output of "perl -V" > - The output of "perl -MConfig -e 'print $Config{ar}, "\n", > $Config{full_ar}, "\n"' > - The arguments you're passing to Makefile.PL
Subject: Re: [rt.cpan.org #131558] LTO optimization failure
Date: Sat, 25 Jan 2020 15:45:46 +0100
To: bug-Net-SSLeay [...] rt.cpan.org
From: David Heidelberg <david [...] ixit.cz>

Message body is not shown because it is too large.

On Sat Jan 25 14:46:03 2020, david@ixit.cz wrote: Show quoted text
> SSLeay.o: plugin needed to handle lto object
This is likely to be because the value of AR is "ar", rather than "gcc-ar". gcc-ar will invoke ar with an argument that loads the LTO plugin. What happens if you explicitly specify AR=gcc-ar as an argument to Makefile.PL?