Hi All.

The issue is getting a basic resource file with version info that can be compiled into the pp executables.

With standard microsoft tools, the process is as follows:

Start with a Win32.rc file (it could be named anything.rc, but we'll use Win32/ Win64 for explanation).

The .rc file is a plaintext file that describes the version info. It can also specify icons and other resources to import. It is platform agnostic. For pp we want version info, and an icon. We need to test what happens if we add a basic manifest and an MS compiler also adds a manifest for dependencies. I think it should work ...

Teh rc file gets converted to a .RES file using the rc compiler
rc Win32.rc Win32.RES

This is still platform agnostic.

The next step is where we get platform specific. The ms tools will produce usable obj / coff files, for specific architectures

cvtres /MACHINE:X86 /OUT:Win32.COFF Win32.RES
cvtres /MACHINE:X86 /OUT:Win32.OBJ Win32.RES
cvtres /MACHINE:AMD64 /OUT:Win64.COFF Win32.RES
cvtres /MACHINE:AMD64 /OUT:Win64.OBJ Win32.RES
cvtres /MACHINE:IA64 /OUT:Win64.OBJ Win32.RES

and you have an object you can pass to the linker.

The problem arises when using mingw32 / mingw-w64.
The resource compilers (windres etc) often choke at various points, although latest version with mingw-w64 seems to work .. sometimes.

Solution for pp would appear to be:

create objects as follows, for use instead of Win32.obj / coff

ppres_x86.coff
ppres_x86.obj
ppres_amd64.coff
ppres_amd64.obj
ppres_ia64.obj  ? (is this needed )

When creating makefile, specify correct resource for linking depending on compiler and platform.

I can create and upload the above objects to SVN and also the source used:

ppres.rc
ppres.ico
ppres.RES

but I won't have the time to become familiar enough with the makefile writing process to do the right thing there. At least not in the immediate future.

I would be happy to test any changes against compilation with mingw32, mingw-w32, mingw-w64 and VC6. If someone else could chip in with some tests against modern MS compilers, that would be nice.

In the interim, I'll also prepare a zip containing

Win32.rc
Win32.RES
Win32.OBJ
Win32.COFF

which are for amd64 architecture - this could be unzipped over the downloaded pp source and you should be able to build a working pp on amd64 architecture from current code. It's ugly but it will give an instant fix.

Regards

Mark


On 30/03/2011 23:13, Roderich Schupp wrote:
Hi Bob,

I'm forwarding this to the [email protected] mailing list. This is
generally the first address to turn
to with questions and problems about PAR, PAR::Packer, Module::ScanDeps and
related stuff. You can also find it as "perl.par" in Google Groups.

As for your problem: the "prototype mismatch" warning is harmless and the
win32.coff is serious. Yes, this file probably needs a 64 bit replacement
when building on 64 bit Windows, but I know next to nothing about this subject.
I've cc'ed Mark Dootson which maintains Win32::Exe and who has apparently
already ventured into 64 bit Windows land.

Cheers, Roderich



---------- Forwarded message ----------
From: Bob R<[email protected]>
Date: Wed, Mar 30, 2011 at 10:18 PM
Subject: PP failure
To: [email protected]


Hi,

I downloaded the latest Par-Packer (1.09) today and tried installing
it but it failed. I have to run on Windoze here so I have Windows 7
and 64 bit Pentium dual processor. I’m running Strawberry Perl V
5.12.2. I may even be something doing wrong. I’m not all that great at
C and am just learning XS, but if there is anything I can do to help
out here please let me know. I recently helped out Cosimo on the API
package by testing it on a 64 bit system for several runs and he got
it working in a week or so. Here are my messages in loading – there
seem to be two reported errors – prototype mismatch on the makefile
and then the same one that was there in version 1.08, the Win32.coff
file:

D:\MyPerl\Perl\Programs\XS\Development\PAR-Packer-1.009>makefile.pl
Checking if your kit is complete...
Looks good
Prototype mismatch: sub main::prompt: none vs ($;$) at C:/strawberry/perl/lib/Ex
tUtils/MakeMaker.pm line 202
Writing Makefile for par.exe
Writing Makefile for PAR::Packer

D:\MyPerl\Perl\Programs\XS\Development\PAR-Packer-1.009>dmake
cp lib/App/Packer/PAR.pm blib\lib\App\Packer\PAR.pm
cp lib/PAR/Packer.pm blib\lib\PAR\Packer.pm
cp lib/PAR/Filter/Obfuscate.pm blib\lib\PAR\Filter\Obfuscate.pm
cp lib/PAR/Filter/PodStrip.pm blib\lib\PAR\Filter\PodStrip.pm
cp lib/PAR/StrippedPARL/Base.pm blib\lib\PAR\StrippedPARL\Base.pm
cp lib/PAR/Filter.pm blib\lib\PAR\Filter.pm
cp lib/PAR/Filter/PatchContent.pm blib\lib\PAR\Filter\PatchContent.pm
cp lib/PAR/Filter/Bytecode.pm blib\lib\PAR\Filter\Bytecode.pm
cp lib/pp.pm blib\lib\pp.pm
cp lib/PAR/Filter/Bleach.pm blib\lib\PAR\Filter\Bleach.pm
C:\strawberry\perl\bin\perl.exe sha1.c.PL
gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE  -DUSE_SITECUSTOM
IZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfie
lds -DPERL_MSVCRT_READFIX  -I"C:\strawberry\perl\lib\CORE"  -DLOAD_MY_LIBGCC -DP
ARL_EXE=\"parl.exe\" -s -O2 main.c
C:\strawberry\perl\bin\perl.exe file2c.pl -s ..\script\par.pl -l my_par_pl.c loa
d_my_par_pl
gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE  -DUSE_SITECUSTOM
IZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfie
lds -DPERL_MSVCRT_READFIX  -I"C:\strawberry\perl\lib\CORE"  -DLOAD_MY_LIBGCC -DP
ARL_EXE=\"parl.exe\" -s -O2 my_par_pl.c
g++ main.o my_par_pl.o win32.coff -s   -s -L"C:\strawberry\perl\lib\CORE" -L"C:\
strawberry\c\lib"  C:\strawberry\perl\lib\CORE\libperl512.a C:\strawberry\c\x86_
64-w64-mingw32\lib\libmoldname.a C:\strawberry\c\x86_64-w64-mingw32\lib\libkerne
l32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libuser32.a C:\strawberry\c\x86_64-
w64-mingw32\lib\libgdi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libwinspool.a
C:\strawberry\c\x86_64-w64-mingw32\lib\libcomdlg32.a C:\strawberry\c\x86_64-w64-
mingw32\lib\libadvapi32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libshell32.a C:
\strawberry\c\x86_64-w64-mingw32\lib\libole32.a C:\strawberry\c\x86_64-w64-mingw
32\lib\liboleaut32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libnetapi32.a C:\str
awberry\c\x86_64-w64-mingw32\lib\libuuid.a C:\strawberry\c\x86_64-w64-mingw32\li
b\libws2_32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libmpr.a C:\strawberry\c\x8
6_64-w64-mingw32\lib\libwinmm.a C:\strawberry\c\x86_64-w64-mingw32\lib\libversio
n.a C:\strawberry\c\x86_64-w64-mingw32\lib\libodbc32.a C:\strawberry\c\x86_64-w6
4-mingw32\lib\libodbccp32.a C:\strawberry\c\x86_64-w64-mingw32\lib\libcomctl32.a
-o par.exe
win32.coff: file not recognized: File format not recognized
collect2: ld returned 1 exit status
dmake:  Error code 129, while making 'par.exe'
dmake:  Error code 255, while making 'subdirs'

Sincerely,
Bob Ross

Reply via email to