Daniel Stenberg wrote:
On Tue, 3 Oct 2006, Pak Woon wrote:
I am trying to roll-my-own toolchain by following the instructions
outlined in http://www.linux-mips.org/wiki/Toolchains.
binutils-2.16.91.0.6-5
gcc-4.1.1-1.fc5
Funny, since that page says that the recommended gcc version is 3.4.4
and binutils 2.16.1... (even though I've had no problems with 3.4.6 myself)
First of all, thank you all for your suggestions. I have successfully
built my own toolchain (using binutils-2.16.1 and gcc-3.4.4). I have
also successfully built the kernel for the target board. (with git
checkout linux-2.16.18-stable)
[ltu@PAKW-FEDORA linux.git]$ readelf -h vmlinux
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x803c3000
Start of program headers: 52 (bytes into file)
Start of section headers: 3056172 (bytes into file)
Flags: 0x70001001, noreorder, o32, mips32r2
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 1
Size of section headers: 40 (bytes)
Number of section headers: 34
Section header string table index: 31
I am now trying to build a simple program with my new toolchain and I've
come across the "can't find crt1.o" problem again. I am struggling with
this.
[ltu@PAKW-FEDORA tmp]$ mips-unknown-linux-gnu-gcc -v hello.c
Using built-in specs.
Configured with: ../gcc-3.4.4/configure
--target=mips-unknown-linux-gnu
--prefix=/home/ltu/development/mips-linux-toolchain
--enable-languages=c --without-headers --with-gnu-ld --with-gnu-as
--disable-shared --disable-threads
Thread model: single
gcc version 3.4.4
/home/ltu/development/mips-linux-toolchain/libexec/gcc/mips-unknown-linux-gnu/3.4.4/cc1
-quiet -v hello.c -quiet -dumpbase hello.c -auxbase hello -version -o
/tmp/ccETB2Cl.s
ignoring nonexistent directory
"/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/../../../../mips-unknown-linux-gnu/sys-include"
ignoring nonexistent directory
"/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/../../../../mips-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/include
End of search list.
GNU C version 3.4.4 (mips-unknown-linux-gnu)
compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64461
hello.c: In function `main':
hello.c:2: warning: return type of 'main' is not `int'
/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/../../../../mips-unknown-linux-gnu/bin/as
-EB -no-mdebug -32 -v -KPIC -o /tmp/ccoPzQTv.o /tmp/ccETB2Cl.s
GNU assembler version 2.16.1 (mips-unknown-linux-gnu) using BFD version
2.16.1
/home/ltu/development/mips-linux-toolchain/libexec/gcc/mips-unknown-linux-gnu/3.4.4/collect2
--eh-frame-hdr -EB -dynamic-linker /lib/ld.so.1 crt1.o crti.o
/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/crtbegin.o
-L/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4
-L/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/../../../../mips-unknown-linux-gnu/lib
/tmp/ccoPzQTv.o -lgcc -rpath-link /lib:/usr/lib -lc -lgcc
/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/crtend.o
crtn.o
/home/ltu/development/mips-linux-toolchain/lib/gcc/mips-unknown-linux-gnu/3.4.4/../../../../mips-unknown-linux-gnu/bin/ld:
crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
[ltu@PAKW-FEDORA tmp]$ echo $PATH
/home/ltu/development/mips-linux-toolchain/bin:/bin:/usr/bin
[ltu@PAKW-FEDORA tmp]$
From my understanding, to compile code for my MIPS target, I need to
use mips-unknown-linux-gnu-gcc (which, I assume is the same as
/mips-linux-toolchain/mips-unknwn-linux-gnu/bin/gcc). I have ensured my
$PATH is the bare minimum. This is the same problem as I was getting
when I was trying to build a gcc-4.1.1-1.fc5 based cross compiler. I am
really stuck.
FYI, my hello.c is:
void main ( void )
{
volatile int i,j,k;
i = 2;
j = 1;
k = i + j;
}
Thanks in advance
Regards,
Pak