The target machine is represented by TARGET_ARCH. MACHINE_ARCH always
represents the host machine. When TARGET_ARCH is not defined, it is
assumed to be equal to MACHINE_ARCH. This means that we're building a
native toolset by default. We're creating cross-compilation tools when
MACHINE_ARCH != TARGET_ARCH.
TARGET_ARCH is defined when building binutils as part of the bootstrap
build and is set to reflect the architecture we're currently cross-
building. With this change binutils is ready for cross-building.
Unlike the unisex architecutres we've had so far, mips is bisexual.
These tools can produce either byte sex, and the compiler/make
determines the proper gender to use. Otherwise, we'd have to have had
mipsel and mipseb in all the places that we have just mips. And there
are other complications with doing that (binutils doesn't like to
build mips tools without both byte genders, it seems).
Introduced BINUTIL_ARCH so that other bisexual architectures can a
generic mechanism.
We cannot just define MACHINE_ARCH as mips because we need to
differentiate big and little endian types of binaries. Discussions on
freebsd-arch have hashed out this issue (and the parallel libc
issues). NetBSD is moving towards mipsel and mipseb for their two
flavors of mips ports (in time for 1.4, if this change hasn't already
been accomplished).
I've been building i386 worlds with this tree for a three months with
these files in place with no ill effects.
be worth much effort. Install all i386 binutils programs in
"/usr/libexec/elf". Disable a.out support in libbfd. It's too
dangerous to leave it in. Some of the utilities think they can
handle a.out, but they generate bad object files.
support building it for variant architectures. It was already
becoming clear that the former structure was too rigid and didn't
scale well.
The usual sort of makefile magic arranges to .include an architecture
specific makefile "Makefile.${MACHINE_ARCH}" in each directory
where it exists. Also, sources will be found in each subdirectory
"${MACHINE_ARCH}" that exists. This is all taken care of automatically
by the top level "Makefile.inc0".
This all seems to work right for the i386 now. I have also converted
those alpha pieces already present to the new schema as best I
could.
Also: change the BINDIR on the i386 to /usr/libexec/elf for "ar"
and "ranlib". They are not object format independent enough to
put into /usr/bin.
This finishes up the binutils import. But I am leaving it disabled
in "src/gnu/usr.bin/Makefile" for now. It is not used by anything
yet, so I'll take this opportunity to run one more round of tests
before enabling it.