Bug in perl, yet another one

Some design bug of perl for win32 for GCC build;

These lines in win32/GNUmakefile :
$(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
ifeq ($(CCTYPE),GCC)
	$(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
	if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
	for %%i in ($(shell type Extensions_static)) do \
		@mkdir $(STATICDIR) && cd $(STATICDIR) && \
		$(ARCHPREFIX)ar x ..\%%i && \
		$(ARCHPREFIX)ar q ..\$@ *$(o) && \
		cd .. && rmdir /s /q $(STATICDIR)
else
	$(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \
	    $(PERLDLL_OBJ)
endif
	$(XCOPY) $(PERLSTATICLIB) $(COREDIR)

....these lines assume that object files from different directories are diff=
erent, but this is not so

Namely, we have 2 different Util.a in extensions, which are=20
\lib\auto\Hash\Util\Util.a
\lib\auto\List\Util\Util.a

IOW resulting libperl527s.a it is, well, correctly hold .o for core perl, b=
ut adding extension's .a there is not good;

Vadim
0
Vadim
3/11/2018 8:42:52 AM
perl.perl5.porters 47298 articles. 0 followers. Follow

4 Replies
52 Views

Similar Articles

[PageSpeed] 20

What originally designed purpose of this libperl527s.a BTW, who knows?

-----Original Message-----
From: Konovalov, Vadim [mailto:Vadim.Konovalov@dell.com]=20
Sent: Sunday, March 11, 2018 11:43 AM
To: perl5-porters@perl.org
Subject: Bug in perl, yet another one

Some design bug of perl for win32 for GCC build;

These lines in win32/GNUmakefile :
$(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
ifeq ($(CCTYPE),GCC)
	$(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
	if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
	for %%i in ($(shell type Extensions_static)) do \
		@mkdir $(STATICDIR) && cd $(STATICDIR) && \
		$(ARCHPREFIX)ar x ..\%%i && \
		$(ARCHPREFIX)ar q ..\$@ *$(o) && \
		cd .. && rmdir /s /q $(STATICDIR)
else
	$(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \
	    $(PERLDLL_OBJ)
endif
	$(XCOPY) $(PERLSTATICLIB) $(COREDIR)

....these lines assume that object files from different directories are diff=
erent, but this is not so

Namely, we have 2 different Util.a in extensions, which are=20
\lib\auto\Hash\Util\Util.a
\lib\auto\List\Util\Util.a

IOW resulting libperl527s.a it is, well, correctly hold .o for core perl, b=
ut adding extension's .a there is not good;

Vadim
0
Vadim
3/13/2018 8:52:36 AM
Konovalov, Vadim wrote:
> What originally designed purpose of this libperl527s.a BTW, who knows?
>=20
> -----Original Message-----
> From: Konovalov, Vadim [mailto:Vadim.Konovalov@dell.com]=20
> Sent: Sunday, March 11, 2018 11:43 AM
> To: perl5-porters@perl.org
> Subject: Bug in perl, yet another one
>=20
> Some design bug of perl for win32 for GCC build;
>=20
> These lines in win32/GNUmakefile :
> $(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static
> ifeq ($(CCTYPE),GCC)
> 	$(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ)
> 	if exist $(STATICDIR) rmdir /s /q $(STATICDIR)
> 	for %%i in ($(shell type Extensions_static)) do \
> 		@mkdir $(STATICDIR) && cd $(STATICDIR) && \
> 		$(ARCHPREFIX)ar x ..\%%i && \
> 		$(ARCHPREFIX)ar q ..\$@ *$(o) && \
> 		cd .. && rmdir /s /q $(STATICDIR)
> else
> 	$(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \
> 	    $(PERLDLL_OBJ)
> endif
> 	$(XCOPY) $(PERLSTATICLIB) $(COREDIR)
>=20
.........................
>=20
> IOW resulting libperl527s.a it is, well, correctly hold .o for core perl,=
 but adding extension's .a there is not good;
>=20
> Vadim

You designed it.

https://perl5.git.perl.org/perl.git/commitdiff/4e036e4bbba6d063b01c50038bdc=
634716ef4439
https://www.nntp.perl.org/group/perl.perl5.porters/2006/11/msg118012.html
0
bulk88
4/9/2018 8:06:06 PM
> > Konovalov, Vadim wrote:
> > What originally designed purpose of this libperl527s.a BTW, who knows?
> > Vadim

> You designed it.
> https://perl5.git.perl.org/perl.git/commitdiff/4e036e4bbba6d063b01c50038b=
dc634716ef4439
> https://www.nntp.perl.org/group/perl.perl5.porters/2006/11/msg118012.html

Wow, thanks! :)
I knew it should be someone who did it!

Actually at that time static build was designed into win32 perl, but was ev=
en more broken;=20
Now the time is come to make it working completely, I think >:)
0
Vadim
4/10/2018 8:15:47 AM
> > > Konovalov, Vadim wrote:
> > > What originally designed purpose of this libperl527s.a BTW, who knows=
?
> > > Vadim
>=20
> > You designed it.
> >
> https://perl5.git.perl.org/perl.git/commitdiff/4e036e4bbba6d063b01c50038b=
dc634716ef4439=20
> https://www.nntp.perl.org/group/perl.perl5.porters/2006/11/msg118012.html

> Wow, thanks! :)
> I knew it should be someone who did it!

Now after we've discovered who knows that, I realized that - in order to li=
nk "large" DLL and/or
EXE, we need to have all statically linked modules to be fed to linker, bec=
ause perllib.c has=20
bootstrap call to each and single one;

....
    newXS("B::bootstrap", boot_B, file);
    newXS("Compress::Raw::Bzip2::bootstrap", boot_Compress__Raw__Bzip2, fil=
e);
    newXS("Compress::Raw::Zlib::bootstrap", boot_Compress__Raw__Zlib, file)=
;
    newXS("Cwd::bootstrap", boot_Cwd, file);
    newXS("Data::Dumper::bootstrap", boot_Data__Dumper, file);
....

Now the problems with modules with same names should be fixed;
Also, I think 'extralibs.ld' should more correctly be handled

I think I'll create a bug ticket, eventually :)

> Actually at that time
> static build was designed into win32 perl, but was even more broken; Now =
the
> time is come to make it working completely, I think >:)
>
0
Vadim
4/18/2018 8:05:09 PM
Reply: