Bug 195473 - invalid use of âregisterâ in linkage specification
Summary: invalid use of âregisterâ in linkage specification
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-06-15 13:19 UTC by John Ellson
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-20 00:17:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
small test case (605 bytes, application/octet-stream)
2006-06-15 13:19 UTC, John Ellson
no flags Details

Description John Ellson 2006-06-15 13:19:40 UTC
Created attachment 130972 [details]
small test case

Comment 1 John Ellson 2006-06-15 13:19:40 UTC
Description of problem:
I think the right explanation of this problem is that gcc-4.1.1-3 is a little
more pedantic than earlier versions and has exposed a bug in the perl headers.
On this basis I'm reporting the bug against perl.

Attempting to build a swig-generated perl extension, like the attached example,
produces many errors like:

   /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perlvars.h:35: error:
invalid use of âregisterâ in linkage specification


A workaround is to "#define register"    (i.e. null out the register keywork
completely)


Version-Release number of selected component (if applicable):
perl-5.8.8-6
gcc-4.1.1-3
swig-1.3.29-0.1


How reproducible:
100%
problem verified on x86_64 and i386 platforms

Steps to Reproduce:
1. zcat bug.tgz | tar xf -
2. cd bug
3. make
  
Actual results:
swig -c++ -perl5 -o example_wrap.cpp example.i
/usr/bin/g++  -I`perl -e 'use Config; print $Config{archlib};'`/CORE -fPIC -DPIC
 -c -o example_wrap.o example_wrap.cpp
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/thrdvar.h:34: error:
invalid use of âregisterâ in linkage specification
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/thrdvar.h:38: error:
invalid use of âregisterâ in linkage specification
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/thrdvar.h:40: error:
invalid use of âregisterâ in linkage specification
...
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perlvars.h:66: error:
invalid use of âregisterâ in linkage specification
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perlvars.h:69: error:
invalid use of âregisterâ in linkage specification
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perlvars.h:73: error:
invalid use of âregisterâ in linkage specification
example_wrap.cpp:1421: error: invalid use of âregisterâ in linkage specification
example_wrap.cpp:1871: error: invalid use of âregisterâ in linkage specification
make: *** [example_wrap.o] Error 1


Expected results:
(uncomment the hack that adds "#define register" in Makefile)

$ make clean
rm -f *.o example_wrap.cpp example.pm libexample*
$ make
swig -c++ -perl5 -o example_wrap.cpp example.i
(echo "#define register"; cat example_wrap.cpp) >example_wrap.cpp.tmp
mv -f example_wrap.cpp.tmp example_wrap.cpp
/usr/bin/g++  -I`perl -e 'use Config; print $Config{archlib};'`/CORE -fPIC -DPIC
 -c -o example_wrap.o example_wrap.cpp
/usr/bin/g++  -I`perl -e 'use Config; print $Config{archlib};'`/CORE -fPIC -DPIC
 -c -o example.o example.cpp
g++ -shared example_wrap.o example.o -o libexample.so
$ ./example.pl
24


Additional info:

Comment 2 John Ellson 2006-06-27 14:21:56 UTC
I guess it was a gcc-4.1.1-3 bug.   Problem is gone now with:

perl-5.8.8-6
gcc-4.1.1-5
swig-1.3.29-0.1



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