Subject: Re: GCC 2.7.1 configuration for NetBSD/pmax botched
To: None <jonathan@DSG.Stanford.EDU>
From: Arne H. Juul <arnej@pvv.unit.no>
List: port-pmax
Date: 11/21/1995 04:38:01
 > #!/bin/sh
 > # GCC was configured as follows:
 > /lahaina/n2/src/gnu/gcc-2.7.1/configure -srcdir=/lahaina/n2/src/gnu/gcc-2.7.1
 > echo host=mips-dec-netbsd1.1. target=mips-dec-netbsd1.1. build=mips-dec-netbsd1.
 > 
 > Yet the installation happened  into
 > '/usr/lib/gcc-lib/pmax-unknonw-netbsd-1.1.'
 > 
 > The trailing period is bogus, and I just can't *beleive* that that's
 > the FSF- or Cygnus-blessed canonical name for this port.
 > 
 > Something, somewhere, is broken.

FSF/Cygnus configure uses uname -m, -r, etc to get os name/revision
and machine type.   So 1.1_ALPHA becomes 1.1. (with trailing dot), yes.
This also happens on i386, where I got i386-unknown-netbsd1.1./ directory :-)
Also uname -m gives 'pmax', but the processor type is of course 'mips'.

 > Maybe this works better if explicity configured to use a target of,
 > e.g., "mips-dec-netbsd-1.1"?

I always use explicit target, for NetBSD/pmax just mips-dec-netbsd
should be canonical enough.

  - Arne H. J.

PS:  If you're compiling gcc 2.7.1 there's a couple
of gotcha's:
 1) ensure you don't have an old obstack.h installed somewhere gcc
    might find it. I've made this mistake two times now, quite irritating.
 2) You may want to use this patch, which does two things: Don't
inhibit "-e __start" on -nostdlib (since NetBSD uses -nostdlib whenever
DESTDIR is set),  and don't redefine LOCAL_LABEL_PREFIX (this makes
the standard FSF/Cygnus binutils behave much nicer w.r.t. local labels).

diff -ru gcc-2.7.1.orig/config/mips/netbsd.h gcc-2.7.1/config/mips/netbsd.h
--- gcc-2.7.1.orig/config/mips/netbsd.h	Sat Jul 29 22:24:02 1995
+++ gcc-2.7.1/config/mips/netbsd.h	Tue Nov 21 02:13:05 1995
@@ -50,7 +50,7 @@
 #undef LINK_SPEC
 #define LINK_SPEC \
   "%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \
-   %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{static:-Bstatic} %{assert*}"
+   %{!nostartfiles:%{!r*:%{!e*:-e __start}}} -dc -dp %{static:-Bstatic} %{assert*}"
 
 /* We have atexit(3).  */
 
@@ -101,7 +101,7 @@
 #define TARGET_DEFAULT MASK_GAS
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 
-#define LOCAL_LABEL_PREFIX	"."
+/* #define LOCAL_LABEL_PREFIX	"." */
 
 #include "mips/mips.h"