Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win32 builds with dmake/gmake don't install libperl523.(a|lib) #15187

Closed
p5pRT opened this issue Feb 17, 2016 · 12 comments
Closed

Win32 builds with dmake/gmake don't install libperl523.(a|lib) #15187

p5pRT opened this issue Feb 17, 2016 · 12 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 17, 2016

Migrated from rt.perl.org#127556 (status was 'resolved')

Searchable as RT127556$

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

From @tonycoz

Building perl with​:

  dmake *build-options* install

or

  gmake *build-options* install

doesn't install libperl523.dll into the target lib\CORE directory.

It doesn't build lib\CORE\libperl523.dll at all.

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

From @tonycoz

On Tue Feb 16 19​:25​:34 2016, tonyc wrote​:

Building perl with​:

dmake *build-options* install

or

gmake *build-options* install

doesn't install libperl523.dll into the target lib\CORE directory.

It doesn't build lib\CORE\libperl523.dll at all.

The attached seems to fix it.

Tony

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

From @tonycoz

0001-let-the-definition-of-PERLDEP-see-the-definition-of-.patch
From 9dd4b2806e0d9cc1533550c174613a69fc8f96b3 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 17 Feb 2016 15:41:41 +1100
Subject: let the definition of PERLDEP see the definition of PERLIMPLIB

PERLIMPLIB wasn't being built, resulting in build failures of
XS modules after perl was installed.

Since installperl installs from the base of the source tree rather
than from lib/CORE, copy $(PERLIMPLIB) to the base of the tree.
---
 win32/GNUmakefile | 14 +++++++-------
 win32/makefile.mk | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 92d4528..2cdaef9 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -815,13 +815,6 @@ PERLEXE_ICO	= .\perlexe.ico
 PERLEXE_RES	= .\perlexe.res
 PERLDLL_RES	=
 
-# Nominate a target which causes extensions to be re-built
-# This used to be $(PERLEXE), but at worst it is the .dll that they depend
-# on and really only the interface - i.e. the .def file used to export symbols
-# from the .dll
-PERLDEP = $(PERLIMPLIB)
-
-
 PL2BAT		= bin\pl2bat.pl
 
 UTILS		=			\
@@ -881,6 +874,12 @@ PERLEXPLIB	?= $(COREDIR)\perl523.exp
 PERLSTATICLIB	?= ..\perl523s$(a)
 PERLDLL		= ..\perl523.dll
 
+# Nominate a target which causes extensions to be re-built
+# This used to be $(PERLEXE), but at worst it is the .dll that they depend
+# on and really only the interface - i.e. the .def file used to export symbols
+# from the .dll
+PERLDEP = $(PERLIMPLIB)
+
 # don't let "gmake -n all" try to run "miniperl.exe make_ext.pl"
 PLMAKE		= gmake
 
@@ -1373,6 +1372,7 @@ ifeq ($(CCTYPE),GCC)
 else
 	lib -def:perldll.def -machine:$(ARCHITECTURE) /OUT:$(PERLIMPLIB)
 endif
+	$(XCOPY) $(PERLIMPLIB) ..
 
 $(PERLDLL): $(PERLEXPLIB) $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
 ifeq ($(CCTYPE),GCC)
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 2403aa7..2b8f02a 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -801,13 +801,6 @@ PERLEXE_ICO	= .\perlexe.ico
 PERLEXE_RES	= .\perlexe.res
 PERLDLL_RES	=
 
-# Nominate a target which causes extensions to be re-built
-# This used to be $(PERLEXE), but at worst it is the .dll that they depend
-# on and really only the interface - i.e. the .def file used to export symbols
-# from the .dll
-PERLDEP = $(PERLIMPLIB)
-
-
 PL2BAT		= bin\pl2bat.pl
 
 UTILS		=			\
@@ -865,6 +858,12 @@ PERLEXPLIB	*= $(COREDIR)\perl523.exp
 PERLSTATICLIB	*= ..\perl523s$(a)
 PERLDLL		= ..\perl523.dll
 
+# Nominate a target which causes extensions to be re-built
+# This used to be $(PERLEXE), but at worst it is the .dll that they depend
+# on and really only the interface - i.e. the .def file used to export symbols
+# from the .dll
+PERLDEP = $(PERLIMPLIB)
+
 #EUMM on Win32 isn't ready for parallel make, so only allow this file to be parallel
 #$(MAKE) will contain the -P that this makefile was called with, which is bad for
 #make_ext.pl since upto jobs*jobs processes will run instead of jobs
@@ -1345,6 +1344,7 @@ $(PERLEXPLIB) $(PERLIMPLIB) .UPDATEALL : perldll.def
 .ELSE #VC family
 	lib -def:perldll.def -machine:$(ARCHITECTURE) /OUT:$(PERLIMPLIB)
 .ENDIF
+	$(XCOPY) $(PERLIMPLIB) ..
 
 $(PERLDLL): $(PERLEXPLIB) $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
 .IF "$(CCTYPE)" == "GCC"
-- 
2.7.0.windows.1

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

From @bulk88

On Tue Feb 16 20​:42​:49 2016, tonyc wrote​:

On Tue Feb 16 19​:25​:34 2016, tonyc wrote​:

Building perl with​:

dmake *build-options* install

or

gmake *build-options* install

doesn't install libperl523.dll into the target lib\CORE directory.

It doesn't build lib\CORE\libperl523.dll at all.

The attached seems to fix it.

Tony

I created a different patch that fixes the problem, it is attached. I dont think your complaint of "PERLDEP = $(PERLIMPLIB)" is valid. Yes in a "make -pn" PERLDEP is undefinedish in the macro DB dump, but by the time PERLDEP is used/interpolated in a target/recipe much further down, PERLIMPLIB has been defined so PERLDEP isn't buggy.

If I add


win32/makefile.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Inline Patch
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 2403aa7..e9b19d7 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -27,7 +27,7 @@
 # newly built perl.
 #
 INST_DRV	*= c:
-INST_TOP	*= $(INST_DRV)\perl
+INST_TOP	*= $(INST_DRV)\p523
 
 #
 # Uncomment if you want to build a 32-bit Perl using a 32-bit compiler
@@ -1436,6 +1436,8 @@ Extensions_normalize : $(PERLDEP) $(DYNALOADER) $(GLOBEXE) $(UNIDATAFILES)
 Extensions_reonly : $(PERLDEP) $(DYNALOADER)
 	$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
 
+makepd: $(PERLDEP)
+
 Extensions_static : ..\make_ext.pl list_static_libs.pl $(CONFIGPM) $(GLOBEXE) $(HAVE_COREDIR)
 	$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(PLMAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
 	$(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
------------------------------------------------------------------

and do "dmake -pn makepd CCTYPE=MSVC120" the output looks correct

link -out​:..\miniperl.exe "/manifestdependency​:type='Win32' name='Microsoft.Wind
ows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken=
'6595b64144ccf1df' language='*'" -nologo -nodefaultlib -debug -opt​:ref,icf -ltcg
  -libpath​:"c​:\p523\lib\CORE" -machine​:x86 -subsystem​:
console,"5.01" \
  @​C​:\Users\Owner\AppData\Local\Temp\mk4
if exist ..\miniperl.exe.manifest mt -nologo -manifest ..\miniperl.exe.manifest
-outputresource​:..\miniperl.exe;1 && if exist ..\miniperl.exe.manif
est del ..\miniperl.exe.manifest
..\miniperl.exe -I..\lib -f ..\write_buildcustomize.pl ..
..\miniperl.exe -I..\lib config_sh.PL --cfgsh-option-file \
  C​:\Users\Owner\AppData\Local\Temp\mk5 config.vc > ..\config.sh
..\miniperl.exe -I..\lib ..\configpm --chdir=..
..\miniperl.exe -I..\lib config_h.PL "ARCHPREFIX="
..\miniperl.exe -I..\lib -w ..\makedef.pl PLATFORM=win32 -O1 -MD -Zi -DNDEBUG -G
L -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DE
PRECATE \
  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DW
IN32_NO_REGISTRY CCTYPE=MSVC120 TARG_DIR=..\ > perldll.def
lib -def​:perldll.def -machine​:x86 /OUT​:..\lib\CORE\perl523.lib


--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

From @bulk88

On Wed Feb 17 14​:35​:09 2016, bulk88 wrote​:

I created a different patch that fixes the problem, it is attached.

Patch attached.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2016

From @bulk88

0001-perl-127556-update-installperl-to-new-location-of-W3.patch
From f730e5664c3fbe9fdfbd94925e333e3b29f812a5 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Wed, 17 Feb 2016 15:35:11 -0500
Subject: [PATCH] [perl #127556] update installperl to new location of W32
 libperl link lib

commit bf543eaf90 made the Win32 GCC or VC linkers produce
[lib]perl[5xx].[a/lib] in the /lib/CORE dir to reduce the prereq recipie
lines needing to run until XS modules can be built ("Extensions" which
builds all DLL XS modules is the longest running target and every effort
should be made for it to be started sooner by the make tool in parallel
build). The file is now made in /lib/CORE, previously it was made in root
and xcopy-ed to /lib/CORE in the same target that built the file. xcopy is
a seperate process run so was remove in that commit.

installperl doesn't use uninstalled /lib/CORE to determine the contents of
installed /lib/CORE (maybe that is a bug or bad design?), so the linking
lib was not being installed after a "[g/d]make install" making it
impossible to compile XS code on Win32 Perl. Change installperl
to look for the linking lib in /lib/CORE on Win32 and not in root. Even
though the nmake makefile still does the XCOPY since it is older/less
maintained, the installperl code still works since the root and /lib/CORE
files are identical on the nmake build and built in the same target.
---
 installperl | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/installperl b/installperl
index 5ea37be..f4d850b 100755
--- a/installperl
+++ b/installperl
@@ -373,6 +373,8 @@ elsif ($Is_Cygwin) { # On Cygwin symlink it to CORE to make Makefile happy
     ( copy("$installbin/$libperl", $coredll) &&
       push(@corefiles, $instcoredll)
     )
+} elsif ($Is_W32) {
+    @corefiles = <*.h>;
 } else {
     # [als] hard-coded 'libperl' name... not good!
     @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
@@ -393,6 +395,13 @@ foreach my $file (@corefiles) {
     }
 }
 
+if ($Is_W32) { #linking lib isn't made in root but in CORE on Win32
+    @corefiles = <lib/CORE/libperl*.* lib/CORE/perl*$Config{lib_ext}>;
+    my $dest;
+    copy_if_diff($_,($dest = $installarchlib.substr($_,3))) &&
+	chmod($NON_SO_MODE, $dest) foreach @corefiles;
+}
+
 # Install main perl executables
 # Make links to ordinary names if installbin directory isn't current directory.
 
-- 
1.9.5.msysgit.1

@p5pRT
Copy link
Author

p5pRT commented Feb 18, 2016

From @tonycoz

On Wed Feb 17 14​:35​:09 2016, bulk88 wrote​:

I created a different patch that fixes the problem, it is attached. I
dont think your complaint of "PERLDEP = $(PERLIMPLIB)" is valid. Yes
in a "make -pn" PERLDEP is undefinedish in the macro DB dump, but by
the time PERLDEP is used/interpolated in a target/recipe much further
down, PERLIMPLIB has been defined so PERLDEP isn't buggy.

I think you're right, I might have made a mistake while trying to diagnose it.

Subject​: [PATCH] [perl #127556] update installperl to new location of W32 libperl link lib

If you want the [perl #127556] preserved, create the patch with the -k option which skips adding the [PATCH], I've manually fixed it this time.

The without -k git am strips all [...] from the subject rather than sensibly stripping just [PATCH].

Thanks, applied your patch as 3bf3236.

Tony

@p5pRT
Copy link
Author

p5pRT commented Feb 18, 2016

@tonycoz - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Feb 18, 2016

From @bulk88

On Wed Feb 17 16​:29​:45 2016, tonyc wrote​:

Subject​: [PATCH] [perl #127556] update installperl to new location of
W32 libperl link lib

If you want the [perl #127556] preserved, create the patch with the -k
option which skips adding the [PATCH], I've manually fixed it this
time.

The without -k git am strips all [...] from the subject rather than
sensibly stripping just [PATCH].

my git gui runs "git.exe format-patch -o "C​:/p523/src" -1" internally, I dont think I can change it (tortoisegit).

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

From @khwilliamson

Thank you for submitting this report. You have helped make Perl better.
 
With the release of Perl 5.24.0 on May 9, 2016, this and 149 other issues have been resolved.

Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant