Bug 717675 - golly-2.2-4 does not compile against perl 5.14
Summary: golly-2.2-4 does not compile against perl 5.14
Alias: None
Product: Fedora
Classification: Fedora
Component: golly
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Eric Smith
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-06-29 14:41 UTC by Petr Pisar
Modified: 2011-07-26 20:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-07-26 20:29:23 UTC
Type: ---

Attachments (Terms of Use)

Description Petr Pisar 2011-06-29 14:41:33 UTC
While rebuilding all Perl packages against 5.14 interpreter (currently in deficated dist-f16-perl build root), we found following bug:

g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wl,-z,relro -m64 -mtune=generic -DGOLLYDIR="/usr/share/golly" -o golly ObjGTK/bigint.o ObjGTK/lifealgo.o ObjGTK/hlifealgo.o ObjGTK/hlifedraw.o ObjGTK/qlifealgo.o ObjGTK/qlifedraw.o ObjGTK/jvnalgo.o ObjGTK/ruletreealgo.o ObjGTK/ruletable_algo.o ObjGTK/ghashbase.o ObjGTK/ghashdraw.o ObjGTK/readpattern.o ObjGTK/writepattern.o ObjGTK/liferules.o ObjGTK/util.o ObjGTK/liferender.o ObjGTK/viewport.o ObjGTK/lifepoll.o ObjGTK/generationsalgo.o ObjGTK/wxutils.o ObjGTK/wxprefs.o ObjGTK/wxalgos.o ObjGTK/wxrule.o ObjGTK/wxinfo.o ObjGTK/wxhelp.o ObjGTK/wxstatus.o ObjGTK/wxview.o ObjGTK/wxrender.o ObjGTK/wxscript.o ObjGTK/wxperl.o ObjGTK/wxpython.o ObjGTK/wxfile.o ObjGTK/wxedit.o ObjGTK/wxcontrol.o ObjGTK/wxtimeline.o ObjGTK/wxundo.o ObjGTK/wxselect.o ObjGTK/wxlayer.o ObjGTK/wxmain.o ObjGTK/wxgolly.o  -lz `wx-config --libs`  `perl -MExtUtils::Embed -e '$]<5.010 && ldopts'`
ObjGTK/wxperl.o: In function `xs_init':
/builddir/build/BUILD/golly-2.2-src/wxperl.cpp:3057: undefined reference to `PL_thr_key'
/builddir/build/BUILD/golly-2.2-src/wxperl.cpp:3066: undefined reference to `PL_thr_key'
/builddir/build/BUILD/golly-2.2-src/wxperl.cpp:3067: undefined reference to `PL_thr_key'
/builddir/build/BUILD/golly-2.2-src/wxperl.cpp:3068: undefined reference to `PL_thr_key'
/builddir/build/BUILD/golly-2.2-src/wxperl.cpp:3069: undefined reference to `PL_thr_key'
ObjGTK/wxperl.o:/builddir/build/BUILD/golly-2.2-src/wxperl.cpp:3070: more undefined references to `PL_thr_key' follow
collect2: ld returned 1 exit status

Linker cannot link resulting executable because wxperl.cpp contains code

newXS((char*)"DynaLoader::boot_DynaLoader", boot_DynaLoader, (char*)file);

that expands to

G_Perl_newXS(((PerlInterpreter *)pthread_getspecific(PL_thr_key)), (char*)"DynaLoader::boot_DynaLoader",G_boot_DynaLoader,(char*)file);

where PL_thr_key is defined as external.

Perl 5.12 gives:

G_Perl_newXS(((PerlInterpreter *)pthread_getspecific((*G_Perl_Gthr_key_ptr(__null)))), (char*)"DynaLoader::boot_DynaLoader",G_boot_DynaLoader,(char*)file);

This is because perl 5.14 stopped defining PL_thr_key (see new condition with PERL_GLOBAL_STRUCT in perlapi.h and commit 87b9e16005b9e39b8a24388159e899fe54b95979 in upstream perl git repository).

We are postponing this bug now, this report is just a reminder for later investigation. Posting question to upstream regarding perl 5.14 compatibility would be great (we are not sure currently if this is not a bug in Fedora perl).

Short test case is running following code through preprocedsor:

#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>

#define xstr(s) str(s)
#define str(s) #s

newXS((char*)"DynaLoader::boot_DynaLoader", boot_DynaLoader, (char*)file);

You will get different results in perl 5.12 and 5.14.

Comment 1 Eric Smith 2011-07-22 19:42:58 UTC
Thanks for your work in isolating the problem. I've inquired upstream on the golly-test mailing list.

Comment 2 Eric Smith 2011-07-26 20:29:23 UTC
Patch added in rawhide.

Note You need to log in before you can comment on or make changes to this bug.