From: Luis Lavena Date: 2010-09-27T02:25:07+09:00 Subject: [ruby-core:32569] Re: RUBY_PLATFORM on MinGW64 (was: List of possible casting issues under LLP64) On Sat, Sep 25, 2010 at 7:52 PM, wanabe wrote: > Hello, > > 2010/9/24, Luis Lavena : >> In r29320 you also introduced Exports::Mingw64 which is never going to be >> called becase RUBY_PLATFORM is x86_64-mingw32. It differs form mswin32 and >> mswin64 because MinGW is still mingw32, just it changes the architecture. > > hmmm, my RUBY_PLATFORM is x86_64-mingw64. > What compiler or options did you provided to configure? Looking at your patch to config.sub, doing --host=mingw64 will generate that platfrom. > $ ./ruby -v > ruby 1.9.3dev (2010-09-23 trunk 29323) [x86_64-mingw64] > $ ./miniruby -ve 'p RUBY_PLATFORM' > ruby 1.9.3dev (2010-09-23 trunk 29323) [x86_64-mingw64] > "x86_64-mingw64" > > (note: I just do as below. > �$ mkdir out.mingw64 ; cd out.mingw64 > �$ export MINGW64BIN="C:\\path\\to\\mingw64\\bin\\x86_64-w64-mingw32-" > �$ ../configure --target=mingw64 CC=${MINGW64BIN}gcc.exe \ > � �CXX=${MINGW64BIN}g++.exe NM=${MINGW64BIN}nm.exe \ > � �DLLWRAP=${MINGW64BIN}dllwrap.exe WINDRES=${MINGW64BIN}windres.exe \ > � �AR=${MINGW64BIN}ar.exe AS=${MINGW64BIN}as.exe \ > � �OBJDUMP=${MINGW64BIN}objdump.exe \ > � �RANLIB=${MINGW64BIN}ranlib.exe && make > ) > > If you mean "[x86_64-mingw64] is wrong. It should be > [x86_64-mingw32]", please teach me why. mingw32 is like darwin or linux, is the platform. It stagnated as mingw32 even for the 64bits counterpart. Earnie (from MinGW) and the mingw-w64 had a discussion about this for config.guess: http://sourceforge.net/mailarchive/message.php?msg_id=AANLkTikzVW_UqbgrmUCAKT-_-ArQtzQnMy0%2Buk3wWFou%40mail.gmail.com We know it could be misleading, but lot of projects depend on platform be mingw32 to trigger the right code. You can read all about that in the thread pointed above. i?86 and x86_64, as I mentioned, are the architecture, while "pc" and "w64" are the vendor indicators. config.guess is not smart enough to detect natively the right platform, you even under MSYS you need to feed it as --host=x86_64-w64-mingw32 > Or if you mean "My RUBY_PLATFORM is currently x86_64-mingw32", please > show me your build steps. > git checkout trunk git clean -x -f -d sh "./autoconf" mkdir build && cd build sh ../configure --enable-shared --host=x86_64-w64-mingw32 make I let configure determine all CC,RANLIB,WINDRES, etc using the host triplet. I'm using mingw-w64 Toolchain for 64bits combined with prepackaged MSYS from mingw-w64 team. You can find all these downloads here: http://sourceforge.net/downloads/mingw-w64/ MSYS: http://sourceforge.net/projects/mingw-w64/files_beta/External%20binary%20packages%20(Win64%20hosted)/MSYS%20(32-bit)/ 64bits toolchains: http://sourceforge.net/projects/mingw-w64/files_beta/Toolchains%20targetting%20Win64/ Natively compilation can be done with TDM64: http://tdm-gcc.tdragon.net/download I've been doing cross-compilation from Darwin and Linux because that is where I mostly have problems. Please let me know how else I can help on this. I'm not a native english speaker which could read to bad grammar and incorrect expression from me. Thank you in advance for your time. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup�ry