From murdoch.duncan at gmail.com  Mon Dec 31 19:19:26 2012
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 31 Dec 2012 13:19:26 -0500
Subject: [Rd] Does dlltools in 64-bit rtools for windows support 64-bit
 machine type?
In-Reply-To: <CAEeinJ9f1SwgVmtYNtmJqmtM2ZrVHzO1hM3ectLXpcdVbF5RDQ@mail.gmail.com>
References: <CAEeinJ9f1SwgVmtYNtmJqmtM2ZrVHzO1hM3ectLXpcdVbF5RDQ@mail.gmail.com>
Message-ID: <50E1D72E.2010208@gmail.com>

On 12-12-30 9:07 AM, Johan Johansson wrote:
> Hi,
>
> I've been trying to get the python bridge (rpy2) to build for 64-bit R
> and python. The current stumbling block is that mingw can't use the
> python27.lib file that comes with CPython and so I need to generate
> libpython27.a.
>
> When I use dlltool from rtools to do that however, I end up with a 32-bit file:
>
>> "G:\Rtools\gcc-4.6.3\i686-w64-mingw32\bin\dlltool" -e libpython27.a -d python27.def python27.dll
>> objdump -f libpython27.a
>
> libpython27.a:     file format pe-i386
>
> More problematically, x86_64 is not listed as supported by objdump:
>
> Usage G:\Rtools\gcc-4.6.3\i686-w64-mingw32\bin\dlltool <option(s)>
> <object-file(s)>
>     -m --machine <machine>    Create as DLL for <machine>.  [default: i386]
>          possible <machine>: arm[_interwork], i386,
> mcore[-elf]{-le|-be}, ppc, thumb
>
> Am I doing it wrong?

You aren't using the same flags as R uses in its builds.  For 64 bit 
builds, it uses these flags (from MkRules.rules):

DLLTOOLFLAGS=--as $(BINPREF)as $(DT_ARCH) -k

DT_ARCH = -m i386:x86-64 --as-flags --64

Duncan Murdoch



[Rd] Does dlltools in 64-bit rtools for windows support 64-bit machine type?
Duncan Murdoch