Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure misdetects strlcpy et al. with gcc -flto #12122

Closed
p5pRT opened this issue May 21, 2012 · 20 comments
Closed

Configure misdetects strlcpy et al. with gcc -flto #12122

p5pRT opened this issue May 21, 2012 · 20 comments

Comments

@p5pRT
Copy link

p5pRT commented May 21, 2012

Migrated from rt.perl.org#113022 (status was 'resolved')

Searchable as RT113022$

@p5pRT
Copy link
Author

p5pRT commented May 21, 2012

From @mauke

Created by @mauke

Hi,

while trying to build perl-5.16.0 I ran into this problem​:

...
cgcc -fstack-protector -L/usr/local/lib -O2 -flto -o miniperl \
  perlmini.o opmini.o miniperlmain.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o -lnsl -ldl -lm -lcrypt -lutil -lc
/tmp/ccn4nr6G.ltrans6.ltrans.o​: In function `Perl_sv_usepvn_flags'​:
ccn4nr6G.ltrans6.o​:(.text+0x19c5)​: undefined reference to `malloc_size'
ccn4nr6G.ltrans6.o​:(.text+0x1a8b)​: undefined reference to `malloc_size'
/tmp/ccn4nr6G.ltrans9.ltrans.o​: In function `Perl_find_script'​:
ccn4nr6G.ltrans9.o​:(.text+0x453f)​: undefined reference to `strlcpy'
/tmp/ccn4nr6G.ltrans9.ltrans.o​: In function `Perl_more_bodies'​:
ccn4nr6G.ltrans9.o​:(.text+0x73b7)​: undefined reference to `malloc_good_size'
/tmp/ccn4nr6G.ltrans25.ltrans.o​: In function `Perl_sv_grow'​:
ccn4nr6G.ltrans25.o​:(.text+0x172b)​: undefined reference to `malloc_size'
ccn4nr6G.ltrans25.o​:(.text+0x1760)​: undefined reference to `malloc_size'
/tmp/ccn4nr6G.ltrans4.ltrans.o​: In function `Perl_av_extend'​:
ccn4nr6G.ltrans4.o​:(.text+0x721)​: undefined reference to `malloc_size'
/tmp/ccn4nr6G.ltrans28.ltrans.o​: In function `Perl_magic_set'​:
ccn4nr6G.ltrans28.o​:(.text+0x1ca3)​: undefined reference to `setproctitle'
ccn4nr6G.ltrans28.o​:(.text+0x2659)​: undefined reference to `setrgid'
ccn4nr6G.ltrans28.o​:(.text+0x26d8)​: undefined reference to `setruid'
collect2​: ld returned 1 exit status
make​: *** [miniperl] Error 1

This is caused by Configure thinking I have malloc_size, strlcpy, etc. when I
do not.

I was able to fix this problem with the following patch​:

Inline Patch
--- perl-5.16.0-orig/Configure	2012-04-25 02:18:30.000000000 +0200
+++ perl-5.16.0/Configure	2012-05-15 08:11:20.000000000 +0200
@@ -7782,13 +7782,13 @@
 		if $contains $tlook $tf >/dev/null 2>&1; then
 			tval=true;
 		elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
-			echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+			echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
 			$cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
 			$test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
 			$rm_try;
 		fi;
 	else
-		echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+		echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
 		$cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
 		$rm_try;
 	fi;


And this is what happened (I think):

Configure thinks I have these symbols because I'm building with -O2 -flto.
"lto" stands for "link-time optimization" and lets gcc apply optimizations in
the linking phase.
The configure test effectively checks whether &foo is NULL. gcc knows that the
address of a symbol can't be NULL, so the test is optimized out.
But that was the only reference to 'p' in the program, so dead code elimination
removes it (and with it the only reference to 'foo').
The program is now effectively 'int main() { return 0; }', so linking succeeds.
End result​: Configure thinks the symbols strlcpy, malloc_size, etc exist.

My patch makes it actually check the address so gcc can't get rid of it
completely, thus Configure gets the linker errors it expects.

Andy Dougherty reports that a workaround is to call

  ./Configure -Doptimize=-O2 [...]

but then call make as

  make OPTIMIZE='-O2 -flto'

Perl Info

Flags:
    category=install
    severity=medium

Site configuration information for perl 5.16.0:

Configured by mauke at Mon May 21 11:48:30 CEST 2012.

Summary of my perl5 (revision 5 version 16 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=2.6.38-gentoo-r6, archname=i686-linux
    uname='linux nora 2.6.38-gentoo-r6 #1 preempt sat aug 6 03:05:34 cest 2011 i686 amd athlon(tm) 64 processor 3200+ authenticamd gnulinux '
    config_args='-de -Dprefix=/home/mauke/usr/perlbrew/perls/perl-5.16.0'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.6.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.14.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.14.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.16.0:
    /home/mauke/usr/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/i686-linux
    /home/mauke/usr/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0
    /home/mauke/usr/perlbrew/perls/perl-5.16.0/lib/5.16.0/i686-linux
    /home/mauke/usr/perlbrew/perls/perl-5.16.0/lib/5.16.0
    .


Environment for perl 5.16.0:
    HOME=/home/mauke
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_COLLATE=POSIX
    LD_LIBRARY_PATH=/home/mauke/usr/local/lib
    LOGDIR (unset)
    PATH=/home/mauke/usr/perlbrew/bin:/home/mauke/usr/perlbrew/perls/perl-5.16.0/bin:/home/mauke/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.5:/opt/sun-jdk-1.4.2.13/bin:/opt/sun-jdk-1.4.2.13/jre/bin:/opt/sun-jdk-1.4.2.13/jre/javaws:/opt/dmd/bin:/usr/games/bin
    PERLBREW_HOME=/home/mauke/.perlbrew
    PERLBREW_PATH=/home/mauke/usr/perlbrew/bin:/home/mauke/usr/perlbrew/perls/perl-5.16.0/bin
    PERLBREW_PERL=perl-5.16.0
    PERLBREW_ROOT=/home/mauke/usr/perlbrew
    PERLBREW_VERSION=0.27
    PERL_BADLANG (unset)
    PERL_UNICODE=SAL
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

From @rjbs

I would very much appreciate some opinions on the applicability of this change.

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

From [Unknown Contact. See original ticket]

I would very much appreciate some opinions on the applicability of this change.

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

@rjbs - Status changed from 'new' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

From @cpansprout

On Tue Jul 03 18​:56​:20 2012, rjbs wrote​:

I would very much appreciate some opinions on the applicability of
this change.

Did you mean to close it?

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

From [Unknown Contact. See original ticket]

On Tue Jul 03 18​:56​:20 2012, rjbs wrote​:

I would very much appreciate some opinions on the applicability of
this change.

Did you mean to close it?

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

@cpansprout - Status changed from 'resolved' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2012

From @nwc10

On Tue, Jul 03, 2012 at 06​:56​:20PM -0700, Ricardo SIGNES via RT wrote​:

I would very much appreciate some opinions on the applicability of this change.

It looks sane, but it is an area that caused great fun before.

I think we push it to a smoke-me branch, but also try to ensure we test
Configure with and without generates the same config.sh (no need to actually
build) on as many compilers as we collectively have access to, at high
optimisation levels.

(ie I think that's the vendor C and C++ compilers on Solaris, HP-UX and AIX.
Test gcc and clang, but I don't think that they'll be the problem. icc, if
anyone has access to it.)

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2013

From @mauke

On Wed Jul 04 03​:06​:14 2012, nicholas wrote​:

On Tue, Jul 03, 2012 at 06​:56​:20PM -0700, Ricardo SIGNES via RT wrote​:

I would very much appreciate some opinions on the applicability of
this change.

It looks sane, but it is an area that caused great fun before.

I think we push it to a smoke-me branch, but also try to ensure we
test
Configure with and without generates the same config.sh (no need to
actually
build) on as many compilers as we collectively have access to, at high
optimisation levels.

(ie I think that's the vendor C and C++ compilers on Solaris, HP-UX
and AIX.
Test gcc and clang, but I don't think that they'll be the problem.
icc, if
anyone has access to it.)

Did anything happen in this area? My build is still failing with 5.16.3​:

/tmp/cc9ZpvJt.ltrans13.ltrans.o​: In function `Perl_magic_set'​:
cc9ZpvJt.ltrans13.o​:(.text+0x2b48)​: undefined reference to `setproctitle'
cc9ZpvJt.ltrans13.o​:(.text+0x372f)​: undefined reference to `setrgid'
cc9ZpvJt.ltrans13.o​:(.text+0x374d)​: undefined reference to `setruid'
/tmp/cc9ZpvJt.ltrans22.ltrans.o​: In function `Perl_more_bodies'​:
cc9ZpvJt.ltrans22.o​:(.text+0x3c7)​: undefined reference to `malloc_good_size'
/tmp/cc9ZpvJt.ltrans22.ltrans.o​: In function
`Perl_find_script.constprop.59'​:
cc9ZpvJt.ltrans22.o​:(.text+0x417e)​: undefined reference to `strlcpy'
/tmp/cc9ZpvJt.ltrans19.ltrans.o​: In function `Perl_av_extend'​:
cc9ZpvJt.ltrans19.o​:(.text+0x348)​: undefined reference to `malloc_size'
/tmp/cc9ZpvJt.ltrans19.ltrans.o​: In function `Perl_sv_usepvn_flags'​:
cc9ZpvJt.ltrans19.o​:(.text+0x599b)​: undefined reference to `malloc_size'
cc9ZpvJt.ltrans19.o​:(.text+0x5a70)​: undefined reference to `malloc_size'
/tmp/cc9ZpvJt.ltrans27.ltrans.o​: In function `Perl_sv_grow'​:
cc9ZpvJt.ltrans27.o​:(.text+0x1776)​: undefined reference to `malloc_size'
collect2​: error​: ld returned 1 exit status
make​: *** [miniperl] Error 1

@p5pRT
Copy link
Author

p5pRT commented May 24, 2013

From @mauke

This bug still exists in perl-5.18.0 Configure.

@p5pRT
Copy link
Author

p5pRT commented Feb 27, 2014

From @rjbs

I found this ticket in a list of things to review, sadly ignored for a long time.

Lukas, are you still seeing this?

It looks like this got delayed because of the proximity to release… twice. I'd like to get this closed now-ish, to avoid this happening AGAIN.

--
rjbs

@p5pRT
Copy link
Author

p5pRT commented Mar 6, 2014

From @shlomif

Hi all,

On Wed Feb 26 16​:02​:01 2014, rjbs wrote​:

I found this ticket in a list of things to review, sadly ignored for a
long time.

Lukas, are you still seeing this?

For the record, I can still reproduce the build failure, and make and make test pass with the patch applied, after I did this​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Doptimize='-O2 -flto'
»

I am on Mageia Linux x86-64 Cauldron (what will become Mageia 5) and I'm using gcc-4.8.2-5.mga5 .

I can try testing with clang next to see if the fix broke anything.

It looks like this got delayed because of the proximity to release…
twice. I'd like to get this closed now-ish, to avoid this happening
AGAIN.

Regards,

-- Shlomi Fish

@p5pRT
Copy link
Author

p5pRT commented Mar 6, 2014

From @shlomif

On Thu Mar 06 00​:49​:07 2014, shlomif wrote​:

Hi all,

On Wed Feb 26 16​:02​:01 2014, rjbs wrote​:

I found this ticket in a list of things to review, sadly ignored for
a
long time.

Lukas, are you still seeing this?

For the record, I can still reproduce the build failure, and make and
make test pass with the patch applied, after I did this​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel
-Doptimize='-O2 -flto'
»

I am on Mageia Linux x86-64 Cauldron (what will become Mageia 5) and
I'm using gcc-4.8.2-5.mga5 .

I can try testing with clang next to see if the fix broke anything.

OK, tested the fix with this invocation​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Dcc=clang
»

After running them, "make" and "make test" were both successful - with some warnings on "make".

Regards,

— Shlomi Fish

@p5pRT
Copy link
Author

p5pRT commented Mar 6, 2014

From @shlomif

Hi all,

On Thu Mar 06 01​:09​:40 2014, shlomif wrote​:

On Thu Mar 06 00​:49​:07 2014, shlomif wrote​:

Hi all,

On Wed Feb 26 16​:02​:01 2014, rjbs wrote​:

I found this ticket in a list of things to review, sadly ignored
for
a
long time.

Lukas, are you still seeing this?

For the record, I can still reproduce the build failure, and make and
make test pass with the patch applied, after I did this​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel
-Doptimize='-O2 -flto'
»

I am on Mageia Linux x86-64 Cauldron (what will become Mageia 5) and
I'm using gcc-4.8.2-5.mga5 .

I can try testing with clang next to see if the fix broke anything.

OK, tested the fix with this invocation​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel
-Dcc=clang
»

After running them, "make" and "make test" were both successful - with
some warnings on "make".

Regards,

— Shlomi Fish

Tested now on a FreeBSD 9.2 VM with gcc46 (gcc-4.6). This command​:

sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Doptimize='-O2 -flto' -Dcc=gcc46

Succeeds there with and without the patch. make test succeeds without the patch, and with the patch I am getting this output with a failure in Benchmark (which I recall something that it could fail some time)​:

[QUOTE]
ext/XS-APItest/t/xsub_h ....................................... ok
ext/XS-Typemap/t/Typemap ...................................... ok
lib/AnyDBM_File ............................................... ok
lib/B/Deparse-core ............................................ ok
lib/B/Deparse ................................................. ok
lib/Benchmark ................................................. Timing is consistently zero in estimation loop, cannot benchmark. N=2048
# Looks like you planned 195 tests but ran 81.
# Looks like your test exited with 255 just after 81.
FAILED--expected 195 tests, saw 81
lib/blib ...................................................... ok
lib/bytes ..................................................... ok
lib/charnames ................................................. ok
lib/Class/Struct .............................................. ok
lib/Config/Extensions ......................................... ok
lib/Config .................................................... ok
lib/DBM_Filter/t/01error ...................................... ok
lib/DBM_Filter/t/02core ....................................... ok
lib/DBM_Filter/t/compress ..................................... ok
lib/DBM_Filter/t/encode ....................................... ok
lib/DBM_Filter/t/int32 ........................................ ok
lib/DBM_Filter/t/null ......................................... ok
lib/DBM_Filter/t/utf8 ......................................... ok
lib/DB ........................................................ ok
lib/diagnostics ............................................... ok
lib/DirHandle ................................................. ok
lib/dumpvar ................................................... ok
lib/English ................................................... ok
lib/ExtUtils/t/Embed .......................................... ok
lib/feature ................................................... ok
lib/feature/unicode_strings ................................... ok
lib/File/Basename ............................................. ok
lib/File/Compare .............................................. ok
lib/File/Copy ................................................. ok
lib/FileHandle ................................................ ok
lib/File/stat-7896 ............................................ ok
lib/File/stat ................................................. ok
lib/filetest .................................................. ok
lib/FindBin ................................................... ok
lib/Getopt/Std ................................................ ok
lib/h2ph ...................................................... ok
lib/h2xs ...................................................... ok
lib/integer ................................................... ok
lib/Internals ................................................. ok
lib/less ...................................................... ok
lib/locale .................................................... # The following locales
#
# C POSIX af_ZA.ISO8859-1 af_ZA.ISO8859-15 af_ZA.UTF-8
# am_ET.UTF-8 be_BY.CP1131 be_BY.CP1251 be_BY.ISO8859-5
# be_BY.UTF-8 bg_BG.CP1251 bg_BG.UTF-8 ca_AD.ISO8859-1
# ca_AD.ISO8859-15 ca_AD.UTF-8 ca_ES.ISO8859-1 ca_ES.ISO8859-15
# ca_ES.UTF-8 ca_FR.ISO8859-1 ca_FR.ISO8859-15 ca_FR.UTF-8
# ca_IT.ISO8859-1 ca_IT.ISO8859-15 ca_IT.UTF-8 cs_CZ.ISO8859-2
# cs_CZ.UTF-8 da_DK.ISO8859-1 da_DK.ISO8859-15 da_DK.UTF-8
# de_AT.ISO8859-1 de_AT.ISO8859-15 de_AT.UTF-8 de_CH.ISO8859-1
# de_CH.ISO8859-15 de_CH.UTF-8 de_DE.ISO8859-1 de_DE.ISO8859-15
# de_DE.UTF-8 el_GR.ISO8859-7 el_GR.UTF-8 en_AU.ISO8859-1
# en_AU.ISO8859-15 en_AU.US-ASCII en_AU.UTF-8 en_CA.ISO8859-1
# en_CA.ISO8859-15 en_CA.US-ASCII en_CA.UTF-8 en_GB.ISO8859-1
# en_GB.ISO8859-15 en_GB.US-ASCII en_GB.UTF-8 en_IE.UTF-8
# en_NZ.ISO8859-1 en_NZ.ISO8859-15 en_NZ.US-ASCII en_NZ.UTF-8
# en_US.ISO8859-1 en_US.ISO8859-15 en_US.US-ASCII en_US.UTF-8
# es_ES.ISO8859-1 es_ES.ISO8859-15 es_ES.UTF-8 et_EE.ISO8859-15
# et_EE.UTF-8 eu_ES.ISO8859-1 eu_ES.ISO8859-15 eu_ES.UTF-8
# fi_FI.ISO8859-1 fi_FI.ISO8859-15 fi_FI.UTF-8 fr_BE.ISO8859-1
# fr_BE.ISO8859-15 fr_BE.UTF-8 fr_CA.ISO8859-1 fr_CA.ISO8859-15
# fr_CA.UTF-8 fr_CH.ISO8859-1 fr_CH.ISO8859-15 fr_CH.UTF-8
# fr_FR.ISO8859-1 fr_FR.ISO8859-15 fr_FR.UTF-8 he_IL.UTF-8
# hi_IN.ISCII-DEV hr_HR.ISO8859-2 hr_HR.UTF-8 hu_HU.ISO8859-2
# hu_HU.UTF-8 hy_AM.ARMSCII-8 hy_AM.UTF-8 is_IS.ISO8859-1
# is_IS.ISO8859-15 is_IS.UTF-8 it_CH.ISO8859-1 it_CH.ISO8859-15
# it_CH.UTF-8 it_IT.ISO8859-1 it_IT.ISO8859-15 it_IT.UTF-8
# ja_JP.SJIS ja_JP.UTF-8 ja_JP.eucJP kk_KZ.PT154 kk_KZ.UTF-8
# ko_KR.CP949 ko_KR.UTF-8 ko_KR.eucKR lt_LT.UTF-8 lv_LV.UTF-8
# mn_MN.UTF-8 nb_NO.ISO8859-1 nb_NO.ISO8859-15 nb_NO.UTF-8
# nl_BE.ISO8859-1 nl_BE.ISO8859-15 nl_BE.UTF-8 nl_NL.ISO8859-1
# nl_NL.ISO8859-15 nl_NL.UTF-8 nn_NO.ISO8859-1 nn_NO.ISO8859-15
# nn_NO.UTF-8 no_NO.ISO8859-1 no_NO.ISO8859-15 no_NO.UTF-8
# pl_PL.ISO8859-2 pl_PL.UTF-8 pt_BR.ISO8859-1 pt_BR.UTF-8
# pt_PT.ISO8859-1 pt_PT.ISO8859-15 pt_PT.UTF-8 ro_RO.ISO8859-2
# ro_RO.UTF-8 ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5
# ru_RU.KOI8-R ru_RU.UTF-8 sk_SK.ISO8859-2 sk_SK.UTF-8
# sl_SI.ISO8859-2 sl_SI.UTF-8 sr_YU.ISO8859-2 sr_YU.ISO8859-5
# sr_YU.UTF-8 sv_SE.ISO8859-1 sv_SE.ISO8859-15 sv_SE.UTF-8
# tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.CP1251 uk_UA.ISO8859-5
# uk_UA.KOI8-U uk_UA.UTF-8 zh_CN.GB18030 zh_CN.GB2312
# zh_CN.GBK zh_CN.UTF-8 zh_CN.eucCN zh_HK.Big5HKSCS zh_HK.UTF-8
# zh_TW.Big5 zh_TW.UTF-8
#
# tested okay.
#
# The following locales
#
# lt_LT.ISO8859-13 lt_LT.ISO8859-4 lv_LV.ISO8859-13
#
# had problems.
#
# For more details, rerun, with environment variable PERL_DEBUG_FULL_TEST=1.
ok
lib/Net/hostent ............................................... ok
lib/Net/netent ................................................ skipped
lib/Net/protoent .............................................. ok
lib/Net/servent ............................................... ok
lib/open ...................................................... ok
lib/overload64 ................................................ ok
lib/overloading ............................................... ok
lib/overload .................................................. ok
lib/perl5db ................................................... ok
lib/Pod/t/InputObjects ........................................ ok
lib/Pod/t/Select .............................................. ok
lib/Pod/t/Usage ............................................... ok
lib/Pod/t/utils ............................................... ok
lib/SelectSaver ............................................... ok
lib/sigtrap ................................................... ok
lib/sort ...................................................... ok
lib/strict .................................................... ok
lib/subs ...................................................... ok
lib/Symbol .................................................... ok
lib/Thread .................................................... skipped
lib/Tie/Array/push ............................................ ok
lib/Tie/Array/splice .......................................... ok
lib/Tie/Array/stdpush ......................................... ok
lib/Tie/Array/std ............................................. ok
lib/Tie/ExtraHash ............................................. ok
lib/Tie/Handle/stdhandle_from_handle .......................... ok
lib/Tie/Handle/stdhandle ...................................... ok
lib/Tie/Hash .................................................. ok
lib/Tie/Scalar ................................................ ok
lib/Tie/SubstrHash ............................................ ok
lib/Time/gmtime ............................................... ok
lib/Time/localtime ............................................ ok
lib/Unicode/UCD ............................................... ok
lib/User/grent ................................................ ok
lib/User/pwent ................................................ ok
lib/utf8 ...................................................... ok
lib/vars_carp ................................................. ok
lib/vars ...................................................... ok
lib/vmsish .................................................... ok
lib/warnings .................................................. ok
t/x2p/find2perl ............................................... ok
t/x2p/s2p ..................................................... ok
Failed 1 test out of 2265, 99.96% okay.
  ../lib/Benchmark.t
### Since not all tests were successful, you may want to run some of
### them individually and examine any diagnostic messages they produce.
### See the INSTALL document's section on "make test".
### You have a good chance to get more information by running
### ./perl harness
### in the 't' directory since most (>=80%) of the tests succeeded.
### You may have to set your dynamic library search path,
### LD_LIBRARY_PATH, to point to the build directory​:
### setenv LD_LIBRARY_PATH `pwd`; cd t; ./perl harness
### LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH; cd t; ./perl harness
### export LD_LIBRARY_PATH=`pwd`; cd t; ./perl harness
### for csh-style shells, like tcsh; or for traditional/modern
### Bourne-style shells, like bash, ksh, and zsh, respectively.
u=2.14 s=2.64 cu=357.14 cs=428.22 scripts=2265 tests=700197
*** [test] Error code 1

Stop in /usr/home/shlomif/Download/perl-from-git/perl.

[/QUOTE]

@p5pRT
Copy link
Author

p5pRT commented Mar 6, 2014

From @nwc10

On Thu, Mar 06, 2014 at 08​:38​:21AM -0800, Shlomi Fish via RT wrote​:

Tested now on a FreeBSD 9.2 VM with gcc46 (gcc-4.6). This command​:

sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Doptimize='-O2 -flto' -Dcc=gcc46

Succeeds there with and without the patch. make test succeeds without the patch, and with the patch I am getting this output with a failure in Benchmark (which I recall something that it could fail some time)​:

Cool.

Do we have any non-gcc non-clang tests yet?

Does anyone have a gcc 4.9 development build of gcc to test this?

I seem to remember that Sun's compiler was a particular problem with this
probe, and caused previous code to get reverted. The problem being that
getting this wrong *breaks* the entire platform, whereas not changing it
merely breaks an optimisation, that IIRC is not even the default.

So demonstrating that Sun's compiler, IBM's compiler and HP's were happy
(at least C, hopefully C++ also available on the same machine) feels like
the minimal comfortable check.

Is this patch in a smoke-me branch yet?

That gets some automated testing, and makes it a lot* easier to manually
build on annoying platforms.

Nicholas Clark

* "Yes, we're right with it. We can even handle context diffs"

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2014

From @shlomif

Hi all,

On Thu Mar 06 09​:12​:07 2014, nicholas wrote​:

On Thu, Mar 06, 2014 at 08​:38​:21AM -0800, Shlomi Fish via RT wrote​:

Tested now on a FreeBSD 9.2 VM with gcc46 (gcc-4.6). This command​:

sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel
-Doptimize='-O2 -flto' -Dcc=gcc46

Succeeds there with and without the patch. make test succeeds without
the patch, and with the patch I am getting this output with a failure
in Benchmark (which I recall something that it could fail some time)​:

Cool.

Do we have any non-gcc non-clang tests yet?

Does anyone have a gcc 4.9 development build of gcc to test this?

OK, per your interest, I have now built a gcc-4.9.x and without the patch and with this command​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Doptimize='-O2 -flto' -Dcc=/home/shlomif/apps/prog/gcc-4.9-snapshot/bin/gcc ; n --msg "perl Config"
»

I am getting a build failure in "make" later on (I'll post it shortly) without the patch. With this command-line​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Dcc=/home/shlomif/apps/prog/gcc-4.9-snapshot/bin/gcc ; n --msg "perl Config"
»

everything builds but the following test failures are reported​:

[QUOTE]
Test Summary Report


op/numconvert.t (Wstat​: 0 Tests​: 1444 Failed​: 12)
  Failed tests​: 104, 108, 112, 136, 140, 144, 152, 156
  160, 168, 172, 176
op/range.t (Wstat​: 0 Tests​: 141 Failed​: 25)
  Failed tests​: 84-95, 99-111
Files=2403, Tests=700973, 225 wallclock secs (70.90 usr 5.88 sys + 450.34 cusr 29.56 csys = 556.68 CPU)
Result​: FAIL
[/QUOTE]

I'm on Mageia Linux x86-64 5/Cauldron . I built
gcc-4.9-20140302.tar.bz2 .

Regards,

-- Shlomi Fish

@p5pRT
Copy link
Author

p5pRT commented Mar 8, 2014

From @shlomif

Hi all,

On Fri Mar 07 09​:44​:51 2014, shlomif wrote​:

Hi all,

On Thu Mar 06 09​:12​:07 2014, nicholas wrote​:

On Thu, Mar 06, 2014 at 08​:38​:21AM -0800, Shlomi Fish via RT wrote​:

Tested now on a FreeBSD 9.2 VM with gcc46 (gcc-4.6). This command​:

sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel
-Doptimize='-O2 -flto' -Dcc=gcc46

Succeeds there with and without the patch. make test succeeds
without
the patch, and with the patch I am getting this output with a
failure
in Benchmark (which I recall something that it could fail some
time)​:

Cool.

Do we have any non-gcc non-clang tests yet?

Does anyone have a gcc 4.9 development build of gcc to test this?

OK, per your interest, I have now built a gcc-4.9.x and without the
patch and with this command​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel
-Doptimize='-O2 -flto' -Dcc=/home/shlomif/apps/prog/gcc-4.9-
snapshot/bin/gcc ; n --msg "perl Config"
»

I am getting a build failure in "make" later on (I'll post it shortly)
without the patch.

OK, here is the build failure and the command again​:

«
sh Configure -de -Dprefix=$HOME/apps/perl/bleadperl -Dusedevel -Doptimize='-O2 -flto' -Dcc=/home/shlomif/apps/prog/gcc-4.9-snapshot/bin/gcc ; n --msg "perl Config"
»

«
shlomif@​telaviv1​:~/Download/unpack/perl/p5/git/perl$ make
/home/shlomif/apps/prog/gcc-4.9-snapshot/bin/gcc -o generate_uudmap -fstack-protector -L/usr/local/lib generate_uudmap.o -lnsl -ldl -lm -lcrypt -lutil -lc
/lib/../lib64/crt1.o​: In function `_start'​:
/home/iurt/rpmbuild/BUILD/glibc-2.19/csu/../sysdeps/x86_64/start.S​:118​: undefined reference to `main'
collect2​: error​: ld returned 1 exit status
makefile​:339​: recipe for target 'generate_uudmap' failed
make​: *** [generate_uudmap] Error 1
»

Regards,

-- Shlomi Fish

@p5pRT
Copy link
Author

p5pRT commented Mar 16, 2014

@Tux - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

From @khwilliamson

Thanks for submitting this ticket

The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket

--
Karl Williamson for the Perl 5 porters team

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant