(→Howto check toolchain: replace syntax from Makefile for bash) |
(→Howto check toolchain: _AMD64_ needs to set manualy, see ReactOS Bug #3013488) |
||
Line 44: | Line 44: | ||
* Set some more variables and build the object: |
* Set some more variables and build the object: |
||
<pre><nowiki> |
<pre><nowiki> |
||
− | CFLAGS = -I$PREFIX/$TARGET/include/ddk -Wall -Os -O2 |
+ | CFLAGS = -I$PREFIX/$TARGET/include/ddk -Wall -Os -O2 -D_AMD64_ |
PATH := $PATH:$PREFIX/bin |
PATH := $PATH:$PREFIX/bin |
||
$TARGET-gcc $CFLAGS -c -o compiler.o compiler.c |
$TARGET-gcc $CFLAGS -c -o compiler.o compiler.c |
Revision as of 08:42, 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 a new directory. Set some variables make this doc here more readable
TOOLBASE="$HOME/MinGW64" PREFIX="$TOOLBASE/gcc445" TARGET="x86_64-w64-mingw32" mkdir -p $TOOLBASE cd $TOOLBASE
- 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: If your Linux is not 64 bit, then please 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" DOWNLOADS="$HOME/download" cd $DOWNLOADS wget "http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/sezero_20100604/$MINGW_PACK/download" cd $TOOLBASE
- "sezero" does not tar'ed from base of PREFIX. So, unpack this somewhere and set softlink
mkdir -p $TOOLBASE/sezero tar xzf $DOWNLOADS/$MINGW_PACK -C $TOOLBASE/sezero ln -s sezero/W64_160271 $PREFIX
- Download DDK from ReactOS via SVN and put it directly into the MinGW headers
svn checkout -r 42435 svn://svn.reactos.org/reactos/trunk/reactos/include/ddk $PREFIX/$TARGET/include/ddk
- A warning inside DDK headers can fix with this patch: gcc445-mingw-ddk-svn42435.patch
Howto check toolchain
Check, that DDK headers and Complier 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 -D_AMD64_ 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.