Index: gcc/gcc/config/openbsd.h |
diff --git a/gcc/gcc/config/openbsd.h b/gcc/gcc/config/openbsd.h |
index cbcff230387f8c5ab6f180b74312c5a872637aba..59728c377d6c6a27f4b79298bc81bf7990fb8399 100644 |
--- a/gcc/gcc/config/openbsd.h |
+++ b/gcc/gcc/config/openbsd.h |
@@ -84,6 +84,24 @@ along with GCC; see the file COPYING3. If not see |
} \ |
while (0) |
+/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD ELF targets. */ |
+#define OPENBSD_OS_CPP_BUILTINS_ELF() \ |
+ do \ |
+ { \ |
+ OPENBSD_OS_CPP_BUILTINS(); \ |
+ 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. |
@@ -95,15 +113,8 @@ along with GCC; see the file COPYING3. If not see |
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" |
#endif |
-/* 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}}}" |
-#endif |
- |
+#undef LIB_SPEC |
+#define LIB_SPEC OBSD_LIB_SPEC |
#ifndef OBSD_HAS_CORRECT_SPECS |
@@ -128,15 +139,11 @@ along with GCC; see the file COPYING3. If not see |
/* 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*}" |
+#undef LIB_SPEC |
+#define LIB_SPEC OBSD_LIB_SPEC |
+ |
+#if defined(HAVE_LD_EH_FRAME_HDR) |
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " |
#endif |
#undef LIB_SPEC |
@@ -281,10 +288,6 @@ do { \ |
/* 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, |