Still problems when cross-compiling
Posted: Wed Jan 14, 2009 2:24 pm
Hello,
I'm still having troubles with this ******* cross-compiler
I followed these guidelines: http://wiki.osdev.org/OS_Specific_Toolchain
And managed to build a (non-working) linux-to-myos binutils, compiler and libc
But I still have questions/problems:
1. I have the binaries i586-pc-myos-gcc, i586-pc-myos-as, i586-pc-myos-ld, etc. but not i586-pc-myos-cc
Why ?
2. When I compile a simple 'hello world' program using these command lines
i586-pc-myos-gcc -c -o main.o main.c
i586-pc-myos-ld -o helloworld main.o
The linker complains about an unresolved symbol 'printf'
I have to manually add:
i586-pc-myos-ld -o helloworld main.o /usr/i586-pc-myos/lib/libc.a
I can't tell if this work as I haven't finished implementing all the syscalls yet (I'm getting unresolved symbols for functions I have to implement)
But the question is: why do you have to manually tell the linker to include libc.a despite you don't have to when using the normal linker?
3. I typed autoscan ; mv configure.scan configure.am ; autoconf
I now have a classical unix-like source tree
When I try using:
./configure --host=i586-pc-myos
I get an error:
/usr/lib/gcc/i586-pc-myos/4.3.2/../../../../i586-pc-myos/bin/ld: cannot find -lgcc
ie: /usr/i586-pc-myos/bin/ld: cannot find -lgcc
I don't really know what this means :-/
4. Before the problem number 3, I had also the configure script complaining about not finding crtbegin.o
I compiled an empty crtbegin.s as I already had a crt0.o as described here: http://wiki.osdev.org/OS_Specific_Toolchain#crt0.S
I notice we tell GCC to include crtbegin.o and crtend.o (http://wiki.osdev.org/OS_Specific_Toolc ... config.gcc)
But why does the configure script not complain about not finding crtend.o?
And why does he complain about crt0.o if I remove it? We don't tell it anywhere to include crt0.o
And why did it not complain at step 2? crtbegin.o didn't exist at the moment
Thanks in advance :-/
EDIT : typo
I'm still having troubles with this ******* cross-compiler
I followed these guidelines: http://wiki.osdev.org/OS_Specific_Toolchain
And managed to build a (non-working) linux-to-myos binutils, compiler and libc
But I still have questions/problems:
1. I have the binaries i586-pc-myos-gcc, i586-pc-myos-as, i586-pc-myos-ld, etc. but not i586-pc-myos-cc
Why ?
2. When I compile a simple 'hello world' program using these command lines
i586-pc-myos-gcc -c -o main.o main.c
i586-pc-myos-ld -o helloworld main.o
The linker complains about an unresolved symbol 'printf'
I have to manually add:
i586-pc-myos-ld -o helloworld main.o /usr/i586-pc-myos/lib/libc.a
I can't tell if this work as I haven't finished implementing all the syscalls yet (I'm getting unresolved symbols for functions I have to implement)
But the question is: why do you have to manually tell the linker to include libc.a despite you don't have to when using the normal linker?
3. I typed autoscan ; mv configure.scan configure.am ; autoconf
I now have a classical unix-like source tree
When I try using:
./configure --host=i586-pc-myos
I get an error:
/usr/lib/gcc/i586-pc-myos/4.3.2/../../../../i586-pc-myos/bin/ld: cannot find -lgcc
ie: /usr/i586-pc-myos/bin/ld: cannot find -lgcc
I don't really know what this means :-/
4. Before the problem number 3, I had also the configure script complaining about not finding crtbegin.o
I compiled an empty crtbegin.s as I already had a crt0.o as described here: http://wiki.osdev.org/OS_Specific_Toolchain#crt0.S
I notice we tell GCC to include crtbegin.o and crtend.o (http://wiki.osdev.org/OS_Specific_Toolc ... config.gcc)
But why does the configure script not complain about not finding crtend.o?
And why does he complain about crt0.o if I remove it? We don't tell it anywhere to include crt0.o
And why did it not complain at step 2? crtbegin.o didn't exist at the moment
Thanks in advance :-/
EDIT : typo