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

Duncan Murdoch murdoch.duncan at gmail.com
Mon Dec 31 19:19:26 CET 2012


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



More information about the R-devel mailing list