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]
Other format: [Raw text]

Cleanup of OpenBSD targets


Hi,

Here's a diff that cleans up the OpenBSD/i386 target and adds support
for OpenBSD/amd64.  This diff probably breaks all other OpenBSD
targets including older versions of OpenBSD/i386.  The latter are
explicitly marked as obsolete; the consensus among OpenBSD developers
is that they're not worth supporting anymore.  For most of the other
targets I have diffs to bring them up to date.  I'd rather update them
one by one with small diffs than submit one big jumbo diff.  Most of
them are seriously broken anyway.

If this looks ok, can someone commit it?

Thanks,

Mark


2007-01-22  Mark Kettenis  <kettenis@gnu.org>

	* config.gcc (i[34567]86-*-openbsd[12]*)
	(i[34567]86-*-openbsd3.[0123]): Add to list of unsupported targets.
	(*-*-openbsd*): Set gas and gnu_ld to yes.
	(i[34567]86-*-openbsd*): Replace i386/openbsdelf.h with
	i386/openbsd.h.
	(x86_64-*-openbsd*): New configuration.
	* config/openbsd.h: Revise comments.
	(STANDARD_STARTFILE_PREFIX): Set to /usr/lib.
	(OPENBSD_OS_CPP_BUILTINS): Delete.
	(TARGET_OS_CPP_BUILTINS): New.
	(OBSD_CPP_SPEC, OBSD_LIB_SPEC, OBSD_LINK_SPEC): Simplify.
	[HAVE_LD_EH_FRAME_HDR](LINK_EH_SPEC): Define.
	(STARTFILE_SPEC, ENDFILE_SPEC): New.
	(SWITCH_TAKES_ARGS): Define unconditionally.
	(CPP_SPEC, ASM_SPEC, LIB_SPEC): Delete.
	(AS_NEEDS_DASH_FOR_PIPED_INPUT): Delete.
	(DBX_NO_XREFS): Delete.
	(TYPE_ASM_OP, SIZE_ASM_OP, SET_ASM_OP, GLOBAL_ASM_OP): Delete.
	(TYPE_OPERAND_FMT): Delete.
	(ASM_DECLARE_RESULT, ASM_DECLARE_FUNCTION_NAME)
	(ASM_DECLARE_FUNCTION_SIZE, ASM_DECLARE_OBJECT_NAME)
	(ASM_FINISH_DECLARE_OBJECT, ASM_WEAKEN_LABEL): Delete.
	(GTHREAD_USE_WEAK): Delete.
	(HANDLE_SYSV_PRAGMA): Delete.
	(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE):
	New.
	* config/t-openbsd (USER_H): Add $(EXTRA_HEADERS).
	* config/i386/openbsd.h (TARGET_VERSION): Provide definition for
	OpenBSD/amd64.
	(NO_DOLLAR_IN_LABEL): Undef.
	(TARGET_OS_CPP_BUILTINS): Delete.
	(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Delete.
	(ASM_COMMENT_START): Change to "#".
	[HAVE_GAS_MAX_SKIP_P2ALIGN](ASM_OUTPUT_MAX_SKIP_ALIGN): New.
	(ASM_OUTPUT_ALIGN): Delete.
	(FUNCTION_PROFILER): Fix.
	(DWARF_UNWIND_INFO): Delete.
	(ASM_PREFERRED_EH_DATA_FORMAT): Don't undef.
	(ASM_QUAD): Don't undef.
	(ASM_SPEC, LIB_SPEC, LINK_SPEC): New.
	* config/i386/openbsdelf.h: Remove.


Index: config.gcc
===================================================================
--- config.gcc	(revision 121033)
+++ config.gcc	(working copy)
@@ -213,6 +213,8 @@
  | i[34567]86-sequent-sysv[123]*	\
  | i[34567]86-go32-*			\
  | i[34567]86-*-go32*			\
+ | i[34567]86-*-openbsd[12]*		\
+ | i[34567]86-*-openbsd3.[0123]		\
  | m68k-*-linux*aout*			\
  | m68k-*-linux*libc1*			\
  | mips64orion*-*-rtems*		\
@@ -551,6 +553,8 @@
   ;;
 *-*-openbsd*)
   tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
+  gas=yes
+  gnu_ld=yes
   case ${enable_threads} in
     yes)
       thread_file='posix'
@@ -1080,19 +1084,14 @@
 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="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
-	# 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*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
-	tm_file="${tm_file} openbsd.h i386/openbsdelf.h"
-	gas=yes
-	gnu_ld=yes
+	tm_file="${tm_file} openbsd.h i386/openbsd.h"
 	;;
+x86_64-*-openbsd*)
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+	tm_file="${tm_file} i386/x86-64.h openbsd.h i386/openbsd.h"
+	;;
 i[34567]86-*-coff*)
 	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h"
 	use_fixproto=yes
Index: config/openbsd.h
===================================================================
--- config/openbsd.h	(revision 121033)
+++ config/openbsd.h	(working copy)
@@ -1,6 +1,7 @@
 /* Base configuration file for all OpenBSD targets.
-   Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc.
 
+   Copyright (C) 1999, 2000, 2004, 2005, 2007 Free Software Foundation, Inc.
+
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
@@ -19,35 +20,17 @@
 Boston, MA 02110-1301, USA.  */
 
 /* Common OpenBSD configuration. 
+
    All OpenBSD architectures include this file, which is intended as
    a repository for common defines. 
 
-   Some defines are common to all architectures, a few of them are
-   triggered by OBSD_* guards, so that we won't override architecture
-   defaults by mistakes.
-
-   OBSD_HAS_CORRECT_SPECS: 
-      another mechanism provides correct specs already.
-   OBSD_NO_DYNAMIC_LIBRARIES: 
-      no implementation of dynamic libraries.
-   OBSD_OLD_GAS: 
-      older flavor of gas which needs help for PIC.
-   OBSD_HAS_DECLARE_FUNCTION_NAME, OBSD_HAS_DECLARE_FUNCTION_SIZE,
-   OBSD_HAS_DECLARE_OBJECT: 
-      PIC support, FUNCTION_NAME/FUNCTION_SIZE are independent, whereas
-      the corresponding logic for OBJECTS is necessarily coupled.
-
-   There are also a few `default' defines such as ASM_WEAKEN_LABEL,
-   intended as common ground for arch that don't provide 
-   anything suitable.  */
-
-/* OPENBSD_NATIVE is defined only when gcc is configured as part of
+   OPENBSD_NATIVE is defined only when gcc is configured as part of
    the OpenBSD source tree, specifically through Makefile.bsd-wrapper.
 
    In such a case the include path can be trimmed as there is no
-   distinction between system includes and gcc includes.  */
-
-/* This configuration method, namely Makefile.bsd-wrapper and
+   distinction between system includes and gcc includes.
+   
+   This configuration method, namely Makefile.bsd-wrapper and
    OPENBSD_NATIVE is NOT recommended for building cross-compilers.  */
 
 #ifdef OPENBSD_NATIVE
@@ -66,232 +49,68 @@
 /* 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/local/lib/"
+#define STANDARD_STARTFILE_PREFIX	"/usr/lib/"
 
 #endif
 
 
 /* Controlling the compilation driver.  */
-/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets.  */
-#define OPENBSD_OS_CPP_BUILTINS()		\
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-      builtin_define ("__OpenBSD__");		\
-      builtin_define ("__unix__");		\
-      builtin_define ("__ANSI_COMPAT");		\
-      builtin_assert ("system=unix");		\
-      builtin_assert ("system=bsd");		\
-      builtin_assert ("system=OpenBSD");	\
+      builtin_define ("__OpenBSD__");           \
+      builtin_define ("__unix__");              \
+      builtin_assert ("system=unix");           \
+      builtin_assert ("system=bsd");            \
+      builtin_assert ("system=OpenBSD");        \
     }						\
   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.  */
-#ifdef CPP_CPU_SPEC
-#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
-#else
-#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
-#endif
+/* CPP_SPEC appropriate for OpenBSD; we deal with -posix and -pthread.  */
+#define OBSD_CPP_SPEC \
+  "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
 
-/* LIB_SPEC appropriate for OpenBSD.  */
-#ifdef HAS_LIBC_R
-/*   -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}}}"
-#else
-/* Include -lpthread if -pthread is specified on the command line. */
-# define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+/* LIB_SPEC appropriate for OpenBSD; we include -lpthread if -pthread
+   is specified on the command line.  */
+#define OBSD_LIB_SPEC \
+  "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} \
+   %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+
+/* LINK_SPEC appropriate for OpenBSD.  */
+#define OBSD_LINK_SPEC \
+  "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+   %{shared:-shared} %{R*} \
+   %{static:-Bstatic} \
+   %{!static:-Bdynamic} \
+   %{assert*} \
+   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
+
+#ifdef HAVE_LD_EH_FRAME_HDR
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
 #endif
 
+#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}"
 
-#ifndef OBSD_HAS_CORRECT_SPECS
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC 		\
+  "%{!shared:crtend%O%s}	\
+   %{shared:crtendS%O%s}"
 
-#ifndef OBSD_NO_DYNAMIC_LIBRARIES
 #undef SWITCH_TAKES_ARG
 #define SWITCH_TAKES_ARG(CHAR) \
   (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
    || (CHAR) == 'R')
-#endif
 
-#undef CPP_SPEC
-#define CPP_SPEC OBSD_CPP_SPEC
-
-#ifdef OBSD_OLD_GAS
-/* ASM_SPEC appropriate for OpenBSD.  For some architectures, OpenBSD 
-   still uses a special flavor of gas that needs to be told when generating 
-   pic code.  */
-#undef ASM_SPEC
-#define ASM_SPEC "%{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
-#endif
-
-/* Since we use gas, stdin -> - is a good idea.  */
-#define AS_NEEDS_DASH_FOR_PIPED_INPUT
-
-/* LINK_SPEC appropriate for OpenBSD.  Support for GCC options 
-   -static, -assert, and -nostdlib.  */
-#undef LINK_SPEC
-#ifdef OBSD_NO_DYNAMIC_LIBRARIES
-#define LINK_SPEC \
-  "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}"
-#else
-#define LINK_SPEC \
-  "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
-#endif
-
-#undef LIB_SPEC
-#define LIB_SPEC OBSD_LIB_SPEC
-#endif
-
-
-/* Runtime target specification.  */
-
-/* Miscellaneous parameters.  */
-
-/* Controlling debugging info: dbx options.  */
-
-/* Don't use the `xsTAG;' construct in DBX output; OpenBSD systems that
-   use DBX don't support it.  */
-#define DBX_NO_XREFS
-
-
-/* Support of shared libraries, mostly imported from svr4.h through netbsd.  */
-/* Two differences from svr4.h:
-   - we use . - _func instead of a local label,
-   - we put extra spaces in expressions such as 
-     .type _func , @function
-     This is more readable for a human being and confuses c++filt less.  */
-
-/* Assembler format: output and generation of labels.  */
-
-/* Define the strings used for the .type and .size directives.
-   These strings generally do not vary from one system running OpenBSD
-   to another, but if a given system needs to use different pseudo-op
-   names for these, they may be overridden in the arch specific file.  */ 
-
-/* OpenBSD assembler is hacked to have .type & .size support even in a.out
-   format object files.  Functions size are supported but not activated 
-   yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c).  
-   SET_ASM_OP is needed for attribute alias to work.  */
-
-#undef TYPE_ASM_OP
-#undef SIZE_ASM_OP
-#undef SET_ASM_OP
-#undef GLOBAL_ASM_OP
-
-#define TYPE_ASM_OP	"\t.type\t"
-#define SIZE_ASM_OP	"\t.size\t"
-#define SET_ASM_OP	"\t.set\t"
-#define GLOBAL_ASM_OP	"\t.globl\t"
-
-/* The following macro defines the format used to output the second
-   operand of the .type assembler directive.  */
-#undef TYPE_OPERAND_FMT
-#define TYPE_OPERAND_FMT	"@%s"
-
-/* Provision if extra assembler code is needed to declare a function's result
-   (taken from svr4, not needed yet actually).  */
-#ifndef ASM_DECLARE_RESULT
-#define ASM_DECLARE_RESULT(FILE, RESULT)
-#endif
-
-/* These macros generate the special .type and .size directives which
-   are used to set the corresponding fields of the linker symbol table
-   entries under OpenBSD.  These macros also have to output the starting 
-   labels for the relevant functions/objects.  */
-
-#ifndef OBSD_HAS_DECLARE_FUNCTION_NAME
-/* Extra assembler code needed to declare a function properly.
-   Some assemblers may also need to also have something extra said 
-   about the function's return value.  We allow for that here.  */
-#undef ASM_DECLARE_FUNCTION_NAME
-#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
-  do {									\
-    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");			\
-    ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));			\
-    ASM_OUTPUT_LABEL(FILE, NAME);					\
-  } while (0)
-#endif
-
-#ifndef OBSD_HAS_DECLARE_FUNCTION_SIZE
-/* Declare the size of a function.  */
-#undef ASM_DECLARE_FUNCTION_SIZE
-#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)		\
-  do {								\
-    if (!flag_inhibit_size_directive)				\
-      ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);			\
-  } while (0)
-#endif
-
-#ifndef OBSD_HAS_DECLARE_OBJECT
-/* Extra assembler code needed to declare an object properly.  */
-#undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)		\
-  do {								\
-      HOST_WIDE_INT size;					\
-      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");		\
-      size_directive_output = 0;				\
-      if (!flag_inhibit_size_directive				\
-	  && (DECL) && DECL_SIZE (DECL))			\
-	{							\
-	  size_directive_output = 1;				\
-	  size = int_size_in_bytes (TREE_TYPE (DECL));		\
-	  ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);		\
-	}							\
-      ASM_OUTPUT_LABEL (FILE, NAME);				\
-  } while (0)
-
-/* Output the size directive for a decl in rest_of_decl_compilation
-   in the case where we did not do so before the initializer.
-   Once we find the error_mark_node, we know that the value of
-   size_directive_output was set by ASM_DECLARE_OBJECT_NAME 
-   when it was run for the same decl.  */
-#undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)	 \
-do {									 \
-     const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);		 \
-     HOST_WIDE_INT size;						 \
-     if (!flag_inhibit_size_directive && DECL_SIZE (DECL)		 \
-         && ! AT_END && TOP_LEVEL					 \
-	 && DECL_INITIAL (DECL) == error_mark_node			 \
-	 && !size_directive_output)					 \
-       {								 \
-	 size_directive_output = 1;					 \
-	 size = int_size_in_bytes (TREE_TYPE (DECL));			 \
-	 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);			 \
-       }								 \
-   } while (0)
-#endif
-
-
-/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
-   to override a processor specific definition. Hence, #ifndef ASM_*
-   In case overriding turns out to be needed, one can always #undef ASM_* 
-   before including this file.  */
-
-/* Tell the assembler that a symbol is weak.  */
-/* Note: netbsd arm32 assembler needs a .globl here. An override may 
-   be needed when/if we go for arm32 support.  */
-#ifndef ASM_WEAKEN_LABEL
-#define ASM_WEAKEN_LABEL(FILE,NAME) \
-  do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
-       fputc ('\n', FILE); } while (0)
-#endif
-
-/* Storage layout.  */
-
-
-/* Otherwise, since we support weak, gthr.h erroneously tries to use
-   #pragma weak.  */
-#define GTHREAD_USE_WEAK 0
-
-/* bug work around: we don't want to support #pragma weak, but the current
-   code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to
-   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
-
 /* Stack is explicitly denied execution rights on OpenBSD platforms.  */
 #define ENABLE_EXECUTE_STACK						\
 extern void __enable_execute_stack (void *);				\
@@ -301,11 +120,29 @@
   long size = getpagesize ();						\
   long mask = ~(size-1);						\
   char *page = (char *) (((long) addr) & mask); 			\
-  char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
-								      \
+  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");				\
 }
 
 #include <sys/types.h>
 #include <sys/mman.h>
+
+/* Layout of source language data types.
+   These 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
+
+#undef WINT_TYPE
+#define WINT_TYPE "int"
Index: config/t-openbsd
===================================================================
--- config/t-openbsd	(revision 121033)
+++ config/t-openbsd	(working copy)
@@ -1,2 +1,2 @@
 # We don't need GCC's own include files.
-USER_H =
+USER_H = $(EXTRA_HEADERS)
Index: config/i386/openbsd.h
===================================================================
--- config/i386/openbsd.h	(revision 121033)
+++ config/i386/openbsd.h	(working copy)
@@ -1,6 +1,8 @@
-/* Configuration for an OpenBSD i386 target.
-   Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+/* Configuration for an OpenBSD/i386 target.
 
+   Copyright (C) 1999, 2000, 2002, 2004, 2005, 2007
+   Free Software Foundation, Inc.
+
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
@@ -18,85 +20,68 @@
 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+#ifdef TARGET_64BIT_DEFAULT
+# define TARGET_VERSION fprintf (stderr, " (OpenBSD/amd64)")
+#else
+# define TARGET_VERSION fprintf (stderr, " (OpenBSD/i386)");
+#endif
 
-#define TARGET_VERSION fprintf (stderr, " (OpenBSD/i386)");
+/* This gets defined in elfos.h, and keeps us from using libraries
+   compiled with the native cc, so undef it.  */
+#undef NO_DOLLAR_IN_LABEL
 
-/* This goes away when the math-emulator is fixed */
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT \
-  (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) \
+  (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
 
-#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)
-
-/* 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
-
 /* Assembler format: overall framework.  */
 
+/* Override the default comment-starter of "/".  */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
+
 #undef ASM_APP_ON
 #define ASM_APP_ON "#APP\n"
 
 #undef ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
 
+/* Assembler format: alignment output.  */
+
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+#undef ASM_OUTPUT_MAX_SKIP_ALIGN
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)			\
+  do {									\
+    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));	\
+    }									\
+  } while (0)
+#endif
+
 /* 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.  */
-
-/* Kludgy test: when gas is upgraded, it will have p2align, and no problems
-   with nops.  */
-#ifndef HAVE_GAS_MAX_SKIP_P2ALIGN
-/* i386 OpenBSD still uses an older gas that doesn't insert nops by default
-   when the .align directive demands to insert extra space in the text
-   segment.  */
-#undef ASM_OUTPUT_ALIGN
-#define ASM_OUTPUT_ALIGN(FILE,LOG) \
-  if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
-#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);
+  fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
 
-/* Assembler format: exception region output.  */
+#undef ASM_SPEC
+#define ASM_SPEC \
+  "%{m32:--32} %{m64:--64}"
 
-/* All configurations that don't use elf must be explicit about not using
-   dwarf unwind information.  */
-#define DWARF2_UNWIND_INFO 0
+#undef CPP_SPEC
+#define CPP_SPEC OBSD_CPP_SPEC
 
-#undef ASM_PREFERRED_EH_DATA_FORMAT
+#undef LIB_SPEC
+#define LIB_SPEC OBSD_LIB_SPEC
 
-#undef ASM_COMMENT_START
-#define ASM_COMMENT_START ";#"
-
-/* OpenBSD gas currently does not support quad, so do not use it.  */
-#undef ASM_QUAD
+#undef LINK_SPEC
+#define LINK_SPEC OBSD_LINK_SPEC


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