public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* arm target on an X86_64 linux by standard linuxox
@ 2009-12-30 22:04 david frost
  2010-01-01 15:04 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: david frost @ 2009-12-30 22:04 UTC (permalink / raw)
  To: crossgcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: arm target on an X86_64 linux by standard linuxox
  2009-12-30 22:04 arm target on an X86_64 linux by standard linuxox david frost
@ 2010-01-01 15:04 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2010-01-01 15:04 UTC (permalink / raw)
  To: crossgcc; +Cc: david frost

David, All,

On Wednesday 30 December 2009 23:04:44 david frost wrote:
> 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.
[--SNIP--]
> no problem, so has nayone got any ideas of what my problem is ? i assume 
> if compiled binutils a bit wrong or something ?

You can have a look for how it's done in crosstool-NG:
  http://ymorin.is-a-geek.org/projects/crosstool

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-01 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-30 22:04 arm target on an X86_64 linux by standard linuxox david frost
2010-01-01 15:04 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).