Hi guys, can anyone post a tutorial for compiling to ELF64 format.
I have read some of the tutorials on here, but failed to understand them.
ELF64 Compiling - Help Please
ELF64 Compiling - Help Please
Last edited by Kieran on Sun Dec 09, 2007 3:30 am, edited 1 time in total.
What is your toolchain? Assuming binutils with elf64 support/nasm v2.00:
then link with:
It really is that simple. Of course, for ld you can specify -T link.ld and have a linker script specifying the output format elf64-x86-64, but if you have followed GCC Cross-Compiler for x86 64, this should be the default. As it stated in the tutorial, you are advised to be familiar with your toolchain first - you can get more familiar by following the standard cross-compiler article before you attempt the x86_64 one.
Cheers,
Adam
Code: Select all
nasm -f elf64 [inputfiles] -o [outputfiles]
or
x86_64-pc-elf-g++ [yourflags] -o [outputfile] -c [inputfile]
Code: Select all
x86_64-pc-elf-ld [inputfiles] -o [outputfile]
Cheers,
Adam
Yes, I did it several times (for several gcc & binutils versions) and it always worked perfectly. I wrote a bash script to automagically build a gcc x86 and x86-64 cross-compiler. It can be found in the lightOS svn repository. It is exactly the same as in the wiki iirc. I have tested the script under cygwin and a normal gnu/linux and it worked perfectly for me.Kieran wrote:Has anyone done this before?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
I followed the guide to the letter and didn't encounter any problems. (I have even adapted it for 68000 targets without problems)
Have you checked the troubleshooting section of the GCC Cross-Compiler page for hints. Many are not limited to a 32-bit x86 toolchain.
If that doesn't work, would you please post the (topmost) error you get?
Have you checked the troubleshooting section of the GCC Cross-Compiler page for hints. Many are not limited to a 32-bit x86 toolchain.
If that doesn't work, would you please post the (topmost) error you get?