Page 1 of 2
Win64 C & ASM
Posted: Sun Jul 24, 2005 2:45 pm
by CopperMan
Hi All.
Does some one use Windows x64 (AMD64 platform) for OS deving, if so then please tell me what free 64-bit C/C++ compiler and Assembler is available for this platform?
Thanks,
CopperMan.
Re:Win64 C & ASM
Posted: Sun Jul 24, 2005 3:06 pm
by FlashBurn
GCC is able to compile to x86-64 and so I think that GAS is able to compile 64bit assembly. If you can also use an extern assembler than FASM can be your assembler - it is also able to compile 64bit assembly -
Re:Win64 C & ASM
Posted: Sun Jul 24, 2005 5:16 pm
by AR
By WindowsXP x64, you mean a compiler that runs on it? All 32bit compilers function perfectly, the only one that I'm aware of that can produce binaries for WinXPx64 is the MS one.
If you want to compile for AMD64 CPUs then refer to FlashBurn's post.
Re:Win64 C & ASM
Posted: Sun Jul 24, 2005 5:53 pm
by Tora OS
Only problem you may face with XP x8664 is that if you have a compiler which is 16-bit (like some versions of NASM) then it wont run, since they removed NTVDM from it.
Re:Win64 C & ASM
Posted: Mon Jul 25, 2005 2:42 am
by CopperMan
Hi, All.
To assemble my sources I'll use NASM64 (comming soon).
I'am looking for a free C compiler that can produce a 64-bit PE executables and runs under Win64 ( even for OS deving I don't need runtime or other libraries ).
I've used MinGW but it can't produce 64-bit code now.
When I'am set -m64 it says something like :
Sorry, not implemented yet.
Re:Win64 C & ASM
Posted: Mon Jul 25, 2005 3:00 am
by Solar
Have you tried buiding a
GCC Cross-Compiler using the 4.0.1 sources, for the ia64-pe target?
Re:Win64 C & ASM
Posted: Mon Jul 25, 2005 3:32 am
by Code
Re:Win64 C & ASM
Posted: Mon Jul 25, 2005 8:54 am
by CopperMan
Solar wrote:
Have you tried buiding a
GCC Cross-Compiler using the 4.0.1 sources, for the ia64-pe target?
I need an AMD64 C compiler not IA-64. If it is possible to build a cross-compiler for AMD64 platform that produces PE executables under Windows (32/64 don't care) please tell me how to build such compiler.
Re:Win64 C & ASM
Posted: Mon Jul 25, 2005 8:57 am
by CopperMan
Your server does'nt support download restoring, so with my bad dial-up connection I can't download this binaries.
Re:Win64 C & ASM
Posted: Tue Jul 26, 2005 12:58 am
by Solar
AMD64 is definitely supported by GCC, at least in its x86_64-unknown-linux-gnu variant. I don't think they broke PE support either.
I don't have an AMD64 for testing, nor indeed a Cygwin installation at this point of time, so I can't be positive about the Cross-Compiler tutorial working for Cygwin / x86_64-pe. But I'll be happy to help with any problems you might encounter while trying it out.
(Damn, I have to get that Cygwin running again on my machine...)
Re:Win64 C & ASM
Posted: Tue Jul 26, 2005 7:09 am
by CopperMan
I'll try to build GCC with AMD64-PE support.
I'll try it in different ways.
In case of success or fail I'll post about that.
Re:Win64 C & ASM
Posted: Tue Jul 26, 2005 8:29 am
by CopperMan
Before starting I've tried to build a 32-bit version GCC 4.0.1 under MinGW.
Configuration : ../gcc-4.0.0/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++ --disable-win32-registry --disable-shared --enable-sjlj-exceptions
During configure stage of libsdc++-v3 it gives following error:
configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Does some one already knows what to do with this.
Re:Win64 C & ASM
Posted: Tue Jul 26, 2005 9:42 am
by CopperMan
Report from the battlefield:
I've tried to build :
1. Binutils-2.16.1(last one) for AMD64-PE (with GCC 3.4.4/MinGW/MSYS):
configured with : configure --target=x86_64-pc-pe --prefix=/usr/gcc-amd64 --disable-nls --enable-64-bit-bfd
base configuration is ok but ...
on configuration stage of BFD it says :
target x86_64-pc-pe is not supported ...
2. GCC-4.0.1 for AMD64-PE ( with GCC 3.4.4/MinGW/MSYS ):
configured with : configure --target=x86_64-pc-pe --prefix=/usr/gcc-amd64 --disable-nls --enable-languages=c,c++ --without-headers
base configuration is ok but ...
on configuration stage of GCC it says :
target x86_64-pc-pe is not supported ...
Re:Win64 C & ASM
Posted: Tue Jul 26, 2005 10:34 am
by CopperMan
As you can see x86_64-pc-pe is not supported yet (look at previous post).
So I try to build binutils and gcc for x86_64-unknown-linux-gnu target.
Binary packages used (can be downloaded from
www.mingw.org):
MinGW-4.1.0.exe
MSYS-1.0.10.exe
MSYSDTK-1.0.1.exe
binutils-2.15.94-20050118-1.tar.gz
bison-2.0-MSYS.tar.gz
gcc-core-3.4.4-20050522-1.tar.gz
gcc-g++-3.4.4-20050522-1.tar.gz
mingw-runtime-3.7.tar.gz
w32api-3.2.tar.gz
Source packages used (can be downloaded from
gcc.gnu.org and
www.gnu.org/software/binutils/):
binutils-2.16.1.tar.bz2
gcc-core-4.0.0.tar.bz2
gcc-g++-4.0.0.tar.bz2
gcc-core-4.0.1.tar.bz2
gcc-g++-4.0.1.tar.bz2
Configuration :
binutils : configure --host=i686-pc-mingw32 --target=x86_64-unknown-linux-gnu --prefix=/(your path) --disable-nls
binutils MUST be installed before building gcc.
gcc : configure --host=i686-pc-mingw32 --target=x86_64-unknown-linux-gnu --prefix=/(your path) --disable-nls --enable-languages=c,c++ --without-headers --disable-threads --disable-shared --with-gcc --with-gnu-as --with-gnu-ld
Now I need to find good documentation for elf and elf64.
If some one knows where those documents can be found let me know.
Thanks to ALL.
Re:Win64 C & ASM
Posted: Tue Jul 26, 2005 10:53 am
by Solar
Had I known that switching to ELF wouldn't be a show-stopper for you...
This link should answer your questions regarding ELF.