Bug 195473 - invalid use of ‘register’ in linkage specification
invalid use of ‘register’ in linkage specification
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: perl (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-15 09:19 EDT by John Ellson
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-19 20:17:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description John Ellson 2006-06-15 09:19:40 EDT
Created attachment 130972 [details]
small test case
Comment 1 John Ellson 2006-06-15 09:19:40 EDT
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 10:21:56 EDT
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.