NetBSD Problem Report #9547

Received: (qmail 14616 invoked from network); 5 Mar 2000 18:56:29 -0000
Message-Id: <200003051856.TAA02910@azenomei.knuffel.net>
Date: Sun, 5 Mar 2000 19:56:00 +0100 (CET)
From: rhialto@polder.ubc.kun.nl
Reply-To: rhialto@polder.ubc.kun.nl
To: gnats-bugs@gnats.netbsd.org
Subject: cross/binutils for vax target
X-Send-Pr-Version: 3.95

>Number:         9547
>Category:       pkg
>Synopsis:       Some changes for a VAX target
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 05 11:00:00 +0000 2000
>Closed-Date:    Sun Jul 14 21:41:37 +0000 2002
>Last-Modified:  Sun Jul 14 21:41:37 +0000 2002
>Originator:     Olaf 'Rhialto' Seibert
>Release:        200002
>Organization:

>Environment:

System: NetBSD azenomei.falu.nl 1.4.1 NetBSD 1.4.1 (AZENOMEI) #22: Tue Feb 22 22:39:20 CET 2000 rhialto@azenomei.falu.nl:/usr/src/sys/arch/alpha/compile/AZENOMEI alpha


>Description:

	Add recognition of a VAX target to cross/binutils.
>How-To-Repeat:
	Want a cross-assembler to VAX.
>Fix:


Here are some changes for the cross/binutils package, to make it recognise
a VAX target.

There are some complications with these patches, I think, and I haven't
figured out the cross building system well enough to provide
satisfactory answers.

- There is already another copy of libbfd and libopcodes in the system
  sources: in src/gnu/dist. There seems to be no synchronisation between
  the cross-binutils and those sources. In fact, I basically took most
  changes here from the src/gnu/dist directory.
- These patches also need to be applied to the binutils that are
  unpacked in the egcs source tree when building the crosscompiler
  (later on, from the cross/vax-netbsd package). This is the third copy
  of binutils stuff. This seems rather inelegant.
- The third copy of binutils stuff seems to be configured, but not
  compiled?
- After changing .am or .in files, one needs to run automake or
  autoconfig. The versions I have of these tools differ from those
  orginally used. The amount of diffs for this is very great, and I left
  them out here.
- I took a file from the first copy of binutils to use here.
    binutils-2.9.1/opcodes/vax-dis.c <- src/gnu/dist/opcodes/vax-dis.c
- Somehow the shared libraries are not build, only the static libraries.
  This causes problems later when building the cross-gcc.
  But this may be a host-specific issue, not target-specific.

A patch to the package:


*** cross/binutils/Makefile.dist	Fri Mar  3 16:45:22 2000
--- cross/binutils/Makefile	Fri Mar  3 16:45:35 2000
***************
*** 31,37 ****
  			m68k-elf m68k-netbsd m68k-sunos4 \
  			mipseb-netbsd mipsel-netbsd \
  			powerpc-eabi powerpcle-eabi \
! 			sparc-netbsd sparc-solaris2 sparc-sunos4

  # this breaks the `sparc-solaris2' target (which adds sparc_elf32
  # which we use for the `sparc-netbsdelf' target
--- 31,38 ----
  			m68k-elf m68k-netbsd m68k-sunos4 \
  			mipseb-netbsd mipsel-netbsd \
  			powerpc-eabi powerpcle-eabi \
! 			sparc-netbsd sparc-solaris2 sparc-sunos4 \
! 			vax-netbsd

  # this breaks the `sparc-solaris2' target (which adds sparc_elf32
  # which we use for the `sparc-netbsdelf' target


These are patches to be added to cross/binutils/patches:

diff -c --recur binutils-old/work.alpha/binutils-2.9.1/bfd/config.bfd binutils-new/work.alpha/binutils-2.9.1/bfd/config.bfd
*** binutils-old/work.alpha/binutils-2.9.1/bfd/config.bfd	Sun Mar  5 19:10:24 2000
--- binutils-new/work.alpha/binutils-2.9.1/bfd/config.bfd	Sun Mar  5 16:45:00 2000
***************
*** 580,585 ****
--- 580,590 ----
      ;;
  #endif

+   vax-*-netbsd*)
+     targ_defvec=vaxnetbsd_vec
+     targ_underscore=yes
+     ;;
+ 
    we32k-*-*)
      targ_defvec=we32kcoff_vec
      ;;

diff -c --recur binutils-old/work.alpha/binutils-2.9.1/bfd/configure.in binutils-new/work.alpha/binutils-2.9.1/bfd/configure.in
*** binutils-old/work.alpha/binutils-2.9.1/bfd/configure.in	Sun Mar  5 19:10:22 2000
--- binutils-new/work.alpha/binutils-2.9.1/bfd/configure.in	Sun Mar  5 18:23:56 2000
***************
*** 511,516 ****
--- 511,517 ----
      tekhex_vec)			tb="$tb tekhex.lo" ;;
      tic30_aout_vec)		tb="$tb aout-tic30.lo" ;;
      tic30_coff_vec)		tb="$tb coff-tic30.lo" ;;
+     vaxnetbsd_vec)		tb="$tb vaxnetbsd.lo aout32.lo " ;;
      we32kcoff_vec)		tb="$tb coff-we32k.lo" ;;
      z8kcoff_vec)		tb="$tb coff-z8k.lo reloc16.lo" ;;
      w65_vec)			tb="$tb coff-w65.lo reloc16.lo" ;;

diff -c --recur binutils-old/work.alpha/binutils-2.9.1/ld/configure.tgt binutils-new/work.alpha/binutils-2.9.1/ld/configure.tgt
*** binutils-old/work.alpha/binutils-2.9.1/ld/configure.tgt	Sun Mar  5 19:10:24 2000
--- binutils-new/work.alpha/binutils-2.9.1/ld/configure.tgt	Sun Mar  5 14:48:55 2000
***************
*** 141,146 ****
--- 141,147 ----
  hppa*-*-lites*)		targ_emul=hppaelf ;;
  hppa*-*-rtems*)		targ_emul=hppaelf ;;
  vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
+ vax-dec-netbsd* ) targ_emul=vax ;;
  mips*-dec-ultrix*)	targ_emul=mipslit ;;
  mips*-dec-osf*)		targ_emul=mipslit ;;
  mips*-sgi-irix[56]*)	targ_emul=elf32bsmip ;;

diff -c --recur binutils-old/work.alpha/binutils-2.9.1/opcodes/Makefile.am binutils-new/work.alpha/binutils-2.9.1/opcodes/Makefile.am
*** binutils-old/work.alpha/binutils-2.9.1/opcodes/Makefile.am	Fri May  1 17:48:18 1998
--- binutils-new/work.alpha/binutils-2.9.1/opcodes/Makefile.am	Sun Mar  5 17:27:01 2000
***************
*** 58,63 ****
--- 58,64 ----
  	sparc-dis.c \
  	sparc-opc.c \
  	tic30-dis.c \
+ 	vax-dis.c \
  	w65-dis.c \
  	z8k-dis.c \
  	z8kgen.c
***************
*** 101,106 ****
--- 102,108 ----
  	tic30-dis.lo \
  	v850-dis.lo \
  	v850-opc.lo \
+ 	vax-dis.lo \
  	w65-dis.lo \
  	z8k-dis.lo

diff -c --recur binutils-old/work.alpha/binutils-2.9.1/opcodes/configure.in binutils-new/work.alpha/binutils-2.9.1/opcodes/configure.in
*** binutils-old/work.alpha/binutils-2.9.1/opcodes/configure.in	Fri May  1 17:48:19 1998
--- binutils-new/work.alpha/binutils-2.9.1/opcodes/configure.in	Sun Mar  5 17:16:16 2000
***************
*** 138,144 ****
  	bfd_tahoe_arch)		;;
  	bfd_tic30_arch)		ta="$ta tic30-dis.lo" ;;
  	bfd_v850_arch)		ta="$ta v850-opc.lo v850-dis.lo" ;;
! 	bfd_vax_arch)		;;
  	bfd_w65_arch)		ta="$ta w65-dis.lo" ;;
  	bfd_we32k_arch)		;;
  	bfd_z8k_arch)		ta="$ta z8k-dis.lo" ;;
--- 138,144 ----
  	bfd_tahoe_arch)		;;
  	bfd_tic30_arch)		ta="$ta tic30-dis.lo" ;;
  	bfd_v850_arch)		ta="$ta v850-opc.lo v850-dis.lo" ;;
! 	bfd_vax_arch)		ta="$ta vax-dis.lo" ;;
  	bfd_w65_arch)		ta="$ta w65-dis.lo" ;;
  	bfd_we32k_arch)		;;
  	bfd_z8k_arch)		ta="$ta z8k-dis.lo" ;;

-Olaf.
--
___ Olaf 'Rhialto' Seibert - rhialto@polder.ubc.     -- If one tells the truth,
\X/ .kun.nl     -- one is sure, sooner or later, to be found out. (Oscar Wilde) 
>Release-Note:
>Audit-Trail:

From: Rhialto <rhialto@azenomei.knuffel.net>
To: gnats-bugs@gnats.netbsd.org
Cc: rhialto@polder.ubc.kun.nl
Subject: Re: pkg/9547: cross/binutils for vax target
Date: Mon, 27 Mar 2000 22:45:39 +0200

 Here are some more patches to the cross/binutils stuff. Again, I prefer
 to leave it to the package maintainer to put these in the correct place
 in the package.

 The HP300 stuff is needed because the code as it was did not check
 the machine type and thought VAX objects could be HP300 objects as well.

 Furthermore, the VAX machine ID was outdated. Note that this means
 there is no vax1k support in binutils, only vax4k.


 diff -c binutils-old/work.alpha/binutils-2.9.1/bfd/libaout.h binutils/work.alpha/binutils-2.9.1/bfd/libaout.h
 *** binutils-old/work.alpha/binutils-2.9.1/bfd/libaout.h	Sun Mar  5 19:10:22 2000
 --- binutils/work.alpha/binutils-2.9.1/bfd/libaout.h	Mon Mar 27 02:43:49 2000
 ***************
 *** 230,247 ****
     M_532_NETBSD = 137,	/* NetBSD/ns32k binary */
     M_SPARC_NETBSD = 138,	/* NetBSD/sparc binary */
     M_PMAX_NETBSD = 139,	/* NetBSD/pmax (MIPS little-endian) binary */
 !   M_VAX_NETBSD = 140,	/* NetBSD/vax binary */
     M_ALPHA_NETBSD = 141,	/* NetBSD/alpha binary */
     M_ARM6_NETBSD = 143,  /* NetBSD/arm32 binary */
     M_SPARCLET_1 = 147,	/* 0x93, reserved */
     M_MIPS1 = 151,        /* MIPS R2000/R3000 binary */
     M_MIPS2 = 152,        /* MIPS R4000/R6000 binary */
     M_SPARCLET_2 = 163,	/* 0xa3, reserved */
     M_SPARCLET_3 = 179,	/* 0xb3, reserved */
     M_SPARCLET_4 = 195,	/* 0xc3, reserved */
     M_HP200 = 200,	/* HP 200 (68010) BSD binary */
 !   M_HP300 = (300 % 256), /* HP 300 (68020+68881) BSD binary */
 !   M_HPUX = (0x20c % 256), /* HP 200/300 HPUX binary */
     M_SPARCLET_5 = 211,	/* 0xd3, reserved */
     M_SPARCLET_6 = 227,	/* 0xe3, reserved */
     M_SPARCLET_7 = 243	/* 0xf3, reserved */
 --- 230,248 ----
     M_532_NETBSD = 137,	/* NetBSD/ns32k binary */
     M_SPARC_NETBSD = 138,	/* NetBSD/sparc binary */
     M_PMAX_NETBSD = 139,	/* NetBSD/pmax (MIPS little-endian) binary */
 !   M_VAX1K_NETBSD = 140,	/* NetBSD/vax1k binary */
     M_ALPHA_NETBSD = 141,	/* NetBSD/alpha binary */
     M_ARM6_NETBSD = 143,  /* NetBSD/arm32 binary */
     M_SPARCLET_1 = 147,	/* 0x93, reserved */
 +   M_VAX_NETBSD = 150,	/* NetBSD/vax binary */
     M_MIPS1 = 151,        /* MIPS R2000/R3000 binary */
     M_MIPS2 = 152,        /* MIPS R4000/R6000 binary */
     M_SPARCLET_2 = 163,	/* 0xa3, reserved */
     M_SPARCLET_3 = 179,	/* 0xb3, reserved */
     M_SPARCLET_4 = 195,	/* 0xc3, reserved */
     M_HP200 = 200,	/* HP 200 (68010) BSD binary */
 !   M_HP300 = 300,	/* HP 300 (68020+68881) BSD binary */
 !   M_HPUX = 0x20c,	/* HP 200/300 HPUX binary */
     M_SPARCLET_5 = 211,	/* 0xd3, reserved */
     M_SPARCLET_6 = 227,	/* 0xe3, reserved */
     M_SPARCLET_7 = 243	/* 0xf3, reserved */

 diff -c binutils-old/work.alpha/binutils-2.9.1/bfd/hp300bsd.c binutils/work.alpha/binutils-2.9.1/bfd/hp300bsd.c
 *** binutils-old/work.alpha/binutils-2.9.1/bfd/hp300bsd.c	Fri May  1 17:48:10 1998
 --- binutils/work.alpha/binutils-2.9.1/bfd/hp300bsd.c	Mon Mar 27 18:21:17 2000
 ***************
 *** 26,31 ****
 --- 26,32 ----
   #define TARGET_PAGE_SIZE 4096
   #define SEGMENT_SIZE TARGET_PAGE_SIZE
   #define DEFAULT_ARCH bfd_arch_m68k
 + #define MACHTYPE_OK(mtype) ((mtype) == M_HP300 || (mtype) == (M_HP300 & 0xFF) || (mtype) == M_UNKNOWN)

   #define MY(OP) CAT(hp300bsd_,OP)
   #define TARGETNAME "a.out-hp300bsd"

 diff -c binutils-old/work.alpha/binutils-2.9.1/opcodes/disassemble.c binutils/work.alpha/binutils-2.9.1/opcodes/disassemble.c
 *** binutils-old/work.alpha/binutils-2.9.1/opcodes/disassemble.c	Fri May  1 17:48:18 1998
 --- binutils/work.alpha/binutils-2.9.1/opcodes/disassemble.c	Mon Mar 27 21:41:23 2000
 ***************
 *** 42,47 ****
 --- 42,48 ----
   #define ARCH_sparc
   #define ARCH_tic30
   #define ARCH_v850
 + #define ARCH_vax
   #define ARCH_w65
   #define ARCH_z8k
   #endif
 ***************
 *** 192,197 ****
 --- 193,203 ----
   #ifdef ARCH_v850
       case bfd_arch_v850:
         disassemble = print_insn_v850;
 +       break;
 + #endif
 + #ifdef ARCH_vax
 +     case bfd_arch_vax:
 +       disassemble = print_insn_vax;
         break;
   #endif
   #ifdef ARCH_w65

 diff -c binutils-old/work.alpha/binutils-2.9.1/include/dis-asm.h binutils/work.alpha/binutils-2.9.1/include/dis-asm.h
 *** binutils-old/work.alpha/binutils-2.9.1/include/dis-asm.h	Fri May  1 17:48:22 1998
 --- binutils/work.alpha/binutils-2.9.1/include/dis-asm.h	Mon Mar 27 21:47:38 2000
 ***************
 *** 173,178 ****
 --- 173,179 ----
   extern int print_insn_w65		PARAMS ((bfd_vma, disassemble_info*));
   extern int print_insn_d10v		PARAMS ((bfd_vma, disassemble_info*));
   extern int print_insn_v850		PARAMS ((bfd_vma, disassemble_info*));
 + extern int print_insn_vax		PARAMS ((bfd_vma, disassemble_info*));
   extern int print_insn_tic30		PARAMS ((bfd_vma, disassemble_info*));

   /* Fetch the disassembler for a given BFD, if that support is available.  */
State-Changed-From-To: open->feedback 
State-Changed-By: wiz 
State-Changed-When: Sun Jul 14 14:36:01 PDT 2002 
State-Changed-Why:  
Now that build.sh provides an easy way to provide a cross-compiler, do 
you still think this PR is needed? 
State-Changed-From-To: feedback->closed 
State-Changed-By: wiz 
State-Changed-When: Sun Jul 14 14:40:55 PDT 2002 
State-Changed-Why:  
Mail bounced. 
Use a current NetBSD cvs co and build.sh. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.