This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: miscellaneous nits in NetBSD configuration


The following message is a courtesy copy of an article
that has been posted to cygnus.egcs as well.

[NOT ON THIS MAILING LIST, but watching egcs-bugs]

As part of the egcs 1.1 integration into the NetBSD source tree, I'm pruning
the configuration a bit, and have found the following changes to bring egcs
up-to-date with NetBSD (and make a few things work properly).  It corrects
configure to work with all NetBSD architecture names, which I'll submit a
change to config.guess to make use of; also, one arch is changing names,
mips to mipsel.

And, all archs are set to the xm-netbsd.h file (xm-siglist as on arm is
Wrong, and though xm-netbsd.h doesn't have much, it's there and should be
made use of Just In Case).

The copyright on these changes is hereby transferred to Cygnus to be applied
under the GPL to egcs.

One change I cannot put in - because of the way it's used - is as follows:
The files pexecute.c, gcc.c, and collect2.c use vfork() to spawn child
processes.  This "works" on NetBSD only because it calls an "old" version of
the vfork() call, which is just fork() with child blocking.  There's two
things broken here:

- these files do not include <unistd.h> to get the redefinition of vfork().
- they call exit(), not _exit(), as required by a vfork() call with shared
  memory between parent and child.

I'm not sure how to implement such a fix for these to gain the faster
vfork() implementation (which has _real_ shared memory semantics, hence it
_must_ use _exit()).

===== ChangeLog entry

Tue Jul 28 19:21:52 EDT 1998  Todd Vierling <tv@netbsd.org>

	* configure.in: Use xm-netbsd.h as the NetBSD xm file (not xm-siglist).
	Accept arm32 as arm, m68k4k as m68k, mipsle as mips-dec, and any
	manufacturer id for ns32k.
	* configure: Regen.
	* config/netbsd.h: When using ASM_WEAKEN_LABEL, make it global too.
	* config/t-netbsd: Don't compile libgcc1-test as the fns are in libc.
	* config/i386/netbsd.h: Undefine DWARF2_UNWIND_INFO, not define as 0.
	* config/m68k/netbsd.h: Same.
	* config/ns32k/netbsd.h: Same.
	* config/sparc/netbsd.h: Same.

===== Diff (relative to gcc subdir)

Index: configure
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure,v
retrieving revision 1.129.2.2
diff -c -r1.129.2.2 configure
*** configure	1998/07/20 23:57:20	1.129.2.2
--- configure	1998/07/29 02:16:59
***************
*** 2290,2295 ****
--- 2290,2296 ----
  		;;
  	alpha*-*-netbsd*)
  		tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsdl-elf.h"
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		target_cpu_default="MASK_GAS"
  		tmake_file="alpha/t-crtbe"
  		extra_parts="crtbegin.o crtend.o"
***************
*** 2390,2398 ****
  		tmake_file=arm/t-semiaof
  		fixincludes=Makefile.in # There is nothing to fix
  		;;
! 	arm-*-netbsd*)
  		tm_file=arm/netbsd.h
! 		xm_file="xm-siglist.h ${xm_file}"
  		tmake_file="t-netbsd arm/t-netbsd"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
--- 2391,2399 ----
  		tmake_file=arm/t-semiaof
  		fixincludes=Makefile.in # There is nothing to fix
  		;;
! 	arm*-*-netbsd*)
  		tm_file=arm/netbsd.h
! 		xm_file="xm-netbsd.h ${xm_file}"
  		tmake_file="t-netbsd arm/t-netbsd"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
***************
*** 2749,2754 ****
--- 2750,2756 ----
  		;;
  	i[34567]86-*-netbsd*)
  		tm_file=i386/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 3513,3520 ****
  		extra_headers=math-68881.h
  		float_format=m68k
  		;;
! 	m68k-*-netbsd*)
  		tm_file=m68k/netbsd.h
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
--- 3515,3523 ----
  		extra_headers=math-68881.h
  		float_format=m68k
  		;;
! 	m68k*-*-netbsd*)
  		tm_file=m68k/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 3833,3840 ****
  			use_collect2=yes
  	      fi
  	      ;;
! 	mips-dec-netbsd*)                  # Decstation running NetBSD
  		tm_file=mips/netbsd.h
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
--- 3836,3844 ----
  			use_collect2=yes
  	      fi
  	      ;;
! 	mipsel-*-netbsd* | mips-dec-netbsd*)    # Decstation running NetBSD
  		tm_file=mips/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 4163,4170 ****
  		xm_defines=USG
  		use_collect2=yes
  		;;
! 	ns32k-pc532-netbsd*)
  		tm_file=ns32k/netbsd.h
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
--- 4167,4175 ----
  		xm_defines=USG
  		use_collect2=yes
  		;;
! 	ns32k-*-netbsd*)
  		tm_file=ns32k/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 4459,4464 ****
--- 4464,4470 ----
  		;;
  	sparc-*-netbsd*)
  		tm_file=sparc/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 4651,4656 ****
--- 4657,4663 ----
  		;;
  	vax-*-netbsd*)
  		tm_file="${tm_file} netbsd.h vax/netbsd.h"
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.129.2.2
diff -c -r1.129.2.2 configure.in
*** configure.in	1998/07/20 23:57:19	1.129.2.2
--- configure.in	1998/07/29 02:17:08
***************
*** 386,391 ****
--- 386,392 ----
  		;;
  	alpha*-*-netbsd*)
  		tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsdl-elf.h"
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		target_cpu_default="MASK_GAS"
  		tmake_file="alpha/t-crtbe"
  		extra_parts="crtbegin.o crtend.o"
***************
*** 486,494 ****
  		tmake_file=arm/t-semiaof
  		fixincludes=Makefile.in # There is nothing to fix
  		;;
! 	arm-*-netbsd*)
  		tm_file=arm/netbsd.h
! 		xm_file="xm-siglist.h ${xm_file}"
  		tmake_file="t-netbsd arm/t-netbsd"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
--- 487,495 ----
  		tmake_file=arm/t-semiaof
  		fixincludes=Makefile.in # There is nothing to fix
  		;;
! 	arm*-*-netbsd*)
  		tm_file=arm/netbsd.h
! 		xm_file="xm-netbsd.h ${xm_file}"
  		tmake_file="t-netbsd arm/t-netbsd"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
***************
*** 845,850 ****
--- 846,852 ----
  		;;
  	i[[34567]]86-*-netbsd*)
  		tm_file=i386/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 1609,1616 ****
  		extra_headers=math-68881.h
  		float_format=m68k
  		;;
! 	m68k-*-netbsd*)
  		tm_file=m68k/netbsd.h
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
--- 1611,1619 ----
  		extra_headers=math-68881.h
  		float_format=m68k
  		;;
! 	m68k*-*-netbsd*)
  		tm_file=m68k/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 1929,1936 ****
  			use_collect2=yes
  	      fi
  	      ;;
! 	mips-dec-netbsd*)                  # Decstation running NetBSD
  		tm_file=mips/netbsd.h
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
--- 1932,1940 ----
  			use_collect2=yes
  	      fi
  	      ;;
! 	mipsel-*-netbsd* | mips-dec-netbsd*)    # Decstation running NetBSD
  		tm_file=mips/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 2259,2266 ****
  		xm_defines=USG
  		use_collect2=yes
  		;;
! 	ns32k-pc532-netbsd*)
  		tm_file=ns32k/netbsd.h
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
--- 2263,2271 ----
  		xm_defines=USG
  		use_collect2=yes
  		;;
! 	ns32k-*-netbsd*)
  		tm_file=ns32k/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 2555,2560 ****
--- 2560,2566 ----
  		;;
  	sparc-*-netbsd*)
  		tm_file=sparc/netbsd.h
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
***************
*** 2747,2752 ****
--- 2753,2759 ----
  		;;
  	vax-*-netbsd*)
  		tm_file="${tm_file} netbsd.h vax/netbsd.h"
+ 		xm_file="xm-netbsd.h ${xm_file}"
  		# On NetBSD, the headers are already okay, except for math.h.
  		fixincludes=fixinc.wrap
  		tmake_file=t-netbsd
Index: config/netbsd.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/netbsd.h,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 netbsd.h
*** config/netbsd.h	1997/11/02 08:42:18	1.1.1.2
--- config/netbsd.h	1998/07/29 02:17:13
***************
*** 100,106 ****
  
  #undef ASM_WEAKEN_LABEL
  #define ASM_WEAKEN_LABEL(FILE,NAME) \
!   do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
         fputc ('\n', FILE); } while (0)
  
  /* The following macro defines the format used to output the second
--- 100,107 ----
  
  #undef ASM_WEAKEN_LABEL
  #define ASM_WEAKEN_LABEL(FILE,NAME) \
!   do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \
!        fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
         fputc ('\n', FILE); } while (0)
  
  /* The following macro defines the format used to output the second
Index: config/t-netbsd
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/t-netbsd,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 t-netbsd
*** config/t-netbsd	1997/08/11 15:57:16	1.1.1.1
--- config/t-netbsd	1998/07/29 02:17:13
***************
*** 1,5 ****
--- 1,6 ----
  LIBGCC1=libgcc1.null
  CROSS_LIBGCC1=libgcc1.null
+ LIBGCC1_TEST=
  
  # Don't run fixproto
  STMP_FIXPROTO =
Index: config/i386/netbsd.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/netbsd.h,v
retrieving revision 1.5
diff -c -r1.5 netbsd.h
*** config/i386/netbsd.h	1998/05/22 00:01:12	1.5
--- config/i386/netbsd.h	1998/07/29 02:17:14
***************
*** 81,85 ****
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #define DWARF2_UNWIND_INFO 0
  
--- 81,85 ----
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #undef DWARF2_UNWIND_INFO
  
Index: config/m68k/netbsd.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/m68k/netbsd.h,v
retrieving revision 1.3
diff -c -r1.3 netbsd.h
*** config/m68k/netbsd.h	1998/03/16 12:57:02	1.3
--- config/m68k/netbsd.h	1998/07/29 02:17:15
***************
*** 59,63 ****
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #define DWARF2_UNWIND_INFO 0
  
--- 59,63 ----
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #undef DWARF2_UNWIND_INFO
  
Index: config/ns32k/netbsd.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/ns32k/netbsd.h,v
retrieving revision 1.3
diff -c -r1.3 netbsd.h
*** config/ns32k/netbsd.h	1998/01/13 20:58:47	1.3
--- config/ns32k/netbsd.h	1998/07/29 02:17:15
***************
*** 108,112 ****
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #define DWARF2_UNWIND_INFO 0
  
--- 108,112 ----
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #undefine DWARF2_UNWIND_INFO
  
Index: config/sparc/netbsd.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/sparc/netbsd.h,v
retrieving revision 1.3
diff -c -r1.3 netbsd.h
*** config/sparc/netbsd.h	1998/06/13 13:09:41	1.3
--- config/sparc/netbsd.h	1998/07/29 02:17:16
***************
*** 42,46 ****
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #define DWARF2_UNWIND_INFO 0
  
--- 42,46 ----
  
  /* Until they use ELF or something that handles dwarf2 unwinds
     and initialization stuff better.  */
! #undef DWARF2_UNWIND_INFO
  
-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]