public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC: OpenBSD configurations for gcc 3.3.x
@ 2004-01-12 23:50 Marc Espie
  2004-01-13  0:55 ` Andrew Pinski
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Marc Espie @ 2004-01-12 23:50 UTC (permalink / raw)
  To: gcc; +Cc: gdr

Basically, this is the configuration information for most OpenBSD systems
using gcc 3.3.

I believe it would be appropriate, since it's not too intrusive, and it
won't make any OpenBSD system more broken than some of them are.

Right now, OpenBSD-current can run a `make build' on at least i386,
sparc64, powerpc.  We have fixed all the arch-independent tree (a few
patches are pending, awaiting review), most arch-dependent parts.
In our ports tree, over 2500 packages build correctly on i386, there are 
still 35 broken packages, most of them getting fixed.

Other arches like hppa and alpha are still building.
x86-64 builds a viable cross-compiler.

This patch only contains OpenBSD specific configuration fixes, plus the
requisite paraphernalia.

Notes about what's going on:

- OpenBSD switched from libc/libc_ to libc/libc+libpthread  in its 3.3
release. Splitting out openbsd-libpthread.h/openbsd-libc_r.h was done for
that reason. It's either that, or abandon old OpenBSD systems (I wouldn't
actually mind).

- recent OpenBSD systems have non-executable stacks. The trampoline stuff
is needed for C nested functions, and I have used it in the past to
bootstrap Ada on an i386-a.out system (I haven't had time to try it out
on elf yet).

- fixinc.wrap is enough on all OpenBSD systems. Most of the headers are
shared between architectures, in fact.

- the other infrastructure change is the use of the new
builtin_define/builtin_assert.

Config by config:
- update old i386-a.out config.
- new i386-elf config for OpenBSD >=3.4.
- alpha is now elf.  Old ECOFF OpenBSD alpha was never properly working,
was quite buggy, without shared libraries, and is totally unsupported now.
- sparc is now elf as well, has been for a while. Old a.out config is
completely unsupported.
- new hppa configuration has been working for a while in a 2.95 mutant. 
- new sparc64 configuration has been working for >1 year.
- rs6000 is too intrusive, and will only be submitted for -current.

Now would be a good time to tell me if there is anything seriously wrong
with this patch.   Based on people' comments (and some tests still going
on), I'll probably submit an updated patch for approval in a few days...




Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.266.2.19
diff -u -p -c -r1.266.2.19 config.gcc
*** config.gcc	2 Dec 2003 05:33:15 -0000	1.266.2.19
--- config.gcc	12 Jan 2004 23:28:18 -0000
*************** case $machine in
*** 402,408 ****
  	esac
  	;;
  *-*-openbsd*)
! 	tm_file=${cpu_type}/openbsd.h
  	tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
  	xm_defines=POSIX
  	if test x$enable_threads = xyes; then
--- 402,416 ----
  	esac
  	;;
  *-*-openbsd*)
! 	case $machine in
! 	*-*-openbsd2* | *-*-openbsd3.[012])
! 		openbsd_libspec="openbsd-libc_r.h"
! 		;;
! 	*)
! 		openbsd_libspec="openbsd-libpthread.h"
! 		;;
! 	esac
! 	tm_file="${openbsd_libspec} ${cpu_type}/openbsd.h"
  	tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
  	xm_defines=POSIX
  	if test x$enable_threads = xyes; then
*************** alpha*-*-netbsd*)
*** 578,587 ****
  	;;
  
  alpha*-*-openbsd*)
! 	tm_file="${cpu_type}/${cpu_type}.h ${tm_file}"
  	# default x-alpha is only appropriate for dec-osf.
  	target_cpu_default="MASK_GAS"
  	tmake_file="alpha/t-alpha alpha/t-ieee"
  	;;
  
  alpha*-dec-osf[45]*)
--- 586,596 ----
  	;;
  
  alpha*-*-openbsd*)
!  	tm_file="alpha/alpha.h alpha/elf.h alpha/openbsd1.h openbsd.h ${tm_file}"
  	# default x-alpha is only appropriate for dec-osf.
  	target_cpu_default="MASK_GAS"
  	tmake_file="alpha/t-alpha alpha/t-ieee"
+ 	gas=yes gnu_ld=yes
  	;;
  
  alpha*-dec-osf[45]*)
*************** hppa*-*-linux* | parisc*-*-linux*)
*** 818,825 ****
  	tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
  	;;
  hppa*-*-openbsd*)
! 	target_cpu_default="MASK_PA_11"
! 	tmake_file=pa/t-bsd
  	;;
  hppa1.1-*-pro*)
  	target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
--- 827,834 ----
  	tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
  	;;
  hppa*-*-openbsd*)
! 	target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS"
! 	tmake_file="t-libc-ok t-openbsd t-openbsd-thread pa/t-openbsd"
  	;;
  hppa1.1-*-pro*)
  	target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
*************** i[34567]86-*-netbsd*)
*** 1142,1154 ****
  x86_64-*-netbsd*)
  	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
  	;;
! i[34567]86-*-openbsd*)
  	tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h ${tm_file}"
  	# needed to unconfuse gdb
  	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
  	# we need collect2 until our bug is fixed...
  	use_collect2=yes
  	;;
  i[34567]86-*-coff*)
  	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
  	;;
--- 1151,1177 ----
  x86_64-*-netbsd*)
  	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
  	;;
! i[34567]86-*-openbsd2* | i[34567]86-*-openbsd3.[0123])
  	tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h ${tm_file}"
  	# needed to unconfuse gdb
  	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
  	# we need collect2 until our bug is fixed...
  	use_collect2=yes
  	;;
+ i[34567]86-*-openbsd*)
+ 	# needed to unconfuse gdb
+ 	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
+ 	tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
+ 	tm_file="${tm_file} exec-stack.h"
+ 	tm_file="${tm_file} openbsd.h openbsd-libpthread.h i386/openbsdelf.h"
+ 	gas=yes
+ 	gnu_ld=yes
+ 	stabs=yes
+   	;;
+ x86_64-*-openbsd*)
+ 	tm_file="i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h openbsd.h openbsd-libpthread.h i386/x86-64.h i386/openbsd64.h"
+ 	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
+ 	;;
  i[34567]86-*-coff*)
  	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
  	;;
*************** sparc-*-netbsd*)
*** 2397,2413 ****
  	use_collect2=yes
  	;;
  sparc-*-openbsd*)
! 	tm_file="sparc/sparc.h ${tm_file}"
  	# needed to unconfuse gdb
  	tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
  	# we need collect2 until our bug is fixed...
  	use_collect2=yes
  	;;
  sparc64-*-openbsd*)
! 	tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h"
  	xm_file=sparc/xm-sp64.h
  	gas=yes gnu_ld=yes
  	with_cpu=ultrasparc
  	;;
  sparc-*-bsd*)
  	tm_file="${tm_file} sparc/bsd.h"
--- 2420,2438 ----
  	use_collect2=yes
  	;;
  sparc-*-openbsd*)
! 	tm_file="sparc/sparc.h elfos.h svr4.h sparc/sysv4.h ${tm_file}"
  	# needed to unconfuse gdb
  	tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
  	# we need collect2 until our bug is fixed...
+ 	gas=yes gnu_ld=yes
  	use_collect2=yes
  	;;
  sparc64-*-openbsd*)
! 	tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h ${openbsd_libspec} sparc/openbsd64.h"
  	xm_file=sparc/xm-sp64.h
  	gas=yes gnu_ld=yes
  	with_cpu=ultrasparc
+ 	float_format=i128
  	;;
  sparc-*-bsd*)
  	tm_file="${tm_file} sparc/bsd.h"
Index: config/exec-stack.h
===================================================================
RCS file: config/exec-stack.h
diff -N config/exec-stack.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/exec-stack.h	12 Jan 2004 23:28:18 -0000
***************
*** 0 ****
--- 1,40 ----
+ /* Enable stack execute around trampoline address.  
+    Copyright (C) 2002 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #undef FINALIZE_TRAMPOLINE
+ #define FINALIZE_TRAMPOLINE(TRAMP) \
+   emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), \
+ 		    0, VOIDmode, 1, memory_address (SImode, (TRAMP)), Pmode)
+ 
+ #undef TRANSFER_FROM_TRAMPOLINE
+ #define TRANSFER_FROM_TRAMPOLINE					\
+ extern void __enable_execute_stack (void *);				\
+ void									\
+ __enable_execute_stack (addr)						\
+      void *addr;							\
+ {									\
+   long size = getpagesize ();						\
+   long mask = ~(size-1);						\
+   char *page = (char *) (((long) addr) & mask); 			\
+   char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ 								      \
+   if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
+     perror ("mprotect of trampoline code");				\
+ }
Index: config/openbsd-libc_r.h
===================================================================
RCS file: config/openbsd-libc_r.h
diff -N config/openbsd-libc_r.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/openbsd-libc_r.h	12 Jan 2004 23:28:18 -0000
***************
*** 0 ****
--- 1,24 ----
+ /* LIB_SPEC appropriate for OpenBSD.  Select the appropriate libc, 
+    depending on profiling and threads.  Basically,
+    -lc(_r)?(_p)?, select _r for threads, and _p for p or pg.  */
+ /*  Copyright (C) 2004 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
+ 
Index: config/openbsd-libpthread.h
===================================================================
RCS file: config/openbsd-libpthread.h
diff -N config/openbsd-libpthread.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/openbsd-libpthread.h	12 Jan 2004 23:28:18 -0000
***************
*** 0 ****
--- 1,23 ----
+ /* LIB_SPEC appropriate for OpenBSD.  Include -lpthread if -pthread is
+    specified on the command line. */
+ /*   Copyright (C) 2004 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+ 
Index: config/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/openbsd.h,v
retrieving revision 1.15
diff -u -p -c -r1.15 openbsd.h
*** config/openbsd.h	26 Nov 2002 04:54:46 -0000	1.15
--- config/openbsd.h	12 Jan 2004 23:28:19 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 52,71 ****
  
  #ifdef OPENBSD_NATIVE
  
- #undef GCC_INCLUDE_DIR
- #define GCC_INCLUDE_DIR "/usr/include"
- 
  /* The compiler is configured with ONLY the gcc/g++ standard headers.  */
  #undef INCLUDE_DEFAULTS
  #define INCLUDE_DEFAULTS			\
    {						\
      { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },	\
!     { GCC_INCLUDE_DIR, "GCC", 0, 0 },		\
      { 0, 0, 0, 0 }				\
    }
  
  /* Under OpenBSD, the normal location of the various *crt*.o files is the
     /usr/lib directory.  */
  #define STANDARD_STARTFILE_PREFIX	"/usr/lib/"
  
  #endif
--- 52,71 ----
  
  #ifdef OPENBSD_NATIVE
  
  /* The compiler is configured with ONLY the gcc/g++ standard headers.  */
  #undef INCLUDE_DEFAULTS
  #define INCLUDE_DEFAULTS			\
    {						\
      { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },	\
!     { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 },\
!     { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \
!     { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 },	\
      { 0, 0, 0, 0 }				\
    }
  
  /* Under OpenBSD, the normal location of the various *crt*.o files is the
     /usr/lib directory.  */
+ #undef STANDARD_STARTFILE_PREFIX
  #define STANDARD_STARTFILE_PREFIX	"/usr/lib/"
  
  #endif
*************** Boston, MA 02111-1307, USA.  */
*** 73,80 ****
  \f
  /* Controlling the compilation driver.  */
  
  /* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
!    XXX the way threads are handling currently is not very satisfying,
     since all code must be compiled with -pthread to work. 
     This two-stage defines makes it easy to pick that for targets that
     have subspecs.  */
--- 73,111 ----
  \f
  /* Controlling the compilation driver.  */
  
+ /* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets.  */
+ #define OPENBSD_OS_CPP_BUILTINS_COMMON()	\
+   do						\
+     {						\
+       builtin_define ("__OpenBSD__");		\
+       builtin_define ("__unix__");		\
+       builtin_define ("__ANSI_COMPAT");		\
+       builtin_assert ("system=unix");		\
+       builtin_assert ("system=bsd");		\
+       builtin_assert ("system=OpenBSD");	\
+     }						\
+   while (0)
+ 
+ /* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets.  */
+ #define OPENBSD_OS_CPP_BUILTINS_ELF()		\
+   do						\
+     {						\
+       OPENBSD_OS_CPP_BUILTINS_COMMON();		\
+       builtin_define ("__ELF__");		\
+     }						\
+   while (0)
+ 
+ /* TARGET_OS_CPP_BUILTINS() common to all LP64 OpenBSD targets.  */
+ #define OPENBSD_OS_CPP_BUILTINS_LP64()		\
+   do						\
+     {						\
+       builtin_define ("_LP64");			\
+       builtin_define ("__LP64__");		\
+     }						\
+   while (0)
+ 
  /* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
!    XXX the way threads are handled currently is not very satisfying,
     since all code must be compiled with -pthread to work. 
     This two-stage defines makes it easy to pick that for targets that
     have subspecs.  */
*************** Boston, MA 02111-1307, USA.  */
*** 84,94 ****
  #define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
  #endif
  
- /* LIB_SPEC appropriate for OpenBSD.  Select the appropriate libc, 
-    depending on profiling and threads.  Basically, 
-    -lc(_r)?(_p)?, select _r for threads, and _p for p or pg.  */
- #define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
- 
  #ifndef OBSD_HAS_CORRECT_SPECS
  
  #ifndef OBSD_NO_DYNAMIC_LIBRARIES
--- 115,120 ----
*************** do {									 \
*** 288,291 ****
     work.  On the other hand, we don't define HANDLE_PRAGMA_WEAK directly,
     as this depends on a few other details as well...  */
  #define HANDLE_SYSV_PRAGMA 1
- 
--- 314,316 ----
Index: config/alpha/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/openbsd.h,v
retrieving revision 1.6
diff -u -p -c -r1.6 openbsd.h
*** config/alpha/openbsd.h	13 May 2002 05:57:38 -0000	1.6
--- config/alpha/openbsd.h	12 Jan 2004 23:28:19 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 21,50 ****
  /* We settle for little endian for now.  */
  #define TARGET_ENDIAN_DEFAULT 0
  
- #define OBSD_NO_DYNAMIC_LIBRARIES
- #define OBSD_HAS_DECLARE_FUNCTION_NAME
- #define OBSD_HAS_DECLARE_FUNCTION_SIZE
- #define OBSD_HAS_DECLARE_OBJECT
- 
- /* alpha ecoff supports only weak aliases, see below.  */
- #define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS (FILE,NAME,0)
- 
- #include <openbsd.h>
- 
  /* Controlling the compilation driver.  */
  
  /* alpha needs __start.  */
  #undef LINK_SPEC
  #define LINK_SPEC \
!   "%{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{assert*}"
  
  /* run-time target specifications */
  #define TARGET_OS_CPP_BUILTINS()		\
      do {					\
! 	builtin_define ("__OpenBSD__");		\
! 	builtin_define ("__ANSI_COMPAT");	\
! 	builtin_define ("__unix__");		\
! 	builtin_assert ("system=unix");		\
      } while (0)
  
  /* Layout of source language data types.  */
--- 21,51 ----
  /* We settle for little endian for now.  */
  #define TARGET_ENDIAN_DEFAULT 0
  
  /* Controlling the compilation driver.  */
  
  /* alpha needs __start.  */
  #undef LINK_SPEC
  #define LINK_SPEC \
!   "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
!    %{shared:-shared} %{R*} \
!    %{static:-Bstatic} \
!    %{!static:-Bdynamic} \
!    %{assert*} \
!    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
! 
! /* As an elf system, we need crtbegin/crtend stuff.  */
! #undef STARTFILE_SPEC
! #define STARTFILE_SPEC "\
! 	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
! 	crtbegin%O%s} %{shared:crtbeginS%O%s}"
! #undef ENDFILE_SPEC
! #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  
  /* run-time target specifications */
  #define TARGET_OS_CPP_BUILTINS()		\
      do {					\
! 	OPENBSD_OS_CPP_BUILTINS_ELF();		\
! 	OPENBSD_OS_CPP_BUILTINS_LP64();		\
      } while (0)
  
  /* Layout of source language data types.  */
*************** Boston, MA 02111-1307, USA.  */
*** 63,129 ****
  #define WCHAR_TYPE_SIZE 32
  
  \f
! #undef PREFERRED_DEBUGGING_TYPE
! #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
  
  #define LOCAL_LABEL_PREFIX	"."
  
! /* We don't have an init section yet.  */
! #undef HAS_INIT_SECTION
! 
! /* collect2 support (assembler format: macros for initialization).  */
! 
! /* Don't tell collect2 we use COFF as we don't have (yet ?) a dynamic ld
!    library with the proper functions to handle this -> collect2 will
!    default to using nm.  */
! #undef OBJECT_FORMAT_COFF
! #undef EXTENDED_COFF
! 
! /* Assembler format: exception region output.  */
! 
! /* All configurations that don't use elf must be explicit about not using
!    dwarf unwind information. egcs doesn't try too hard to check internal
!    configuration files...  */
! #ifdef INCOMING_RETURN_ADDR_RTX
! #undef DWARF2_UNWIND_INFO
! #define DWARF2_UNWIND_INFO 0
! #endif
! 
! /* Assembler format: file framework.  */
! 
! /* Taken from alpha/osf.h. This used to be common to all alpha
!    configurations, but elf has departed from it.
!    Check alpha/alpha.h, alpha/osf.h for it when egcs is upgraded.  */
! #ifndef ASM_FILE_START
! #define ASM_FILE_START(FILE)					\
! {								\
!   alpha_write_verstamp (FILE);					\
!   fprintf (FILE, "\t.set noreorder\n");				\
!   fprintf (FILE, "\t.set volatile\n");                          \
!   fprintf (FILE, "\t.set noat\n");				\
!   if (TARGET_SUPPORT_ARCH)					\
!     fprintf (FILE, "\t.arch %s\n",				\
!              TARGET_CPU_EV6 ? "ev6"				\
! 	     : (TARGET_CPU_EV5					\
! 		? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
! 		: "ev4"));					\
! 								\
!   ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename);	\
! }
! #endif
! 
! /* Assembler format: label output.  */
! 
! #define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE)	\
!  do {						\
!   fputs ("\t.weakext\t", FILE);			\
!   assemble_name (FILE, NAME);			\
!   if (VALUE)					\
!     {						\
!       fputs (" , ", FILE);			\
!       assemble_name (FILE, VALUE);		\
!     }						\
!   fputc ('\n', FILE);				\
!  } while (0)
! 
  
--- 64,85 ----
  #define WCHAR_TYPE_SIZE 32
  
  \f
! /* #undef PREFERRED_DEBUGGING_TYPE */
! /* #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG */
  
+ /* Output and generation of labels.  */
  #define LOCAL_LABEL_PREFIX	"."
  
! /* .set on alpha is not used to output labels.  */
! #undef SET_ASM_OP
  
+ /* So, provide corresponding default, without the .set.  */
+ #undef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
+ #define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO)     \
+  do {                                                                   \
+   assemble_name (FILE, SY);                                             \
+   fputc ('=', FILE);                                                    \
+   assemble_name (FILE, HI);                                             \
+   fputc ('-', FILE);                                                    \
+   assemble_name (FILE, LO);                                             \
+   } while (0)
Index: config/alpha/openbsd1.h
===================================================================
RCS file: config/alpha/openbsd1.h
diff -N config/alpha/openbsd1.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/alpha/openbsd1.h	12 Jan 2004 23:28:19 -0000
***************
*** 0 ****
--- 1,23 ----
+ /* Configuration fragment for an alpha OpenBSD target.
+    Copyright (C) 1999 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #define OBSD_HAS_DECLARE_FUNCTION_NAME
+ #define OBSD_HAS_DECLARE_FUNCTION_SIZE
+ #define OBSD_HAS_DECLARE_OBJECT
Index: config/i386/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/openbsd.h,v
retrieving revision 1.18
diff -u -p -c -r1.18 openbsd.h
*** config/i386/openbsd.h	20 Oct 2002 22:37:10 -0000	1.18
--- config/i386/openbsd.h	12 Jan 2004 23:28:19 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 29,39 ****
  #define TARGET_OS_CPP_BUILTINS()		\
    do						\
      {						\
! 	builtin_define ("__unix__");		\
! 	builtin_define ("__OpenBSD__");		\
! 	builtin_assert ("system=unix");		\
! 	builtin_assert ("system=bsd");		\
! 	builtin_assert ("system=OpenBSD");	\
      }						\
    while (0)
  
--- 29,35 ----
  #define TARGET_OS_CPP_BUILTINS()		\
    do						\
      {						\
!     	OPENBSD_OS_CPP_BUILTINS_COMMON();	\
      }						\
    while (0)
  
*************** Boston, MA 02111-1307, USA.  */
*** 101,103 ****
--- 97,115 ----
  
  /* OpenBSD gas currently does not support quad, so do not use it.  */
  #undef ASM_QUAD
+ 
+ #define TRANSFER_FROM_TRAMPOLINE					\
+ extern void __enable_execute_stack (void *);				\
+ void									\
+ __enable_execute_stack (addr)						\
+      void *addr;							\
+ {									\
+   long size = getpagesize ();						\
+   long mask = ~(size-1);						\
+   char *page = (char *) (((long) addr) & mask); 			\
+   char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ 								      \
+   /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ 			\
+   if (mprotect (page, end - page, 7) < 0)				\
+     perror ("mprotect of trampoline code");				\
+ }
Index: config/i386/openbsd64.h
===================================================================
RCS file: config/i386/openbsd64.h
diff -N config/i386/openbsd64.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/i386/openbsd64.h	12 Jan 2004 23:28:19 -0000
***************
*** 0 ****
--- 1,123 ----
+ /* Configuration for an OpenBSD x86-64 target.
+    
+    Copyright (C) 2003 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #undef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (OpenBSD/x86-64 ELF)")
+ 
+ /* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
+    libraries compiled with the native cc, so undef it. */
+ #undef NO_DOLLAR_IN_LABEL
+ 
+ /* Override the default comment-starter of "/".  */
+ #undef ASM_COMMENT_START
+ #define ASM_COMMENT_START "#"
+ 
+ /* Run-time target specifications */
+ 
+ #define TARGET_OS_CPP_BUILTINS()		\
+   do						\
+     {						\
+     	OPENBSD_OS_CPP_BUILTINS_ELF();		\
+ 	OPENBSD_OS_CPP_BUILTINS_LP64();		\
+ 	builtin_define ("__unix__");		\
+ 	builtin_assert ("system=bsd");		\
+     }						\
+   while (0)
+ 
+ /* As an elf system, we need crtbegin/crtend stuff.  */
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC "\
+ 	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
+ 	crtbegin%O%s} %{shared:crtbeginS%O%s}"
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+ 
+ /* Layout of source language data types.  */
+ 
+ /* This must agree with <machine/ansi.h> */
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "long unsigned int"
+ 
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "long int"
+ 
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "int"
+ 
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE 32
+ 
+ /* Assembler format: overall framework.  */
+ 
+ #undef ASM_APP_ON
+ #define ASM_APP_ON "#APP\n"
+ 
+ #undef ASM_APP_OFF
+ #define ASM_APP_OFF "#NO_APP\n"
+ 
+ #undef SET_ASM_OP
+ #define SET_ASM_OP	"\t.set\t"
+ 
+ /* The following macros were originally stolen from i386v4.h.
+    These have to be defined to get PIC code correct.  */
+ 
+ /* Assembler format: dispatch tables.  */
+ 
+ /* Assembler format: sections.  */
+ 
+ /* Stack & calling: aggregate returns.  */
+ 
+ /* Don't default to pcc-struct-return, because gcc is the only compiler, and
+    we want to retain compatibility with older gcc versions.  */
+ #define DEFAULT_PCC_STRUCT_RETURN 0
+ 
+ /* Assembler format: alignment output.  */
+ 
+ /* Stack & calling: profiling.  */
+ 
+ /* OpenBSD's profiler recovers all information from the stack pointer.
+    The icky part is not here, but in machine/profile.h.  */
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO)  \
+   fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
+ 
+ /* Assembler format: exception region output.  */
+ 
+ /* Assembler format: alignment output.  */
+ 
+ /* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
+ 
+ /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+    %{shared:-shared} %{R*} \
+    %{static:-Bstatic} \
+    %{!static:-Bdynamic} \
+    %{assert*} \
+    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+ 
+ #define OBSD_HAS_CORRECT_SPECS
+ 
+ /* pick up defines for mprotect (used in TRANSFER_FROM_TRANPOLINE) */
+ #include <sys/types.h>
+ #include <sys/mman.h>
Index: config/i386/openbsdelf.h
===================================================================
RCS file: config/i386/openbsdelf.h
diff -N config/i386/openbsdelf.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/i386/openbsdelf.h	12 Jan 2004 23:28:19 -0000
***************
*** 0 ****
--- 1,134 ----
+ /* Configuration for an OpenBSD i386 target.
+    
+    Copyright (C) 1999 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ /* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
+    libraries compiled with the native cc, so undef it. */
+ #undef NO_DOLLAR_IN_LABEL
+ 
+ /* Override the default comment-starter of "/".  */
+ #undef ASM_COMMENT_START
+ #define ASM_COMMENT_START "#"
+ 
+ 
+ /* This goes away when the math-emulator is fixed */
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT \
+   (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
+ 
+ /* Run-time target specifications */
+ 
+ #define TARGET_OS_CPP_BUILTINS()		\
+   do						\
+     {						\
+     	OPENBSD_OS_CPP_BUILTINS_ELF();		\
+     }						\
+   while (0)
+ 
+ /* As an elf system, we need crtbegin/crtend stuff.  */
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC "\
+ 	%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
+ 	crtbegin%O%s} %{shared:crtbeginS%O%s}"
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+ 
+ /* Layout of source language data types.  */
+ 
+ /* This must agree with <machine/ansi.h> */
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "unsigned int"
+ 
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "int"
+ 
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "int"
+ 
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE BITS_PER_WORD
+ 
+ /* Assembler format: overall framework.  */
+ 
+ #undef ASM_APP_ON
+ #define ASM_APP_ON "#APP\n"
+ 
+ #undef ASM_APP_OFF
+ #define ASM_APP_OFF "#NO_APP\n"
+ 
+ #undef SET_ASM_OP
+ #define SET_ASM_OP	"\t.set\t"
+ 
+ /* The following macros were originally stolen from i386v4.h.
+    These have to be defined to get PIC code correct.  */
+ 
+ /* Assembler format: dispatch tables.  */
+ 
+ /* Assembler format: sections.  */
+ 
+ /* Stack & calling: aggregate returns.  */
+ 
+ /* Don't default to pcc-struct-return, because gcc is the only compiler, and
+    we want to retain compatibility with older gcc versions.  */
+ #define DEFAULT_PCC_STRUCT_RETURN 0
+ 
+ /* Assembler format: alignment output.  */
+ 
+ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+ #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
+   if ((LOG) != 0) {\
+     if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+     else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
+   }
+ #endif
+ 
+ /* Stack & calling: profiling.  */
+ 
+ /* OpenBSD's profiler recovers all information from the stack pointer.
+    The icky part is not here, but in machine/profile.h.  */
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO)  \
+   fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
+ 
+ /* Assembler format: exception region output.  */
+ 
+ /* our configuration still doesn't handle dwarf2 correctly */
+ #define DWARF2_UNWIND_INFO 0
+ 
+ /* Assembler format: alignment output.  */
+ 
+ /* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
+ 
+ /* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h.  */
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+    %{shared:-shared} %{R*} \
+    %{static:-Bstatic} \
+    %{!static:-Bdynamic} \
+    %{assert*} \
+    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+ 
+ #define OBSD_HAS_CORRECT_SPECS
+ 
+ /* pick up defines for mprotect (used in TRANSFER_FROM_TRANPOLINE) */
+ #include <sys/types.h>
+ #include <sys/mman.h>
Index: config/pa/openbsd.h
===================================================================
RCS file: config/pa/openbsd.h
diff -N config/pa/openbsd.h
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/pa/openbsd.h	12 Jan 2004 23:28:19 -0000
***************
*** 0 ****
--- 1,196 ----
+ /* Configuration file for an hppa risc OpenBSD target.
+    Copyright (C) 1999 Free Software Foundation, Inc.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ 
+ #include <pa/pa.h>
+ #include <pa/pa32-regs.h>
+ #define OBSD_HAS_DECLARE_FUNCTION_NAME
+ #include <openbsd.h>
+ 
+ /* Turn off various SOM crap we don't want.  */
+ #undef TARGET_ELF32
+ #define TARGET_ELF32 1
+ 
+ #undef MAX_OFILE_ALIGNMENT
+ #define	MAX_OFILE_ALIGNMENT 0x8000
+ 
+ /* Run-time target specifications. */
+ #undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS()		\
+   do						\
+     {						\
+ 	OPENBSD_OS_CPP_BUILTINS_ELF();		\
+     }						\
+   while (0)
+ 
+ 
+ #undef OVERRIDE_OPTIONS
+ #define OVERRIDE_OPTIONS						 \
+ {							                 \
+     override_options ();				                 \
+     if (! flag_pic)						         \
+         target_flags |= MASK_PORTABLE_RUNTIME | MASK_FAST_INDIRECT_CALLS;\
+ }
+ 	
+ /* XXX Why doesn't PA support -R  like everyone ??? */
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{EB} %{EL} %{shared} %{non_shared} \
+    %{call_shared} %{no_archive} %{exact_version} \
+    %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
+    %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so} \
+    %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
+    %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
+ 
+ /* Layout of source language data types. */
+ 
+ /* This must agree with <machine/ansi.h> */
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "unsigned int"
+ 
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "int"
+ 
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "int"
+ 
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE 32
+ 
+ /* Output at beginning of assembler file.  */
+ /* This is slightly changed from main pa.h to only output dyncall
+    when compiling PIC. */
+ #undef ASM_FILE_START
+ #define ASM_FILE_START(FILE) \
+ do { \
+      if (write_symbols != NO_DEBUG) \
+        output_file_directive ((FILE), main_input_filename); \
+      if (TARGET_64BIT) \
+        fputs("\t.LEVEL 2.0w\n", FILE); \
+      else if (TARGET_PA_20) \
+        fputs("\t.LEVEL 2.0\n", FILE); \
+      else if (TARGET_PA_11) \
+        fputs("\t.LEVEL 1.1\n", FILE); \
+      else \
+        fputs("\t.LEVEL 1.0\n", FILE); \
+      if (flag_pic || !TARGET_FAST_INDIRECT_CALLS) \
+        fputs ("\t.IMPORT $$dyncall, MILLICODE\n", FILE); \
+      if (profile_flag) \
+        fputs ("\t.IMPORT _mcount, CODE\n", FILE); \
+    } while (0)
+ 
+ #undef ASM_OUTPUT_FUNCTION_PREFIX
+ 
+ /* We want local labels to start with period if made with asm_fprintf.  */
+ #undef LOCAL_LABEL_PREFIX
+ #define LOCAL_LABEL_PREFIX "."
+ 
+ /* Use the default.  */
+ #undef ASM_OUTPUT_LABEL
+ 
+ /* Define these to generate the Linux/ELF/SysV style of internal
+    labels all the time - i.e. to be compatible with
+    ASM_GENERATE_INTERNAL_LABEL in <elfos.h>.  Compare these with the
+    ones in pa.h and note the lack of dollar signs in these.  FIXME:
+    shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
+ 
+ #undef ASM_OUTPUT_ADDR_VEC_ELT
+ #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+   if (TARGET_BIG_SWITCH)					\
+     fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE);		\
+   else								\
+     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+ #undef ASM_OUTPUT_ADDR_DIFF_ELT
+ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+   if (TARGET_BIG_SWITCH)					\
+     fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE);				\
+   else								\
+     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+ 
+ #undef STRING_ASM_OP
+ #define STRING_ASM_OP   ".stringz"
+ 
+ #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
+ 
+ #undef ASM_OUTPUT_SECTION_NAME
+ /* Switch into a generic section.
+    This is currently only used to support section attributes.
+ 
+    We make the section read-only and executable for a function decl,
+    read-only for a const data decl, and writable for a non-const data decl.  */
+ #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+ 	fprintf (FILE, "\t.section\t%s,\"%s\",@progbits\n", NAME, \
+ 	  (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+ 	  (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw")
+ 
+ /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
+    labels in a function declaration (since pa.c seems determined to do
+    it differently)  */
+ 
+ #undef ASM_DECLARE_FUNCTION_NAME
+ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)		\
+   do								\
+     {								\
+       if (TREE_PUBLIC (DECL))					\
+       {								\
+ 	fputs ("\t.export ", FILE);				\
+ 	assemble_name (FILE, NAME);				\
+ 	fputs (", entry\n", FILE);				\
+       }								\
+       ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");	\
+       ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));		\
+     }								\
+   while (0)
+ 
+ /* As well as globalizing the label, we need to encode the label
+    to ensure a plabel is generated in an indirect call.  */
+ #undef ASM_OUTPUT_EXTERNAL_LIBCALL
+ #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)			\
+   do								\
+     {								\
+       if (!FUNCTION_NAME_P (XSTR (FUN, 0)))			\
+         hppa_encode_label (FUN);				\
+       (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));	\
+     }								\
+   while (0)
+ 
+ /* As an elf system, we need crtbegin/crtend stuff.  */
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC "%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} crtbegin%O%s} %{shared:crtbeginS%O%s}"
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+ 
+ #undef TEXT_SECTION_ASM_OP
+ #define TEXT_SECTION_ASM_OP "\t.text"
+ #undef READONLY_DATA_SECTION_ASM_OP
+ #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
+ #undef DATA_SECTION_ASM_OP
+ #define DATA_SECTION_ASM_OP "\t.data"
+ #undef BSS_SECTION_ASM_OP
+ #define BSS_SECTION_ASM_OP "\t.section\t.bss"
+ #define CTORS_SECTION_ASM_OP    "\t.section\t.ctors,\"aw\""
+ #define DTORS_SECTION_ASM_OP    "\t.section\t.dtors,\"aw\""
+ 
+ /* Remove hpux specific pa defines. */
+ #undef LDD_SUFFIX
+ #undef PARSE_LDD_OUTPUT
+ 
+ #undef DO_GLOBAL_DTORS_BODY
+ #define	HAS_INIT_SECTION
Index: config/pa/t-openbsd
===================================================================
RCS file: config/pa/t-openbsd
diff -N config/pa/t-openbsd
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- config/pa/t-openbsd	12 Jan 2004 23:28:19 -0000
***************
*** 0 ****
--- 1,17 ----
+ #Plug millicode routines into libgcc.a  We want these on both native and
+ #cross compiles.  We use the "64-bit" routines because the "32-bit" code
+ #is broken for certain corner cases.
+ 
+ LIB1ASMFUNCS = _divI _divU _remI _remU _div_const _mulI _dyncall
+ LIB1ASMSRC = pa/milli64.S
+ 
+ # Compile libgcc2.a as PIC.
+ TARGET_LIBGCC2_CFLAGS = -DELF=1 -DLINUX
+ 
+ # Don't build a shared libgcc_s.so.  Our libgcc contains millicode, and
+ # the ABI (linker and dynamic linker really) does not allow millicode
+ # to be exported from shared libraries.  Consequently, to successfully
+ # link against libgcc_s.so it is necessary to link against _both_
+ # libgcc_s.so and libgcc.a.  This is a pain.  It's easier just to disable
+ # the shared libgcc.
+ SHLIB_LINK =
Index: config/sparc/openbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/openbsd.h,v
retrieving revision 1.8
diff -u -p -c -r1.8 openbsd.h
*** config/sparc/openbsd.h	20 Oct 2002 22:37:13 -0000	1.8
--- config/sparc/openbsd.h	12 Jan 2004 23:28:19 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 23,29 ****
  #include <openbsd.h>
  
  /* Run-time target specifications.  */
! #define CPP_PREDEFINES "-D__unix__ -D__sparc__ -D__OpenBSD__ -Asystem=unix -Asystem=OpenBSD -Acpu=sparc -Amachine=sparc"
  
  /* Layout of source language data types */
  
--- 23,36 ----
  #include <openbsd.h>
  
  /* Run-time target specifications.  */
! #define TARGET_OS_CPP_BUILTINS()			\
!   do							\
!     {							\
!       OPENBSD_OS_CPP_BUILTINS_ELF();			\
!       builtin_define ("__sparc");			\
!       builtin_define ("__sparc__");			\
!     }							\
!   while (0)
  
  /* Layout of source language data types */
  
Index: config/sparc/openbsd64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/openbsd64.h,v
retrieving revision 1.1
diff -u -p -c -r1.1 openbsd64.h
*** config/sparc/openbsd64.h	30 May 2002 20:35:58 -0000	1.1
--- config/sparc/openbsd64.h	12 Jan 2004 23:28:21 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 31,38 ****
  #define SPARC_DEFAULT_CMODEL CM_MEDMID
  
  /* Run-time target specifications.  */
! #undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-D__unix__ -D__sparc__ -D__sparc64__ -D__sparcv9__ -D__sparc_v9__ -D__arch64__ -D__ELF__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(sparc) -Amachine(sparc)"
  
  #undef CPP_SUBTARGET_SPEC
  #define CPP_SUBTARGET_SPEC ""
--- 31,49 ----
  #define SPARC_DEFAULT_CMODEL CM_MEDMID
  
  /* Run-time target specifications.  */
! #define TARGET_OS_CPP_BUILTINS()			\
!   do							\
!     {							\
!       OPENBSD_OS_CPP_BUILTINS_ELF();			\
!       OPENBSD_OS_CPP_BUILTINS_LP64();			\
!       builtin_define ("__sparc64__");			\
!       builtin_define ("__sparc_v9__");			\
!       builtin_define ("__sparcv9__");			\
!       builtin_define ("__arch64__");			\
!       builtin_define ("__sparc");			\
!       builtin_define ("__sparc__");			\
!     }							\
!   while (0)
  
  #undef CPP_SUBTARGET_SPEC
  #define CPP_SUBTARGET_SPEC ""
*************** Boston, MA 02111-1307, USA.  */
*** 57,62 ****
--- 68,81 ----
  #undef LONG_DOUBLE_TYPE_SIZE
  #define LONG_DOUBLE_TYPE_SIZE 128
  
+ #undef	WINT_TYPE
+ #define	WINT_TYPE "long int"
+ 
+ #undef	WINT_TYPE_SIZE
+ #define	WINT_TYPE_SIZE 32
+ 
+ #define HANDLE_PRAGMA_REDEFINE_EXTNAME 1
+ 
  #undef LINK_SPEC
  #define LINK_SPEC \
    "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
*************** Boston, MA 02111-1307, USA.  */
*** 73,75 ****
--- 92,237 ----
          crtbegin%O%s} %{shared:crtbeginS%O%s}"
  #undef ENDFILE_SPEC
  #define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+ 
+ #undef ASM_CPU_DEFAULT_SPEC
+ #define ASM_CPU_DEFAULT_SPEC "-xarch=v8plusa"
+ 
+ #undef ASM_CPU_SPEC
+ #define ASM_CPU_SPEC "\
+ %{mcpu=v8plus:-xarch=v8plus} \
+ %{mcpu=ultrasparc:-xarch=v8plusa} \
+ %{!mcpu*:%(asm_cpu_default)} \
+ "
+ 
+ /* Same as sparc.h */
+ #undef DBX_REGISTER_NUMBER
+ #define DBX_REGISTER_NUMBER(REGNO) \
+   (TARGET_FLAT && (REGNO) == HARD_FRAME_POINTER_REGNUM ? 31 : REGNO)
+ 
+ /* We use stabs-in-elf by default, because that is what the native
+    toolchain uses.  */
+ #undef PREFERRED_DEBUGGING_TYPE
+ #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+ 
+ /* The Solaris 2 assembler uses .skip, not .zero, so put this back.  */
+ #undef ASM_OUTPUT_SKIP
+ #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
+   fprintf (FILE, "\t.skip %u\n", (SIZE))
+ 
+ #undef  LOCAL_LABEL_PREFIX
+ #define LOCAL_LABEL_PREFIX  "."
+ 
+ /* This is how to output a definition of an internal numbered label where
+    PREFIX is the class of label and NUM is the number within the class.  */
+ 
+ #undef  ASM_OUTPUT_INTERNAL_LABEL
+ #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
+   fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
+ 
+ /* This is how to output a reference to an internal numbered label where
+    PREFIX is the class of label and NUM is the number within the class.  */
+ 
+ #undef  ASM_OUTPUT_INTERNAL_LABELREF
+ #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM)	\
+   fprintf (FILE, ".L%s%d", PREFIX, NUM)
+ 
+ /* This is how to store into the string LABEL
+    the symbol_ref name of an internal numbered label where
+    PREFIX is the class of label and NUM is the number within the class.
+    This is suitable for output with `assemble_name'.  */
+ 
+ #undef  ASM_GENERATE_INTERNAL_LABEL
+ #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
+   sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
+ 
+ /* Select a format to encode pointers in exception handling data.  CODE
+    is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
+    true if the symbol may be affected by dynamic relocations.
+ 
+    Some Solaris dynamic linkers don't handle unaligned section relative
+    relocs properly, so force them to be aligned.  */
+ #ifndef HAVE_AS_SPARC_UA_PCREL
+ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)		\
+   ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
+ #endif
+ \f
+ /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
+    Instead, it is enabled here, because it does work under Solaris.  */
+ /* Define for support of TFmode long double and REAL_ARITHMETIC.
+    Sparc ABI says that long double is 4 words.  */
+ #define LONG_DOUBLE_TYPE_SIZE 128
+ 
+ /* But indicate that it isn't supported by the hardware.  */
+ #define WIDEST_HARDWARE_FP_SIZE 64
+ 
+ #define STDC_0_IN_SYSTEM_HEADERS 1
+ 
+ #define MULDI3_LIBCALL "__mul64"
+ #define DIVDI3_LIBCALL "__div64"
+ #define UDIVDI3_LIBCALL "__udiv64"
+ #define MODDI3_LIBCALL "__rem64"
+ #define UMODDI3_LIBCALL "__urem64"
+ 
+ #undef INIT_SUBTARGET_OPTABS
+ #define INIT_SUBTARGET_OPTABS						\
+   fixsfdi_libfunc							\
+     = init_one_libfunc (TARGET_ARCH64 ? "__ftol" : "__ftoll");		\
+   fixunssfdi_libfunc							\
+     = init_one_libfunc (TARGET_ARCH64 ? "__ftoul" : "__ftoull");	\
+   fixdfdi_libfunc							\
+     = init_one_libfunc (TARGET_ARCH64 ? "__dtol" : "__dtoll");		\
+   fixunsdfdi_libfunc							\
+     = init_one_libfunc (TARGET_ARCH64 ? "__dtoul" : "__dtoull")
+ 
+ \f
+ /*
+  * Attempt to turn on access permissions for the stack.
+  *
+  * This code must be defined when compiling gcc but not when compiling
+  * libgcc2.a, unless we're generating code for 64 bits SPARC
+  *
+  * _SC_STACK_PROT is only defined for post 2.6, but we want this code
+  * to run always.  2.6 can change the stack protection but has no way to
+  * query it.
+  *
+  */
+ 
+ /* This declares mprotect (used in TRANSFER_FROM_TRAMPOLINE) for
+    libgcc2.c.  */
+ /* We don't want to include this because sys/mman.h is not present on
+    some non-Solaris configurations that use sol2.h.  */
+ #if 0 /* def L_trampoline */
+ #include <sys/mman.h>
+ #endif
+ 
+ #define TRANSFER_FROM_TRAMPOLINE					\
+ static int need_enable_exec_stack;					\
+ 									\
+ static void check_enabling(void) __attribute__ ((constructor));		\
+ static void check_enabling(void)					\
+ {									\
+   extern long sysconf(int);						\
+ 									\
+   int prot = (int) sysconf(515 /*_SC_STACK_PROT */);			\
+   if (prot != 7)							\
+     need_enable_exec_stack = 1;						\
+ }									\
+ 									\
+ extern void __enable_execute_stack (void *);				\
+ void									\
+ __enable_execute_stack (addr)						\
+      void *addr;							\
+ {									\
+   if (!need_enable_exec_stack)						\
+     return;								\
+   else {								\
+     long size = getpagesize ();						\
+     long mask = ~(size-1);						\
+     char *page = (char *) (((long) addr) & mask); 			\
+     char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
+ 									\
+     /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ 			\
+     if (mprotect (page, end - page, 7) < 0)				\
+       perror ("mprotect of trampoline code");				\
+   }									\
+ }
Index: fixinc/mkfixinc.sh
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/mkfixinc.sh,v
retrieving revision 1.42.2.1
diff -u -p -c -r1.42.2.1 mkfixinc.sh
*** fixinc/mkfixinc.sh	6 Nov 2003 23:13:36 -0000	1.42.2.1
--- fixinc/mkfixinc.sh	12 Jan 2004 23:28:21 -0000
*************** case $machine in
*** 47,53 ****
          fixincludes=fixinc.interix
          ;;
  
!     i?86-*-openbsd*)
          fixincludes=fixinc.wrap
          ;;
  
--- 47,53 ----
          fixincludes=fixinc.interix
          ;;
  
!     *-*-openbsd*)
          fixincludes=fixinc.wrap
          ;;
  

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-12 23:50 RFC: OpenBSD configurations for gcc 3.3.x Marc Espie
@ 2004-01-13  0:55 ` Andrew Pinski
  2004-01-13  7:13 ` neil
  2004-01-13  7:15 ` Andreas Jaeger
  2 siblings, 0 replies; 13+ messages in thread
From: Andrew Pinski @ 2004-01-13  0:55 UTC (permalink / raw)
  To: espie; +Cc: gcc, gdr, Andrew Pinski


On Jan 12, 2004, at 15:50, Marc Espie wrote:
> - OpenBSD switched from libc/libc_ to libc/libc+libpthread  in its 3.3
> release. Splitting out openbsd-libpthread.h/openbsd-libc_r.h was done 
> for
> that reason. It's either that, or abandon old OpenBSD systems (I 
> wouldn't
> actually mind).

Note I still use OpenBSD 3.1 with the mainline gcc (yes I should update 
but I was
waiting until a patch like came around to support 3.4 on i386 
(conversion to elf)).  The machine has helped to find regressions in 
the compiler, just today I filed a bug for a
regression.

Thanks,
Andrew Pinski

PS Thanks for the great OS.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-12 23:50 RFC: OpenBSD configurations for gcc 3.3.x Marc Espie
  2004-01-13  0:55 ` Andrew Pinski
@ 2004-01-13  7:13 ` neil
  2004-01-13  7:15 ` Andreas Jaeger
  2 siblings, 0 replies; 13+ messages in thread
From: neil @ 2004-01-13  7:13 UTC (permalink / raw)
  To: Marc Espie; +Cc: gcc, gdr

Marc Espie wrote:-

> + /* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets.  */
> + #define OPENBSD_OS_CPP_BUILTINS_ELF()		\
> +   do						\
> +     {						\
> +       OPENBSD_OS_CPP_BUILTINS_COMMON();		\
> +       builtin_define ("__ELF__");		\
> +     }						\
> +   while (0)

This is not needed.  Everything that is ELF automatically
defines __ELF__; see config/elfos.h.

> + /* TARGET_OS_CPP_BUILTINS() common to all LP64 OpenBSD targets.  */
> + #define OPENBSD_OS_CPP_BUILTINS_LP64()		\
> +   do						\
> +     {						\
> +       builtin_define ("_LP64");			\
> +       builtin_define ("__LP64__");		\
> +     }						\
> +   while (0)
> + 

The same is true I think of at least one of these.  See
c-cpp-builtins.c.

>   /* Run-time target specifications.  */
> ! #define TARGET_OS_CPP_BUILTINS()			\
> !   do							\
> !     {							\
> !       OPENBSD_OS_CPP_BUILTINS_ELF();			\
> !       builtin_define ("__sparc");			\
> !       builtin_define ("__sparc__");			\
> !     }							\
> !   while (0)

The two sparc defines are unnecessary as they are part of
TARGET_CPU_CPP_BUILTINS in sparc.h.  This may be true of
other similar CPU defns in your patch.

> !     {							\
> !       OPENBSD_OS_CPP_BUILTINS_ELF();			\
> !       OPENBSD_OS_CPP_BUILTINS_LP64();			\
> !       builtin_define ("__sparc64__");			\
> !       builtin_define ("__sparc_v9__");			\
> !       builtin_define ("__sparcv9__");			\
> !       builtin_define ("__arch64__");			\
> !       builtin_define ("__sparc");			\
> !       builtin_define ("__sparc__");			\
> !     }							\
> !   while (0)

Similarly, some of these are not needed.

Neil.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-12 23:50 RFC: OpenBSD configurations for gcc 3.3.x Marc Espie
  2004-01-13  0:55 ` Andrew Pinski
  2004-01-13  7:13 ` neil
@ 2004-01-13  7:15 ` Andreas Jaeger
  2004-01-13 10:53   ` Gerald Pfeifer
  2 siblings, 1 reply; 13+ messages in thread
From: Andreas Jaeger @ 2004-01-13  7:15 UTC (permalink / raw)
  To: espie; +Cc: gcc, gdr

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

Marc Espie <espie@nerim.net> writes:

> Basically, this is the configuration information for most OpenBSD systems
> using gcc 3.3.

Is all of this already in CVS for 3.4?  If not, I suggest to forward port to
3.4 first.

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-13  7:15 ` Andreas Jaeger
@ 2004-01-13 10:53   ` Gerald Pfeifer
  2004-01-13 11:11     ` Marc Espie
  0 siblings, 1 reply; 13+ messages in thread
From: Gerald Pfeifer @ 2004-01-13 10:53 UTC (permalink / raw)
  To: espie, Andreas Jaeger; +Cc: gcc, gdr

On Tue, 13 Jan 2004, Andreas Jaeger wrote:
>> Basically, this is the configuration information for most OpenBSD systems
>> using gcc 3.3.
> Is all of this already in CVS for 3.4?  If not, I suggest to forward
> port to 3.4 first.

Actually, that's a requirement, more or less.

We generally do not accept patches for a release branch that have not been
applied to mainline (except stripped down or more conservative variants);
doing otherwise would constitute a regression.

Gerald

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-13 10:53   ` Gerald Pfeifer
@ 2004-01-13 11:11     ` Marc Espie
  0 siblings, 0 replies; 13+ messages in thread
From: Marc Espie @ 2004-01-13 11:11 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: Andreas Jaeger, gcc, gdr

On Tue, Jan 13, 2004 at 11:53:12AM +0100, Gerald Pfeifer wrote:
> On Tue, 13 Jan 2004, Andreas Jaeger wrote:
> >> Basically, this is the configuration information for most OpenBSD systems
> >> using gcc 3.3.
> > Is all of this already in CVS for 3.4?  If not, I suggest to forward
> > port to 3.4 first.
> 
> Actually, that's a requirement, more or less.
> 
> We generally do not accept patches for a release branch that have not been
> applied to mainline (except stripped down or more conservative variants);
> doing otherwise would constitute a regression.
> 
> Gerald

I am quite willing to adjust the patches for mainline.

What I can't guarantee is WHEN these will actually get tested on anything
but i386.

In the past, OpenBSD has been falling backward wrt official GCC releases
because I didn't have enough resources to handle both mailine and branches.
Keep in mind that I'm dependent on my OpenBSD co-developers for a lot of
tests on exotic architectures.

So, as a result, there hasn't been an official GCC release that would
bootstrap without patches on an OpenBSD system for at least a few years.

I'm trying to reverse that trend. This patch is stuff that has been tested,
is more or less working, and is actually getting used on relevant
architectures. The mainline can get similar changes, and I can make sure
they get committed before the branch stuff.

That said, technical review: what parts are objectionable ? Do you agree
that, if committed to the mainline as well, these changes are not intrusive
with respect to the branch ?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-16 17:07         ` Joe Buck
@ 2004-01-16 17:30           ` law
  0 siblings, 0 replies; 13+ messages in thread
From: law @ 2004-01-16 17:30 UTC (permalink / raw)
  To: Joe Buck; +Cc: Robert Dewar, Russ Allbery, espie, Nathanael Nerode, gcc

In message <20040116090750.A27838@synopsys.com>, Joe Buck writes:
 >On Fri, Jan 16, 2004 at 05:15:13AM -0500, Robert Dewar wrote:
 >> Of course it is indeed prudent to put a visible notice on all documents,
 >> but the exact form and the use of (C) [which was the genesis of this
 >> thread] are no longer legally significant. Note also that the discussion
 >> of whether you have to say 1991-2005, or mention every year between is
 >> also irrelevant, there is no particular reason to prefer explicit 
 >> mention of every year in between.
 >
 >While I'm sure that you are right, the FSF wants us to require that every
 >year be listed, so at least for now that's the policy.  Ask RMS if you
 >want to get it changed.
Right.  In fact, a few years ago I got lazy and started using the
x-y format.  RMS requested that we go back and fix all of them to list
the years explicitly (and to whomever fixed them back then, thank you!)

Unless we hear otherwise from RMS, let's please use the format he has
requested.

jeff



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-16 10:15       ` Robert Dewar
@ 2004-01-16 17:07         ` Joe Buck
  2004-01-16 17:30           ` law
  0 siblings, 1 reply; 13+ messages in thread
From: Joe Buck @ 2004-01-16 17:07 UTC (permalink / raw)
  To: Robert Dewar; +Cc: Russ Allbery, espie, Nathanael Nerode, gcc

On Fri, Jan 16, 2004 at 05:15:13AM -0500, Robert Dewar wrote:
> Of course it is indeed prudent to put a visible notice on all documents,
> but the exact form and the use of (C) [which was the genesis of this
> thread] are no longer legally significant. Note also that the discussion
> of whether you have to say 1991-2005, or mention every year between is
> also irrelevant, there is no particular reason to prefer explicit 
> mention of every year in between.

While I'm sure that you are right, the FSF wants us to require that every
year be listed, so at least for now that's the policy.  Ask RMS if you
want to get it changed.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-16  5:18     ` Russ Allbery
@ 2004-01-16 10:15       ` Robert Dewar
  2004-01-16 17:07         ` Joe Buck
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 2004-01-16 10:15 UTC (permalink / raw)
  To: Russ Allbery; +Cc: espie, Nathanael Nerode, gcc

Yes, of course you did not quote the more important part of that reference:

> The use of a copyright notice is no longer required under U. S. law, although it is often beneficial. Because prior law did contain such a requirement, however, the use of notice is still relevant to the copyright status of older works.
> 
> Notice was required under the 1976 Copyright Act. This requirement was eliminated when the United States adhered to the Berne Convention, effective March 1, 1989. Although works published without notice before that date could have entered the public domain in the United States, the Uruguay Round Agreements Act (URAA) restores copyright in certain foreign works originally published without notice. For further information about copyright amendments in the URAA, request Circular 38b.

As far as I know there is not a single instance in court where for 
recent works, the presence or absence of a coypright notice played
a major role. One reason that it is very important to be aware of this
change is that the burden is on you to ensure that something is not
copyrighted, and the lack of a message is no longer significant in
this determination. I still find it common that people say "oh there
is no copyright notice there, so it's OK to copy it". Yes, the language
of 504 suggests that this may affect damages, but I sure would not count
on it :-)

Of course it is indeed prudent to put a visible notice on all documents,
but the exact form and the use of (C) [which was the genesis of this
thread] are no longer legally significant. Note also that the discussion
of whether you have to say 1991-2005, or mention every year between is
also irrelevant, there is no particular reason to prefer explicit 
mention of every year in between.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-16  3:29   ` Robert Dewar
@ 2004-01-16  5:18     ` Russ Allbery
  2004-01-16 10:15       ` Robert Dewar
  0 siblings, 1 reply; 13+ messages in thread
From: Russ Allbery @ 2004-01-16  5:18 UTC (permalink / raw)
  To: Robert Dewar; +Cc: espie, Nathanael Nerode, gcc

Robert Dewar <dewar@gnat.com> writes:

> This whole business of legal significance of copyright notices and
> discussions about exact formats required is obsolete. The copyright law
> was changed some time ago (86 I think) in a radical manner (to make the
> US more conformant to e.g. the Berne convention). The current situation
> is that copyright notices have no specific legal significance.  A
> document is copyrighted whether or not it has the notice. The notice is
> therefore there only for informational purposes, not for specific legal
> reasons.

    Use of the notice may be important because it informs the public that
    the work is protected by copyright, identifies the copyright owner,
    and shows the year of first publication.  Furthermore, in the event
    that a work is infringed, if a proper notice of copyright appears on
    the published copy or copies to which a defendant in a copyright
    infringement suit had access, then no weight shall be given to such a
    defendant's interposition of a defense based on innocent infringement
    in mitigation of actual or statutory damages, except as provided in
    section 504(c)(2) of the copyright law.  Innocent infringement occurs
    when the infringer did not realize that the work was protected.

[...]

    The notice for visually perceptible copies should contain all the
    following three elements:

    1. The symbol \x{00A9} (the letter C in a circle), or the word
    "Copyright," or the abbreviation "Copr."; and

    2. The year of first publication of the work.  In the case of
    compilations or derivative works incorporating previously published
    material, the year date of first publication of the compilation or
    derivative work is sufficient.  The year date may be omitted where a
    pictorial, graphic, or sculptural work, with accompanying textual
    matter, if any, is reproduced in or on greeting cards, postcards,
    stationery, jewelry, dolls, toys, or any useful article; and

    3. The name of the owner of copyright in the work, or an abbreviation
    by which the name can be recognized, or a generally known alternative
    designation of the owner.

    Example: \x{00A9} 2002 John Doe 

(The copyright symbol changed to \x{00A9} by me.)

This is from <http://www.copyright.gov/circs/circ1.html#noc>, published by
the United States Copyright Office, and therefore about the best legal
advice you will get on notice of copyright in the United States without
hiring a lawyer.

Based on the above, (C) is probably worthless in a copyright notice, since
it is not the letter C in a circle, but I suppose that could be arguable.
It is, however, completely redundant with "Copyright" in the United
States; the three points above are also what's found in the US copyright
statutes concerning notice of copyright, as I recall.  I doubt that it's
hurting anything, though.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-16  2:17 ` Marc Espie
@ 2004-01-16  3:29   ` Robert Dewar
  2004-01-16  5:18     ` Russ Allbery
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 2004-01-16  3:29 UTC (permalink / raw)
  To: espie; +Cc: Nathanael Nerode, gcc

Marc Espie wrote:

> On Tue, Jan 13, 2004 at 04:25:10PM -0500, Nathanael Nerode wrote:
> 
>>Don't write "Copyright (C) 2004..."; the (C) has no legal effect. 
>>Instead, write "Copyright 2004...".
> 
> 
> Is there an actual document that says so ?
> 
> First, I was always told to write a copyright symbol, and that if
> I couldn't (C) had the same legal value.
> 
> Second, all the files I see in the actual GCC repository say
> Copyright (C) yyyy
> 
> Third, the licence templates I use in other projects all have
> Copright (c) or Copyright (C) all over the place.

This whole business of legal significance of copyright notices and
discussions about exact formats required is obsolete. The copyright
law was changed some time ago (86 I think) in a radical manner (to
make the US more conformant to e.g. the Berne convention). The current
situation is that copyright notices have no specific legal significance.
A document is copyrighted whether or not it has the notice. The notice
is therefore there only for informational purposes, not for specific
legal reasons.

That being said, it is conventional, based on historical practice from
when it was important, to use (c) or (C) in such informationl messages.
People are used to it, and lots of people think it has important
significance, and get upset if it is not there, so one might as well
put it there :-)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
  2004-01-13 21:25 Nathanael Nerode
@ 2004-01-16  2:17 ` Marc Espie
  2004-01-16  3:29   ` Robert Dewar
  0 siblings, 1 reply; 13+ messages in thread
From: Marc Espie @ 2004-01-16  2:17 UTC (permalink / raw)
  To: Nathanael Nerode; +Cc: gcc

On Tue, Jan 13, 2004 at 04:25:10PM -0500, Nathanael Nerode wrote:
> Don't write "Copyright (C) 2004..."; the (C) has no legal effect. 
> Instead, write "Copyright 2004...".

Is there an actual document that says so ?

First, I was always told to write a copyright symbol, and that if
I couldn't (C) had the same legal value.

Second, all the files I see in the actual GCC repository say
Copyright (C) yyyy

Third, the licence templates I use in other projects all have
Copright (c) or Copyright (C) all over the place.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RFC: OpenBSD configurations for gcc 3.3.x
@ 2004-01-13 21:25 Nathanael Nerode
  2004-01-16  2:17 ` Marc Espie
  0 siblings, 1 reply; 13+ messages in thread
From: Nathanael Nerode @ 2004-01-13 21:25 UTC (permalink / raw)
  To: gcc, espie

OK, here are my substantive comments (as a configury maintainer) on the 
patch.

First of all, as others have commented, if you want to get this into the 
main GCC repo, you *have* to design and submit the patch for mainline 
(currently going to become 3.4) *first*.

> - fixinc.wrap is enough on all OpenBSD systems. Most of the headers are
> shared between architectures, in fact.

This is no good for 3.4.  For 3.4 *all* systems are using standard 
autogen-managed fixincludes (except a few which do no fixing at all).
fixinc.wrap is completely gone and will stay gone.  Please see if the 
standard fixincludes behaves properly, and if not tell us and we will 
fix any problems.

Specific comments on config.gcc:

> Index: config.gcc
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
> retrieving revision 1.266.2.19
> diff -u -p -c -r1.266.2.19 config.gcc
> *** config.gcc	2 Dec 2003 05:33:15 -0000	1.266.2.19
> --- config.gcc	12 Jan 2004 23:28:18 -0000
> *************** case $machine in
> *** 402,408 ****
>   	esac
>   	;;
>   *-*-openbsd*)
> ! 	tm_file=${cpu_type}/openbsd.h
>   	tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
>   	xm_defines=POSIX
>   	if test x$enable_threads = xyes; then
> --- 402,416 ----
>   	esac
>   	;;
>   *-*-openbsd*)
> ! 	case $machine in
> ! 	*-*-openbsd2* | *-*-openbsd3.[012])
> ! 		openbsd_libspec="openbsd-libc_r.h"
> ! 		;;
> ! 	*)
> ! 		openbsd_libspec="openbsd-libpthread.h"
> ! 		;;
> ! 	esac
> ! 	tm_file="${openbsd_libspec} ${cpu_type}/openbsd.h"
>   	tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
>   	xm_defines=POSIX
>   	if test x$enable_threads = xyes; then

The above hunk is good....

> *************** alpha*-*-netbsd*)
> *** 578,587 ****
>   	;;
>   
>   alpha*-*-openbsd*)
> ! 	tm_file="${cpu_type}/${cpu_type}.h ${tm_file}"
>   	# default x-alpha is only appropriate for dec-osf.
>   	target_cpu_default="MASK_GAS"
>   	tmake_file="alpha/t-alpha alpha/t-ieee"
>   	;;
>   
>   alpha*-dec-osf[45]*)
> --- 586,596 ----
>   	;;
>   
>   alpha*-*-openbsd*)
> !  	tm_file="alpha/alpha.h alpha/elf.h alpha/openbsd1.h openbsd.h ${tm_file}"
>   	# default x-alpha is only appropriate for dec-osf.
>   	target_cpu_default="MASK_GAS"
>   	tmake_file="alpha/t-alpha alpha/t-ieee"
> + 	gas=yes gnu_ld=yes
>   	;;
>   
>   alpha*-dec-osf[45]*)
> *************** hppa*-*-linux* | parisc*-*-linux*)
> *** 818,825 ****
>   	tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
>   	;;
>   hppa*-*-openbsd*)
> ! 	target_cpu_default="MASK_PA_11"
> ! 	tmake_file=pa/t-bsd
>   	;;
>   hppa1.1-*-pro*)
>   	target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
> --- 827,834 ----
>   	tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
>   	;;
>   hppa*-*-openbsd*)
> ! 	target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS"
> ! 	tmake_file="t-libc-ok t-openbsd t-openbsd-thread pa/t-openbsd"
>   	;;
* Are you deliberately omitting t-libgcc-pic?
* Are you deliberately including t-openbsd-thread even when configuring 
with --disable-threads?
If you are doing these deliberately, please include comments explaining why.

If those are just accidents, you should instead write:
tmake_file="${tmake_file} pa/t-openbsd"
so as to take advantage of the ${tmake_file} setting in the generic 
openbsd clause.

>   hppa1.1-*-pro*)
>   	target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
> *************** i[34567]86-*-netbsd*)
> *** 1142,1154 ****
>   x86_64-*-netbsd*)
>   	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
>   	;;
> ! i[34567]86-*-openbsd*)
>   	tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h ${tm_file}"
>   	# needed to unconfuse gdb
>   	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
>   	# we need collect2 until our bug is fixed...
>   	use_collect2=yes
>   	;;
>   i[34567]86-*-coff*)
>   	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
>   	;;
> --- 1151,1177 ----
>   x86_64-*-netbsd*)
>   	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
>   	;;
> ! i[34567]86-*-openbsd2* | i[34567]86-*-openbsd3.[0123])
>   	tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h ${tm_file}"
>   	# needed to unconfuse gdb
>   	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
Is there a reason why t-libgcc-pic is omitted?
Is there a reason why t-openbsd-thread is omitted even when configured 
with --enable-threads?
If so, include comments; if not, use
tmake_file="${tmake_file} i386/t-openbsd"

>   	# we need collect2 until our bug is fixed...
>   	use_collect2=yes
>   	;;
> + i[34567]86-*-openbsd*)
> + 	# needed to unconfuse gdb
> + 	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
Is there a reason why t-libgcc-pic is omitted?
Is there a reason why t-openbsd-thread is omitted even when configured 
with --enable-threads?
If so, include comments; if not, use
tmake_file="${tmake_file} i386/t-openbsd"

> + 	tm_file="${cpu_type}/${cpu_type}.h i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
> + 	tm_file="${tm_file} exec-stack.h"
> + 	tm_file="${tm_file} openbsd.h openbsd-libpthread.h i386/openbsdelf.h"
> + 	gas=yes
> + 	gnu_ld=yes
> + 	stabs=yes
> +   	;;
> + x86_64-*-openbsd*)
> + 	tm_file="i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h openbsd.h openbsd-libpthread.h i386/x86-64.h i386/openbsd64.h"
> + 	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
Is there a reason why t-libgcc-pic is omitted?
Is there a reason why t-openbsd-thread is omitted even when configured 
with --enable-threads?
If so, include comments; if not, use
tmake_file="${tmake_file} i386/t-openbsd"

> + 	;;
>   i[34567]86-*-coff*)
>   	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
>   	;;
> *************** sparc-*-netbsd*)
> *** 2397,2413 ****
>   	use_collect2=yes
>   	;;
>   sparc-*-openbsd*)
> ! 	tm_file="sparc/sparc.h ${tm_file}"
>   	# needed to unconfuse gdb
>   	tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
>   	# we need collect2 until our bug is fixed...
>   	use_collect2=yes
>   	;;
>   sparc64-*-openbsd*)
> ! 	tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h"
>   	xm_file=sparc/xm-sp64.h
>   	gas=yes gnu_ld=yes
>   	with_cpu=ultrasparc
>   	;;
>   sparc-*-bsd*)
>   	tm_file="${tm_file} sparc/bsd.h"
> --- 2420,2438 ----
>   	use_collect2=yes
>   	;;
>   sparc-*-openbsd*)
> ! 	tm_file="sparc/sparc.h elfos.h svr4.h sparc/sysv4.h ${tm_file}"
>   	# needed to unconfuse gdb
>   	tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
Is there a reason why t-libgcc-pic is omitted?
Is there a reason why t-openbsd-thread is omitted even when configured 
with --enable-threads?
If so, include comments; if not, use
tmake_file="${tmake_file} sparc/t-openbsd"

>   	# we need collect2 until our bug is fixed...
> + 	gas=yes gnu_ld=yes
Please don't separate the comment about collect2 from the functional 
line about collect2.

>   	use_collect2=yes
>   	;;
>   sparc64-*-openbsd*)
> ! 	tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h ${openbsd_libspec} sparc/openbsd64.h"
>   	xm_file=sparc/xm-sp64.h
>   	gas=yes gnu_ld=yes
>   	with_cpu=ultrasparc
> + 	float_format=i128
Does sparc64-openbsd really not need *any* sparc-specific tmake_file ?

>   	;;
>   sparc-*-bsd*)
>   	tm_file="${tm_file} sparc/bsd.h"

Also note that things are going to look a little different in the 
config.gcc for 3.4; your changes should still be about the same, but 
actual patch files probably won't apply correctly due to context changes.

Additional general comments:

All new files should say "GCC" everywhere, never "GNU CC".  All your new 
files break this rule.  :-)

Don't write "Copyright (C) 2004..."; the (C) has no legal effect. 
Instead, write "Copyright 2004...".

I haven't commented on the .h files yet, but be warned that they've been 
somewhat cleaned up in mainline (relative to 3.3) so you will probably 
have to make your changes somewhat different.  (Probably simpler, actually.)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-01-16 17:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-12 23:50 RFC: OpenBSD configurations for gcc 3.3.x Marc Espie
2004-01-13  0:55 ` Andrew Pinski
2004-01-13  7:13 ` neil
2004-01-13  7:15 ` Andreas Jaeger
2004-01-13 10:53   ` Gerald Pfeifer
2004-01-13 11:11     ` Marc Espie
2004-01-13 21:25 Nathanael Nerode
2004-01-16  2:17 ` Marc Espie
2004-01-16  3:29   ` Robert Dewar
2004-01-16  5:18     ` Russ Allbery
2004-01-16 10:15       ` Robert Dewar
2004-01-16 17:07         ` Joe Buck
2004-01-16 17:30           ` law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).