On May 15, 3:41*am, Dilbert <dilbert1...@gmail.com> wrote:
>
> It looks very much as if there simply is no 64 bits in the free
> available compiler from Microsoft, only 32 bits
It's still there - though it looks a 32 bit application is being
found.
What command are you running to set the environment ?
What does the 'cl /?' output begin with ? It should be something like:
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.41 for
AMD64
Copyright (C) Microsoft Corporation. All rights reserved.
>
> Whatever the outcome of my battle with MS VC++ will be, I will be
> relieved when "ppm install MinGW" works on 64 bit Windows.
According to Jan Dubois, that probably won't be for a couple of months
(at least). ActivePerl 5.12.0 needs some patching before it will work
with the MinGW64 compilers. I have patches that enable this (included
below)- they're a bit of a hack, and quite possibly *not* the way that
ActiveState will deal with the issues. But they've been working fine
for me, and you're welcome to give them a try. (I'd be interested to
hear of any problems you strike if you do use them - feel free to
email me at my CPAN address.)
For the MinGW64 compiler, you go to
http://sourceforge.net/projects/mingw-w64/files
, as you've already discovered. Under "Toolchains targetting Win64"
grab either one of the "personal builds" or one of the "automated
builds" that has been built for win64 mingw (not for linux or cygwin)
- and make sure it's a 64-bit build (as they're also providing a 32-
bit compiler). The "automated builds" are a cross-compiler with the
names of the executables prefixed with "x86_64-w64-mingw32-" (ie
"x86_64-w64-mingw32-gcc.exe", etc.), so it might be simpler if you
choose the "sezero_20100428" build ("mingw-w64-bin_x86_64-
mingw_20100428_sezero.zip"). My patches accommodate both types of
build.
Then just unzip and add the bin folder to the path.
Cheers,
Rob
Patch to lib/ExtUtils/MM_Win32.pm (ActivePerl build 1200):
##################################################
--- MM_Win32.pm_orig Sat Apr 17 13:38:04 2010
+++ MM_Win32.pm Wed Apr 21 17:40:30 2010
@@ -33,7 +33,9 @@
my $BORLAND = $Config{'cc'} =~ /\bbcc/i ? 1 : 0;
my $GCC = $Config{'cc'} =~ /\bgcc/i ? 1 : 0;
-my $DLLTOOL = $Config{'dlltool'} || 'dlltool';
+my $dlltool = $Config{'cc'} =~ /x86_64\-w64\-mingw32\-/i ? 'x86_64-
w64-mingw32-dlltool'
+ : 'dlltool';
+my $DLLTOOL = $Config{'dlltool'} || $dlltool;
=head2 Overridden methods
@@ -359,8 +361,17 @@
sub init_linker {
my $self = shift;
-
- $self->{PERL_ARCHIVE} = "\$(PERL_INC)\\$Config{libperl}";
+
+ if($GCC &&
+ $Config{libperl} =~ /\.lib/ &&
+ $Config{archname} =~ /\-x64/) {
+ my $libperl = $Config{libperl};
+ $libperl =~ s/\.lib/\.dll/;
+ $self->{PERL_ARCHIVE} = "$Config{bin}\\$libperl";
+ }
+ else {
+ $self->{PERL_ARCHIVE} = "\$(PERL_INC)\\$Config{libperl}";
+ }
$self->{PERL_ARCHIVE_AFTER} = '';
$self->{EXPORT_LIST} = '$(BASEEXT).def';
}
##################################################
Patch to lib/ActivePerl/Config.pm (ActivePerl build 1200):
##################################################
--- Config.pm_orig Sat Apr 17 12:27:02 2010
+++ Config.pm Mon May 3 12:54:59 2010
@@ -34,8 +34,11 @@
quadtype
uquadtype
d_casti32
-);
+ dlltool
+); # libperl needs to be inserted into above list (and
appropriate _override() uncommented below)
+ # if we want to link to libperl512.a instead of perl512.dll -
SISYPHUS
my $compiler_env_initialized;
+my $gcc_pre = '';
use Config ();
my $CONFIG_OBJ = tied %Config::Config;
@@ -98,12 +101,16 @@
}
elsif ($^O eq "MSWin32" && (_gcc_requested() || !
ActiveState:

ath::find_prog(_orig_conf("cc")))) {
my $gcc = _find_prog("gcc");
+ if(!$gcc) {
+ $gcc_pre = 'x86_64-w64-mingw32-';
+ $gcc = _find_prog("${gcc_pre}gcc");
+ }
if (!$gcc && _install_mingw($key)) {
$gcc = _find_prog("gcc");
}
if ($gcc) {
# assume MinGW or similar is available
- $gcc = _get_short_path_name($gcc);
+ unless($gcc_pre) {$gcc = _get_short_path_name($gcc);}
$gcc =~ s,\\,/,g;
my($mingw) = $gcc =~ m,^(.*)/bin/gcc\.exe$,;
if (defined $mingw) {
@@ -134,7 +141,7 @@
# New: "-lfoo -lbar"
my @libs = split / +/, _orig_conf($key);
# Filter out empty prefix and oldnames.lib
- @libs = grep {$_ && $_ ne "oldnames.lib"} @libs;
+ @libs = grep {$_ && $_ ne "oldnames.lib" && $_ ne
"bufferoverflowU.lib"} @libs;
# Remove '.lib' extension and add '-l' prefix
s/(.*)\.lib$/-l$1/ for @libs;
_override($key, join(' ', @libs));
@@ -150,24 +157,25 @@
_override("cpp", "$gcc -E");
_override("cpprun", "$gcc -E");
_override("cppminus", "-");
- _override("ar", _find_prog("ar"));
- _override("ld", _find_prog("g++"));
+ _override("ar", _find_prog("${gcc_pre}ar"));
+ _override("ld", _find_prog("${gcc_pre}g++"));
_override("_a", ".a");
_override("_o", ".o");
_override("obj_ext", ".o");
_override("lib_ext", ".a");
- _override("optimize", "-O2");
+ _override("optimize", "-s -O2");
_override("i64type", "long long");
_override("u64type", "unsigned long long");
_override("quadtype", "long long");
_override("uquadtype", "unsigned long long");
_override("d_casti32", "define");
+ #_override("libperl", "libperl512.a");
# Extract all library paths from lddlflags
my @libpaths = map "-L$_", map /^-libpath

.+)/,
_orig_conf("lddlflags") =~ /(?=\S)(?>[^"\s]+|"[^"]*")+/g;
- _override("lddlflags", join(" ", "-mdll", @libpaths));
- _override("ldflags", join(" ", @libpaths));
+ _override("lddlflags", join(" ", "-s -mdll", @libpaths));
+ _override("ldflags", join(" ", '-s', @libpaths));
}
elsif (_gcc_requested()) {
warn "Cannot find gcc on PATH\n"
##################################################