$OpenBSD: patch-gcc_config_rs6000_sysv4_h,v 1.2 2016/07/14 07:22:31 tobiasu Exp $
--- gcc/config/rs6000/sysv4.h.orig	Thu Jul 24 19:25:19 2014
+++ gcc/config/rs6000/sysv4.h	Fri Jul  8 18:18:15 2016
@@ -381,6 +381,7 @@ do {									\
   asm_fprintf (FILE, "%L%s", PREFIX)
 
 /* Globalizing directive for a label.  */
+#undef GLOBAL_ASM_OP
 #define GLOBAL_ASM_OP "\t.globl "
 
 /* This says how to output assembler code to declare an
@@ -813,13 +814,14 @@ ncrtn.o%s"
 
 /* OpenBSD support.  */
 #ifndef	LIB_OPENBSD_SPEC
-#define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+#define LIB_OPENBSD_SPEC OBSD_LIB_SPEC
 #endif
 
 #ifndef	STARTFILE_OPENBSD_SPEC
 #define	STARTFILE_OPENBSD_SPEC "\
-%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
-%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+%{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} \
+%{!p:%{!static:crt0%O%s} %{static:%{nopie:crt0%O%s} %{!nopie:rcrt0%O%s}}}} \
+crtbegin%O%s} %{shared:crtbeginS%O%s}"
 #endif
 
 #ifndef	ENDFILE_OPENBSD_SPEC
@@ -836,7 +838,7 @@ ncrtn.o%s"
 #endif
 
 #ifndef CPP_OS_OPENBSD_SPEC
-#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#define CPP_OS_OPENBSD_SPEC OBSD_CPP_SPEC
 #endif
 
 /* Define any extra SPECS that the compiler needs to generate.  */
