Subject: makeing native toolchain on netwinder

From: Philip Hall <[email-masked]>
Date: Thu, 10 Feb 2000 14:33:45 -0500

I tried to make a cross compiler on my intel box for a
strongarm cross tools chain.
I finally gave up on that idea.
Now i am trying to install binutils-2.9.5.0.22, gcc-2.95.2
on a running netwinder.
The system already has an older version of these tools,
and I wish to install the new ones in /usr/local.
I configured binutils and installed it.
here is the info from the top of the Makefile
for binutils.

# This file was generated automatically by configure.  Do not edit.
VPATH = .
links =
host_alias = armv4l-unknown-linux-gnu
host_cpu = armv4l
host_vendor = unknown
host_os = linux-gnu
host_canonical = armv4l-unknown-linux-gnu
target_alias = armv4l-unknown-linux-gnu
target_cpu = armv4l
target_vendor = unknown
target_os = linux-gnu
target_canonical = armv4l-unknown-linux-gnu
build_alias = armv4l-unknown-linux-gnu
build_cpu = armv4l
build_vendor = unknown
build_os = linux-gnu
build_canonical = armv4l-unknown-linux-gnu

here is the output of ld -V
ld -V
GNU ld version 2.9.5 (with BFD 2.9.5.0.22)
  Supported emulations:
   armelf_linux
   armelf_linux26
   armelf

here is the error when I try to configure gcc-2.95.2

Configuring for a armv4l-unknown-linux-gnu host.
Created "Makefile" in /home/phil/work/gcc-2.95.2 using "mt-frag"
/usr/local/bin/ld: unrecognised emulation mode: elf32arm
Supported emulations: armelf_linux armelf_linux26 armelf
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

What did i do wrong?
thanks

phil

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Erik Mouw <[email-masked]>
Date: Fri, 11 Feb 2000 11:56:40 +0100 (MET)

> I finally gave up on that idea.

Too bad, it really isn't that difficult.

> *** You must set the environment variable CC to a working compiler.

/usr/local/bin is first in your path, so /usr/local/bin/ld comes before
/usr/bin/ld. The ARM target is renamed for the newer binutils. Your
current compiler (gcc-2.8.1) doesn't know about it and uses the newer ld
as if it were the old one.

This should do the trick (I haven't tried it on Netwinder, but it works on
Sun SunOS 4.1.4 and SGI IRIX 5.3):

- remove the new binutils from /usr/local/bin
- configure the binutils with the extra option --program-prefix=g
- build and install binutils (make ; make install)
- configure gcc with the extra options --with-gnu-ld=/usr/local/bin/gld
    --with-gnu-as=/usr/local/bin/gas
- build and install gcc (make bootstrap ; make install)

You can also consider giving a --program-prefix to gcc so you are able to
choose between the old and the new compiler (gcc vs. ggcc).

Erik

-- 
Computers run on faith, not electrons. -- T.N. Thompson