gcc cross compiler

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
simmy

gcc cross compiler

Post 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?
Cjmovie

Re:gcc cross compiler

Post 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?
simmy

Re:gcc cross compiler

Post by simmy »

junk at the end of line errors
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:gcc cross compiler

Post 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.
Every good solution is obvious once you've found it.
simmy

Re:gcc cross compiler

Post 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?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:gcc cross compiler

Post 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. ;)
Every good solution is obvious once you've found it.
simmy

Re:gcc cross compiler

Post by simmy »

how do i use the gcc cross compiler
Candamir

Re:gcc cross compiler

Post 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
jason7007

Re:gcc cross compiler

Post 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.
Post Reply