$OpenBSD: patch-gcc_config_gcc,v 1.2 2012/12/12 21:54:41 jasper Exp $
--- gcc/config.gcc.orig	Sat May 22 10:18:42 2010
+++ gcc/config.gcc	Wed Dec 12 05:41:08 2012
@@ -1184,6 +1184,7 @@ i[34567]86-*-openbsd*)
 	gnu_ld=yes
   	;;
 x86_64-*-openbsd*)
+	tm_defines="${tm_defines} PIE_DEFAULT=1"
 	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"
 	tm_file="${tm_file} exec-stack.h"
 	tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
@@ -1939,7 +1940,7 @@ mips*-*-openbsd*)
 	tm_file="elfos.h ${tm_file}"
 	case $machine in
         mips64*-*)
-		tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64"
+		tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64 PIE_DEFAULT=1"
 		tmake_file="t-openbsd mips/t-openbsd64"
 		;;
         mips*-*)
@@ -2460,6 +2461,7 @@ sparc-*-openbsd*)
 	use_collect2=yes
 	;;
 sparc64-*-openbsd*)
+	tm_defines="${tm_defines} PIE_DEFAULT=2"
 	tm_file="sparc/openbsd1-64.h sparc/sparc.h elfos.h svr4.h sparc/sysv4.h openbsd.h ${openbsd_libspec} sparc/openbsd64.h"
 	tm_file="${tm_file} exec-stack.h"
 	gas=yes gnu_ld=yes
