Page 1 of 1

gcc cross compiler

Posted: Fri Jun 09, 2006 10:59 pm
by simmy
ive been trying to set up GCC cross compiling on my cygwin
and ive been having some problems.

is there a stable version i can use of the gcc and binutils?
ive tried 3 different ones and they all left me with problems when i try to follow the bare bones tutorial.

is there something special i need to do to uninstall the old versons? or just delete the folders they are in?

Re:gcc cross compiler

Posted: Fri Jun 09, 2006 11:11 pm
by Cjmovie
You'll probably want to run:
"make clean"
if you left any of the half-done builds in place, but it shouldn't cause problems not to. Make should be smart enough to know it needs updating....
What kind of errors?

Re:gcc cross compiler

Posted: Fri Jun 09, 2006 11:15 pm
by simmy
junk at the end of line errors

Re:gcc cross compiler

Posted: Sat Jun 10, 2006 9:32 am
by Solar
From the BareBones "troubleshooting" section:
I get Error: junk at end of line, first unrecognized character is ',' ...

Chances are the GNU as you use is not targeted at ELF - it chokes on the .comm stack, STACKSIZE, 32 line, as three arguments to .comm are only supported for ELF targets. Try setting up a GCC Cross-Compiler.
Make sure you are actually using the cross-compiler tools you've created using the GCC Cross-Compiler tutorial, i.e. the executables in /usr/cross/... .

Stable binutils is 2.16.1. Stable GCC is 3.4.6 or 4.1.1.

Re:gcc cross compiler

Posted: Sat Jun 10, 2006 12:47 pm
by simmy
what would be the usage for:

as -o loader.o loader.s

gcc -o kernel.o -c kernel.c -Wall -Werror -nostdlib -nostartfiles -nodefaultlibs

or

ld -T linker.ld loader.o kernel.o

to unpack the packages, i just use 'tar -xf' and itll make a folder, and from there i use the tutorial?

Re:gcc cross compiler

Posted: Sun Jun 11, 2006 2:30 am
by Solar
simmy wrote: ck the packages, i just use 'tar -xf' and itll make a folder, and from there i use the tutorial?
If you download the .gz packages, you unpack with -xzf; if you have the .bz2 packages, unpack with -xjf.

Just follow the tutorial. Basically, GCC Cross-Compiler and BareBones are two chapters of the same tutorial: From Cygwin to your first working kernel. ;)

Re:gcc cross compiler

Posted: Sun Jun 11, 2006 8:13 pm
by simmy
how do i use the gcc cross compiler

Re:gcc cross compiler

Posted: Sun Jun 11, 2006 8:17 pm
by Candamir
Basically, you have to include /usr/cross/bin in your &PATH variable and then, invoke the binaries you find in that folder, e.g. i386-elf-gcc and i386-elf-ld (depending on the target).

Look it up at http://www.osdev.org/osfaq2/index.php/GCC Cross-Compiler

Candamir

Re:gcc cross compiler

Posted: Wed Jun 14, 2006 9:49 am
by jason7007
Hi,

I successfully made the cross-compiler using the tutorial in faq.
I want to test this cross-compiler on Brian Kernel development tutorial. Is the batch file in Brian tutorial applicable to my cross-compiler, or do we have to change the syntax, especially the options. Or I should say what is the equivalent of build.bat file in Brian tutorial to my cross-compiler in Cygwin? Can I make script file and then type name of script file as command line? Sorry I am not Unix/Linux guy, I don't know about batch file in Unix/Linux.

Can someone please guide me on how to do this?

Your help will be appreciated.
Thanks.