develooper Front page | perl.perl5.porters | Postings from November 2005

Undefined Symbol on MinGW

Thread Next
From:
Timm Murray
Date:
November 28, 2005 09:20
Subject:
Undefined Symbol on MinGW
Message ID:
200511281122.19697.tmurray-p5p@wumpus-cave.net
I have perl-5.8.7 built with MinGW and I've been trying to get SDL_perl to 
build against it.  I think I've narrowed the issue down to a problem during 
the Perl build process.

The main SDL_perl DLL is being linked with this command

----
g++ -o "blib\arch\auto\SDL_perl\SDL_perl.dll" 
-Wl,--base-file,"src\SDL_perl.base"
-Wl,--image-base,0x23210000 -mdll -s "src\SDL_perl.lds"
"blib\arch\auto\SDL_perl\SDL_perl.exp" -Le:\perl-5.8.7\lib\CORE
-Le:\msys\1.0\mingw\lib -lmingw32 -lSDLmain -lSDL
----

Which gives this error:

----
blib\arch\auto\SDL_perl\SDL_perl.exp(.edata+0x50):fake: undefined reference to
`boot_'
blib\arch\auto\SDL_perl\SDL_perl.exp(.edata+0x54):fake: undefined reference to
`boot_'
collect2: ld returned 1 exit status
----

Using nm, I cannot find a library on my system that has a 'boot_' symbol.

The linking command references the SDL_perl.exp file, which in turn is created 
from SDL_perl.def by dlltool.  The .def file is created using 
ExtUtils::Mksymlists.  This file looks like this:

----
EXPORTS
  boot_
  _boot_ = boot_
  
----

That boot seems to be inserted by this line in ExtUtils::Mksymlists (around 
line 40):

----
push(@{$spec{FUNCLIST}},"boot_$packprefix") unless $bootseen;
----

If $packprefix was an empty string here, it would put "boot_" into the array, 
which eventually gets put in the file seen above.

Mksymlists seems to get an empty $packprefix because of an entry in 
win32/config.vc:

----
static_ext=' '
----

A mailing list thread for Cygwin shows a very similar problem:

http://64.62.136.189/cygwin@cygwin.com/msg58275.html

The explaination there was that static_ext gets split according to Perl's 
rules, which ends up putting in an empty string, which eventually gets 
translated to 'boot_' as seen above.  I'm not sure of the details beyond 
that, but it seems to work out.

So how do I get Perl to stop creating this 'boot_' entry?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About