Subject: Re: problem cross-compiling i386 -> amiga
To: Ignatios Souvatzis <is@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-toolchain
Date: 02/05/2002 09:51:52
On Fri, 1 Feb 2002, Ignatios Souvatzis wrote:

> I'm trying to cross-build on i386 for Amiga.
>
> After cvs updating from anoncvs.netbsd.org in the afternoon CET, that is
> about 7 hours ago, I still get the error below.

[reproduced enough to give you the idea]

> /usr/src/cur/src/gnu/usr.bin/gcc/backend/../../../dist/toolchain/gcc/toplev.c:1168:
>     `TARGET_CPU_DEFAULT' undeclared here (not in a function)
> /usr/src/cur/src/gnu/usr.bin/gcc/backend/../../../dist/toolchain/gcc/toplev.c:1168:
>     initializer element is not constant
> /usr/src/cur/src/gnu/usr.bin/gcc/backend/../../../dist/toolchain/gcc/toplev.c:1168:
>     (near initialization for `target_switches[42].value')

The following patch allows me to build for mac68k on 1.5.1/i386:


Index: netbsd-elf.h
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/toolchain/gcc/config/m68k/netbsd-elf.h,v
retrieving revision 1.6
diff -u -r1.6 netbsd-elf.h
--- netbsd-elf.h	2002/01/29 01:02:06	1.6
+++ netbsd-elf.h	2002/02/05 15:33:36
@@ -32,9 +32,9 @@
 #define NETBSD_ELF
 #include <netbsd.h>

-/* Default target comes from config.gcc */
+/* 68020 with 68881 */
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT TARGET_CPU_DEFAULT
+#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)


 /* Don't try using XFmode on the 68010.  */

It's also notable that 1) there is no config.gcc anywhere on my system,
and 2) pretty much every other port's _platform_.h has the same
definition. "openbsd.h" even has a comment explaining that m68k is "too
old" for the new style. The only mystery is how it works *without* *it*
on a self-hosted build. Does it get the defaults from the host compiler?

Frederick