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

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

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
June 7, 2013 07:39
Subject:
Re: dmake can't find config.h, and collector throws error whentrying to compile perl-static.exe (perl-5.18.0 / mingw / 32b)
Message ID:
20130607073846.GJ3729@plum.flirble.org
On Fri, Jun 07, 2013 at 01:17:02AM +0100, Steve Hay wrote:
> On 6 June 2013 19:10, Jan Dubois <jand@activestate.com> wrote:

> > Also, are you sure you are referencing the boot_* symbols of all the
> > submodules as well.  E.g. referencing boot_Encode will not pull in the
> > Encode::CN module, which has it's own XS code.  So you may need to
> > reference boot_Encode_CN (and JP, KR, TW), which together are about
> > 3MB.  There may be other modules which load submodules dynamically, so
> > run a `find . -name *.dll` on a regular Perl on Win32 install and
> > double-check that you have a boot_* reference for all of them.
> >
> 
> I hadn't considered that, but you're quite right: all the Encode
> sub-modules are missing from the list of static extensions which
> perllib.c gets references to.
> 
> I will look into fixing that too, but again it isn't currently a
> problem because Encode is also excluded from the static extension list
> in an ALL_STATIC build.
> 
> Searching for all DLLs in a normal installation shows that it is only
> Encode which has this problem.

There is special-case logic in Configure for Encode:

# Encode is a special case.  If we are building Encode as a static
# extension, we need to explicitly list its subextensions as well.
# For other nested extensions, this is handled automatically by
# the appropriate Makefile.PL.
case " $static_ext " in
	*" Encode "*) # Add the subextensions of Encode
	cd "$rsrc/cpan"
	for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
		static_ext="$static_ext Encode/$xxx"
	done
	cd "$tdir"
	;;
esac


The upshot is that if you have 'Encode' in static_ext, then Configure
adds "Encode/Byte Encode/CN Encode/EBCDIC Encode/JP Encode/KR Encode/Symbol
Encode/TW Encode/Unicode" to static_ext, and then the generated Makefile
lists every *.a file as something to link into the perl binary.

If this fixup doesn't happen (eg you edit config.sh to move Encode from
dynamic_ext to static_ext) the tests fail quite spectacularly, because
Encode loads, but Encode::Unicode doesn't, and various things then get
very confused, for example recursing deeply until they crash.


So I guess this special case is also needed for Win32.

Nicholas Clark

Thread Previous | 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