Subject: | Problems compiling on x64 ActivePerl (Win Vista 64) |
Hi,
I had to make a few amendments to get 804.028 and 804.028_501 to build
using the 64-bit version of ActivePerl 5.10.0 (build 1004) on Windows
Vista 64.
Note: I'm using the same compiler as was used to build that perl -
namely, Platform SDK for Windows Server 2003 R2.
1) In tkGlue.c, it seems that USE_NEWSTYLE_REGEXP_STRUCT needs to be
set to a true value, but is not. My workaround was to simply patch
tkGlue.c as follows:
--- tkGlue.c Fri May 15 21:42:53 2009
+++ tkGlue.c_fixed Fri May 15 20:17:15 2009
@@ -5406,7 +5406,7 @@
#else
regexp *re = wrap->pat;
#endif
-#if USE_NEWSTYLE_REGEXP_STRUCT
+#if 1 /* USE_NEWSTYLE_REGEXP_STRUCT */
if (re->offs[index].start != -1 && re->offs[index].end != -1)
{
*startPtr = re->subbeg+re->offs[index].start;
Clearly, this is not a portable solution. In fact, I don't think it's
even portable across different Microsoft Compilers.
2) I added links to bufferoverflowU.lib in the generated
PNG/zlib/Makefile as follows:
--- PNG\zlib\Makefile Fri May 15 22:10:43 2009
+++ PNG\zlib\Makefile.fixed Fri May 15 20:28:46 2009
@@ -49,19 +49,19 @@
$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res
$(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \
- -out:$@ $(OBJS) $(OBJA) zlib1.res
+ -out:$@ $(OBJS) $(OBJA) zlib1.res bufferoverflowU.lib
example.exe: example.obj $(STATICLIB)
- $(LD) $(LDFLAGS) example.obj $(STATICLIB)
+ $(LD) $(LDFLAGS) example.obj $(STATICLIB) bufferoverflowU.lib
minigzip.exe: minigzip.obj $(STATICLIB)
- $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB) bufferoverflowU.lib
example_d.exe: example.obj $(IMPLIB)
- $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
+ $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
bufferoverflowU.lib
minigzip_d.exe: minigzip.obj $(IMPLIB)
- $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
+ $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
bufferoverflowU.lib
.c.obj:
$(CC) -c $(CFLAGS) $<
3) I added links to bufferoverflowU.lib in the generated
JPEG/jpeg/Makefile as follows:
--- JPEG\jpeg\Makefile Fri May 15 22:14:25 2009
+++ JPEG\jpeg\Makefile.fixed Fri May 15 20:21:51 2009
@@ -82,17 +82,17 @@
lib -out:libjpeg.lib $(LIBOBJECTS)
cjpeg.exe: $(COBJECTS) libjpeg.lib
- $(CC) $(LDFLAGS) -Fecjpeg.exe $(COBJECTS) libjpeg.lib
+ $(CC) $(LDFLAGS) -Fecjpeg.exe $(COBJECTS) libjpeg.lib
bufferoverflowU.lib
djpeg.exe: $(DOBJECTS) libjpeg.lib
- $(CC) $(LDFLAGS) -Fedjpeg.exe $(DOBJECTS) libjpeg.lib
+ $(CC) $(LDFLAGS) -Fedjpeg.exe $(DOBJECTS) libjpeg.lib
bufferoverflowU.lib
rdjpgcom.exe: rdjpgcom.c
- $(CC) -O rdjpgcom.c
+ $(CC) -O rdjpgcom.c bufferoverflowU.lib
# wrjpgcom needs large model so it can malloc a 64K chunk
wrjpgcom.exe: wrjpgcom.c
- $(CC) -O wrjpgcom.c
+ $(CC) -O wrjpgcom.c bufferoverflowU.lib
.c.obj:
$(CC) $(CFLAGS) -c $<
4) I added links to bufferoverflowU.lib in the generated
PNG/libpng/Makefile as follows:
--- PNG\libpng\Makefile Fri May 15 22:16:46 2009
+++ PNG\libpng\Makefile.fixed Fri May 15 20:22:44 2009
@@ -84,7 +84,7 @@
$(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE)
pngtest.exe: pngtest$(O) libpng.lib
- $(LD) $(LDFLAGS) -out:$@ pngtest$(O)
libpng.lib ..\zlib\zlib.lib $(ERRFILE)
+ $(LD) $(LDFLAGS) -out:$@ pngtest$(O)
libpng.lib ..\zlib\zlib.lib bufferoverflowU.lib $(ERRFILE)
test: pngtest.exe
pngtest
The changes in relation to bufferoverflowU.lib are inadequate for 2
reasons:
a) They're being applied to generated files, not to source files. (Any
pointers on how to implement those changes via amendments to the source
files ?)
b) They utilise a hard coded 'bufferoverflowU.lib', which is clearly
not portable. I *can*, however, help with this aspect. A portable
solution would be to replace the hard coded 'bufferoverflowU.lib' with
$Config{perllibs} - as $Config{perllibs} includes 'bufferoverflowU.lib'
*iff* that library is needed.
Any thoughts on how to transform my hacks into a useful solution would
be appreciated.
With those changes in place, Tk compiled fine, and passed the test
suite.
Cheers,
Rob