develooper Front page | perl.perl5.porters | Postings from June 2013

RE: dmake can't find config.h, and collector throws error when trying to compile perl-static.exe (perl-5.18.0 / mingw / 32b)

Thread Previous | Thread Next
Steve Hay
June 4, 2013 08:15
RE: dmake can't find config.h, and collector throws error when trying to compile perl-static.exe (perl-5.18.0 / mingw / 32b)
Message ID:
Tony Cook wrote on 2013-06-04:
> On Mon, Jun 03, 2013 at 08:59:15AM +0100, Steve Hay wrote:
>> Yes, reading the docs for GNU ar I see that it does indeed, and it
>   looks like there is no other way to do this than to extract the
>   object files from each extension's archive and then archive all the
>   extracted object files into the perl static library. I will look at
>   doing this soon unless anyone would like to do it sooner.
> Rather than trying to combine the libraries, would it be better to
> simply make it behave more like the Makefile.SH Makefiles - treat all
> of the extensions as static so their .lib/.a files are linked into
> perl itself.
> This skips the creation of the separate perl518s.lib.

Interestingly, the perl-static.exe target's recipe already links all the
static extensions directly into perl-static.exe, so it doesn't seem to
need to link in (the currently broken) perl519s.lib/libperl519s.a as
well anyway!

Thus, I thought that simply removing the creation of that static library
rather than trying to fix it (together with linking in the core perl
objects, which are the other thing being picked up from the static
library) would solve the problem. (See patch attached.)

However, this doesn't work either: with the BUILD_STATIC=define option I
get the exact same ld/collect error as before regarding _boot_Win32CORE.
So I'm now thinking that something else is amiss here, i.e. it was
incidental that the static library wrongly contained other libraries
instead of the intended objects because all the other libraries are
linked in anyway. Something else is the real cause of the problem here,
but I don't know what yet.

The end of the output from the patched (which includes a
little debug output) is:

..\av.o ..\deb.o ..\doio.o ..\doop.o ..\dump.o ..\globals.o ..\gv.o
..\mro.o ..\
hv.o ..\locale.o ..\keywords.o ..\mathoms.o ..\mg.o ..\numeric.o ..\op.o
o ..\perl.o ..\perlapi.o ..\perly.o ..\pp.o ..\pp_ctl.o ..\pp_hot.o
 ..\pp_sort.o ..\pp_sys.o ..\reentr.o ..\regcomp.o ..\regexec.o ..\run.o
e.o ..\sv.o ..\taint.o ..\toke.o ..\universal.o ..\utf8.o ..\util.o
perllib.o ..
\perlio.o .\win32.o .\win32sck.o .\win32thread.o .\fcrypt.o .\win32io.o
oader.o                   -lmoldname -lkernel32 -luser32 -lgdi32
  -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32
-loleaut32 -ln
etapi32 -luuid -lws2_32 -lmpr             -lwinmm -lversion -lodbc32
-lcomctl32 perlmainst.o .\perlexe.res
g++ -mconsole -o ..\perl-static.exe  -s -L"c:\perl\lib\CORE"
MinGW\lib" \
perllib.o:perllib.c:(.text+0x9c): undefined reference to
collect2.exe: error: ld returned 1 exit status
dmake:  Error code 129, while making '..\perl-static.exe'

I don't know why it isn't finding _boot_Win32CORE. It's surely in
..\lib\auto\Win32CORE\Win32CORE.a (right?), and that file does indeed
exist in that location.

I will continue digging later.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About