This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

arm target on an X86_64 linux by standard linuxox


hello,

Im trying to build myself an arm toolchain that will run on my standard linux box (the x86_64 machine). Im not quite there yet. Here are my thoughts and process, se if you can spot the problem.

First i need to build binutils that will un on my machine, but link for the arm, i used
../binutils-2.20/configure --target=arm-elf --prefix=/usr/devel/arm-kit/ --disable-nls --disable-werror


(i ran this comand from in my binutils-build directory).

That ran fine, and now i have my linker and other bits to create my arm executables on my x86_64 machine.

next was gcc, this was a little tricky, i used gcc-4.4.2, i finally got it working with a bit of jigery pokery, with this command:

AS_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-as AR_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-ar LD_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-ld NM_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-nm OBJDUMP_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-objdump RANLIB_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-ranlib STRIP_FOR_TARGET=/usr/devel/arm-kit/bin/arm-elf-strip ../gcc-4.4.2/configure --target=arm-elf --prefix=/usr/devel/arm-kit/ --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c

(i ran this command from within my gcc-build directory)

note that i set the target linker and what-not using environment variables. This seems to have not completely worked as there was a script thats part of the build system that needed mofifying (i think). It was

/usr/arm-build/gcc-build/./gcc/as

It didnt have have the variable set called

ORIGINAL_AS_FOR_TARGET=""
ORIGINAL_LD_FOR_TARGET=""
ORIGINAL_NM_FOR_TARGET="

I got an error abut not being able determine object file extensions, it was down to the exec command being called without args, as the above variable werent set, i set them, to:

ORIGINAL_AS_FOR_TARGET="/usr/devel/arm-kit/bin/arm-elf-as"
ORIGINAL_LD_FOR_TARGET="/usr/devel/arm-kit/bin/arm-elf-ld"
ORIGINAL_NM_FOR_TARGET="/usr/devel/arm-kit/bin/arm-elf-nm"

this worked ! now onot glibc, i used glibc-2.11, and compiled it with this:

../glibc-2.11/configure --target=arm-elf --prefix=/usr/devel/arm-kit/ --exec-prefix=/usr/devel/arm-kit/ --enable-add-ons --with-binutils=/usr/devel/arm-kit/bin/ --host=x86_64-unknown-linux-gnu --build=arm-elf --without-selinux --with-elf

i ran this from within my glibc-build directory.

this seemed ok, so i installed. Now the thing is i can comile object files, and the file command reports them as

tmp.o: ELF 32-bit LSB relocatable, ARM, version 1, not stripped

which seems good, but hen i try and create an executable i get:

/usr/devel/arm-kit/bin/arm-elf-gcc-4.4.2 tmp.c -I /usr/devel/arm-kit/include/
/usr/devel/arm-kit/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld: crt0.o: No such file: No such file or directory
collect2: ld returned 1 exit status


bt if i just amke an object file it seems ok:

/usr/devel/arm-kit/bin/arm-elf-gcc-4.4.2 tmp.c -I /usr/devel/arm-kit/include/ -c

no problem, so has nayone got any ideas of what my problem is ? i assume if compiled binutils a bit wrong or something ?

cheers
Dave











--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]