Subject: How to build the toolchain on 1.4?
To: None <tech-toolchain@netbsd.org>
From: Kaleb S. KEITHLEY <kaleb@ics.com>
List: tech-toolchain
Date: 06/10/1999 22:15:23
No, really. How do you build the toolchain!?! :-)

I'm trying to (re)build the toolchain on an Alpha running 1.4-RELEASE.
Actually I'm trying to rebuild pretty much everything. (Why am I doing
this? Don't ask, if it works, I'll make it available, if it doesn't
work, I'll be reinstalling.)

I've built most everything else successfully by just going to /usr/src
and doing a `make`, but when I try to build the toolchain it falls down
PDQ, e.g.:

% pwd
/usr/src/gnu
% make
all ===> lib
all ===> lib/libbfd
cc -O2  -Werror   -DHAVE_CONFIG_H -I. -I/usr/src/gnu/lib/libbfd 
-I/usr/src/gnu/lib/libbfd/../../dist/bfd
-I/usr/src/gnu/lib/libbfd/../../dist/opcodes
-I/usr/src/gnu/lib/libbfd/../../dist/include  -DARCH_alpha
-DHAVE_bfd_elf64_alpha_vec -DHAVE_ecoffalpha_little_vec
-DHAVE_netbsd_core_vec  -DSELECT_ARCHITECTURES="&bfd_alpha_arch" 
-DDEFAULT_VECTOR=bfd_elf64_alpha_vec 
-DSELECT_VECS="&bfd_elf64_alpha_vec ,&ecoffalpha_little_vec
,&netbsd_core_vec" -c -fpic -DPIC
/usr/src/gnu/lib/libbfd/../../dist/opcodes/alpha-dis.c -o alpha-dis.so
cc: cannot specify -o with -c or -S and multiple compilations

My first reaction was, why can, e.g. libc, have -o and -c, but not
libbfd? Going down that path, I poked around and decided to temporarily
hack sys.mk to see what would happen when I took the "-c" out of the
COMPILE.c rule in /usr/share/mk/sys.mk, and then this is what I get:

% make
all ===> lib
all ===> lib/libbfd
cc -O2  -Werror   -DHAVE_CONFIG_H -I. -I/usr/src/gnu/lib/libbfd 
-I/usr/src/gnu/lib/libbfd/../../dist/bfd
-I/usr/src/gnu/lib/libbfd/../../dist/opcodes
-I/usr/src/gnu/lib/libbfd/../../dist/include  -DARCH_alpha
-DHAVE_bfd_elf64_alpha_vec -DHAVE_ecoffalpha_little_vec
-DHAVE_netbsd_core_vec  -DSELECT_ARCHITECTURES="&bfd_alpha_arch" 
-DDEFAULT_VECTOR=bfd_elf64_alpha_vec 
-DSELECT_VECS="&bfd_elf64_alpha_vec ,&ecoffalpha_little_vec
,&netbsd_core_vec" -fpic -DPIC
/usr/src/gnu/lib/libbfd/../../dist/opcodes/alpha-dis.c -o alpha-dis.so
cc: ,&ecoffalpha_little_vec: No such file or directory
cc: ,&netbsd_core_vec: No such file or directory

Now it's apparent that for whatever reason the compiler actually thinks
it's compiling multiple files, and thus -c and -o would of course not be
appropriate. So my question is, did this ever really work and was hand
built by someone, or have I fubared something somehow? I've `ktrace -d`
the make to see if it's trying to run something and silently failing and
found nothing. I could put things back the way the were and try it that
way, but figured I'd ask around before I resort to trying that.

--
Kaleb