Skip Menu |
 

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 46112
Status: stalled
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: sisyphus [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 804.028_500
  • 804.028_501
Fixed in: (no value)



Subject: Problems compiling on x64 ActivePerl (Win Vista 64)
Download (untitled) / with headers
text/plain 4.1k
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
Download (untitled) / with headers
text/plain 1.7k
On Fri May 15 08:31:47 2009, SISYPHUS wrote: Show quoted text
> 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.
[...] This is an indication that the checks in the config directory did not work (i.e. did not compile at all). Show quoted text
> > 2) I added links to bufferoverflowU.lib in the generated > PNG/zlib/Makefile as follows: >
[...] Show quoted text
> > 3) I added links to bufferoverflowU.lib in the generated > JPEG/jpeg/Makefile as follows: > >
[...] Show quoted text
> > 4) I added links to bufferoverflowU.lib in the generated > PNG/libpng/Makefile as follows: >
[...] Show quoted text
> > > 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. >
Can you try the attached patch? This patchs adds $Config{perllib} to various places in the Perl/Tk configure process and could hopefully fix all four issues. Regards, Slaven
Subject: perllib.diff
Download perllib.diff
text/x-diff 2.7k
diff --git a/JPEG/Makefile.PL b/JPEG/Makefile.PL old mode 100644 new mode 100755 index 4a6862d..2659e90 --- a/JPEG/Makefile.PL +++ b/JPEG/Makefile.PL @@ -1,21 +1,14 @@ # -*- cperl -*- use Tk::MMutil; +use Tk::MMtry; use Tk::Config (); use File::Copy; -my $l = $Config::Config{'lib_ext'}; - -# use ExtUtils::MakeMaker '6.05'; -my @local_jpeg = ( - 'INC' => '-Ijpeg', - 'MYEXTLIB' => "jpeg/libjpeg$l", -); - -use Tk::MMtry; +my $l = $Config::Config{'lib_ext'}; if ($Tk::MMtry::VERSION ge '4.007' && try_run("jpeg/has_jpeg.c",['-I/usr/local/include'],['-ljpeg'])) { - push(@args, LIBS => ['-ljpeg'], + push(@args, LIBS => ['-ljpeg ' . $Config::Config{perllib}], INC => '-I/usr/local/include', DEFINE => '-DHAVE_JPEGLIB_H', ); @@ -25,6 +18,7 @@ if ($Tk::MMtry::VERSION ge '4.007' && try_run("jpeg/has_jpeg.c",['-I/usr/local/i else { push(@args, MYEXTLIB => "jpeg/libjpeg$l", + LIBS => $Config::Config{perllib}, 'INC' => '-Ijpeg'); copy("Makefile.jpeg.maybe","jpeg/Makefile.PL"); warn "Building jpeg/libjpeg$l\n"; diff --git a/PNG/Makefile.PL b/PNG/Makefile.PL index 71265de..d1924cb 100755 --- a/PNG/Makefile.PL +++ b/PNG/Makefile.PL @@ -25,7 +25,7 @@ if ($Tk::MMtry::VERSION ge '4.007' && dist => { COMPRESS => 'gzip -f9', SUFFIX => '.gz' }, OBJECT => '$(O_FILES)', INC => '-I/usr/local/include', - LIBS => ['-lpng -lz -lm'], + LIBS => ['-lpng -lz -lm ' . $Config::Config{perllib}], ); } else @@ -68,7 +68,7 @@ else OBJECT => '$(O_FILES)', INC => '-Ilibpng -Izlib', MYEXTLIB => $extlib, - LIBS => ['-lm'], + LIBS => ['-lm ' . $Config::Config{perllib}], ); } else diff --git a/Tk/MMtry.pm b/Tk/MMtry.pm index 110f6b2..8eb84a3 100644 --- a/Tk/MMtry.pm +++ b/Tk/MMtry.pm @@ -25,7 +25,7 @@ sub try_compile $def = [] unless $def; my $out = basename($file,'.c').$Config{'exe_ext'}; warn "Test Compiling $file\n"; - my $msgs = `$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file @$lib @$def $stderr_too`; + my $msgs = `$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file @$lib $Config{perllib} @$def $stderr_too`; my $ok = ($? == 0); warn "$msgs\n" if $VERBOSE && $msgs; unlink($out) if (-f $out); @@ -40,7 +40,7 @@ sub try_run $def = [] unless $def; my $out = basename($file,'.c').$Config{'exe_ext'}; warn "Test Compile/Run $file\n"; - my $cmdline = "$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file @$lib @$def"; + my $cmdline = "$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file @$lib $Config{perllib} @$def"; my $msgs = `$cmdline $stderr_too`; my $ok = ($? == 0); warn "$cmdline:\n$msgs\n" if $VERBOSE && $msgs;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.