(→Howto install toolchain on 64 bit Linux: Link to directory, not only script) |
m (→Howto install toolchain on 64 bit Linux: "experimental") |
||
Line 29: | Line 29: | ||
ln -s sezero/W64_160271 $PREFIX |
ln -s sezero/W64_160271 $PREFIX |
||
</nowiki></pre> |
</nowiki></pre> |
||
− | * Download DDK headers from MinGW branch " |
+ | * Download DDK headers from MinGW branch "experimental" via SVN and copy all files over the MinGW headers |
<pre><nowiki> |
<pre><nowiki> |
||
svn checkout -r 2511 http://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/experimental/ddk_test $DOWNLOADS/MinGW64-ddk_test.svn |
svn checkout -r 2511 http://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/experimental/ddk_test $DOWNLOADS/MinGW64-ddk_test.svn |
Revision as of 09:45, 19 June 2010
Howto install MinGW-w64
Howto install toolchain on 64 bit Linux
You can download this install steps as complete script file from install-MinGW-for-64bit-under-Linux.sh
- Lets start with a new (empty!) directory, I used "MinGW64" on my home.
- Set some variables make this doc here more readable.
DOWNLOADS
andTOOLBASE
you can set to somewhere. All other variables you should not change in your first try.
DOWNLOADS="$HOME/download" TOOLBASE="$HOME/MinGW64" PREFIX="$TOOLBASE/gcc445" TARGET="x86_64-w64-mingw32"
- Check your Linux machine type is 64 bit (x86_64) or not
uname -m
- On 64 bit Linux: Download mingw-w64-bin_x86_64-linux_20100604_sezero.tar.gz from SF.
- On 32 bit Linux: Download mingw-w64-bin_i686-linux_20100604_sezero.tar.gz. This version is usable also under 64 bit Linux.
MINGW_PACK="mingw-w64-bin_i686-linux_20100604_sezero.tar.gz" mkdir -p $DOWNLOADS cd $DOWNLOADS wget "http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/sezero_20100604/$MINGW_PACK/download"
- "sezero" does not tar'ed from base of PREFIX. So, unpack this somewhere and set softlink
mkdir -p $TOOLBASE/sezero cd $TOOLBASE/sezero tar xzf $DOWNLOADS/$MINGW_PACK ln -s sezero/W64_160271 $PREFIX
- Download DDK headers from MinGW branch "experimental" via SVN and copy all files over the MinGW headers
svn checkout -r 2511 http://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/experimental/ddk_test $DOWNLOADS/MinGW64-ddk_test.svn cp -a $DOWNLOADS/MinGW64-ddk_test.svn/include/* $PREFIX/$TARGET/include/
- "NTDDI_WIN7" is missing in basic headers. You can get a patch from mingw64-sdkddkver.h-r2480.patch, or load it directly via SVN from MinGW:
svn diff -c 2480 http://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/trunk/mingw-w64-headers >mingw64-sdkddkver.h-r2480.patch
- Apply the patch over the headers:
patch -p0 -d $PREFIX/$TARGET <mingw64-sdkddkver.h-r2480.patch
If you loades the patch from SVN, the error from non exist ChangeLog you can ignore.
Howto check toolchain
Check, that DDK headers and Compiler can create objects
- Create very small source
cd /tmp echo "#include <ntddk.h>" >compiler.c
- Set some more variables and build the object:
CFLAGS="-I$PREFIX/$TARGET/include/ddk -Wall -Os -O2" PATH="$PATH:$PREFIX/bin" $TARGET-gcc $CFLAGS -c -o compiler.o compiler.c
- You should have no warnings and a file compiler.o now.
- More tests you can get form gcc445-mingw-w64-ddk-testing-suite.tgz. There are included sources and binaries for loader and simple driver.