Here is a diff to enable PIE by default with the GCC 4.6 / 4.8 ports,
but while there I noticed alpha was missed for 4.6 and 4.8 has PIE
enabled for powerpc but PIE support hasn't been enabled by default
yet so disable it for now.

Stuart, please check this and put it into a bulk build.


Index: 4.6/Makefile
===================================================================
RCS file: /home/cvs/ports/lang/gcc/4.6/Makefile,v
retrieving revision 1.66
diff -u -p -u -p -r1.66 Makefile
--- 4.6/Makefile        25 Nov 2013 14:16:23 -0000      1.66
+++ 4.6/Makefile        11 Jan 2014 19:26:44 -0000
@@ -24,14 +24,14 @@ PKGNAME-ada =   gnat-${FULL_PKGVERSION}
 PKGNAME-go =   gccgo-${FULL_PKGVERSION}
 PKGSPEC-main = gcc->=4.6,<4.7
 
-REVISION-main =        4
-REVISION-c++ = 1
-#REVISION-estdc =
-REVISION-f95 = 1
-REVISION-java =        1
-REVISION-objc =        0
-REVISION-ada = 3
-REVISION-go =  1
+REVISION-main =        5
+REVISION-c++ = 2
+REVISION-estdc = 0
+REVISION-f95 = 2
+REVISION-java =        2
+REVISION-objc =        1
+REVISION-ada = 4
+REVISION-go =  2
 
 SHARED_LIBS =  estdc++         14.0 \
                gfortran        3.0 \
Index: 4.6/patches/patch-gcc_config_gcc
===================================================================
RCS file: /home/cvs/ports/lang/gcc/4.6/patches/patch-gcc_config_gcc,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 patch-gcc_config_gcc
--- 4.6/patches/patch-gcc_config_gcc    7 Jun 2013 07:54:23 -0000       1.7
+++ 4.6/patches/patch-gcc_config_gcc    11 Jan 2014 19:43:36 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-gcc_config_gcc,v 1.7 2013/06/07 07:54:23 pascal Exp $
---- gcc/config.gcc.orig        Wed Mar  6 18:40:07 2013
-+++ gcc/config.gcc     Sat Apr 13 16:20:31 2013
+--- gcc/config.gcc.orig        Wed Mar  6 12:40:07 2013
++++ gcc/config.gcc     Sat Jan 11 14:42:08 2014
 @@ -668,6 +668,14 @@ case ${target} in
      *-*-openbsd2.*|*-*-openbsd3.[012])
        tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
@@ -16,6 +16,15 @@ $OpenBSD: patch-gcc_config_gcc,v 1.7 201
    ;;
  *-*-rtems*)
    case ${enable_threads} in
+@@ -741,7 +749,7 @@ alpha*-*-netbsd*)
+       tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
+       ;;
+ alpha*-*-openbsd*)
+-      tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME 
OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
++      tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME 
OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT PIE_DEFAULT=2"
+       tm_file="alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h 
alpha/openbsd.h openbsd-libpthread.h"
+       extra_options="${extra_options} openbsd.opt alpha/elf.opt"
+       # default x-alpha is only appropriate for dec-osf.
 @@ -1057,10 +1065,14 @@ hppa*-*-linux*)
            tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
        fi
@@ -35,7 +44,14 @@ $OpenBSD: patch-gcc_config_gcc,v 1.7 201
  hppa[12]*-*-hpux10*)
        case ${target} in
        hppa1.1-*-* | hppa2*-*-*)
-@@ -1254,6 +1266,12 @@ i[34567]86-*-openbsd*)
+@@ -1248,12 +1260,19 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
+       use_collect2=yes
+       ;;
+ i[34567]86-*-openbsd*)
++      tm_defines="${tm_defines} PIE_DEFAULT=1"
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+       tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h 
i386/openbsdelf.h"
+       extra_options="${extra_options} openbsd.opt"
        gas=yes
        gnu_ld=yes
        ;;
@@ -48,7 +64,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.7 201
  i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu 
| i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
                        # Intel 80386's running GNU/*
                        # with ELF format using glibc 2
-@@ -1914,14 +1932,15 @@ mips*-*-linux*)                                # Linux 
MIPS, either endian.
+@@ -1914,14 +1933,15 @@ mips*-*-linux*)                                # Linux 
MIPS, either endian.
        test x$with_llsc != x || with_llsc=yes
        ;;
  mips*-*-openbsd*)
@@ -69,7 +85,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.7 201
          esac
        ;;
  mips*-sde-elf*)
-@@ -2061,10 +2080,11 @@ picochip-*)
+@@ -2061,10 +2081,11 @@ picochip-*)
        tmake_file="picochip/t-picochip t-pnt16-warn"
          ;;
  # port not yet contributed
@@ -85,7 +101,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.7 201
  powerpc-*-darwin*)
        extra_options="${extra_options} rs6000/darwin.opt"
        extra_parts="crt2.o"
-@@ -2665,6 +2685,7 @@ sparc64-*-netbsd*)
+@@ -2665,6 +2686,7 @@ sparc64-*-netbsd*)
        tmake_file="${tmake_file} sparc/t-netbsd64"
        ;;
  sparc64-*-openbsd*)
@@ -93,7 +109,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.7 201
        tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h 
sparc/sp64-elf.h"
        tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h 
sparc/openbsd64.h"
        extra_options="${extra_options} openbsd.opt"
-@@ -2826,6 +2847,12 @@ case ${target} in
+@@ -2826,6 +2848,12 @@ case ${target} in
      else
        arch=i386
      fi
Index: 4.8/Makefile
===================================================================
RCS file: /home/cvs/ports/lang/gcc/4.8/Makefile,v
retrieving revision 1.24
diff -u -p -u -p -r1.24 Makefile
--- 4.8/Makefile        3 Dec 2013 10:38:52 -0000       1.24
+++ 4.8/Makefile        11 Jan 2014 19:45:33 -0000
@@ -28,6 +28,15 @@ PKGNAME-ada =   gnat-${FULL_PKGVERSION}
 #PKGNAME-go =  gccgo-${FULL_PKGVERSION}
 PKGSPEC-main = gcc->=4.8,<4.9
 
+REVISION-main  = 0
+REVISION-c++   = 0
+REVISION-estdc = 0
+REVISION-f95   = 0
+REVISION-java  = 0
+REVISION-objc  = 0
+REVISION-ada   = 0
+#REVISION-go   =
+
 SHARED_LIBS =  estdc++         16.0 \
                gfortran        5.0 \
                gcj             3.0 \
Index: 4.8/patches/patch-gcc_config_gcc
===================================================================
RCS file: /home/cvs/ports/lang/gcc/4.8/patches/patch-gcc_config_gcc,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-gcc_config_gcc
--- 4.8/patches/patch-gcc_config_gcc    2 Dec 2013 22:34:55 -0000       1.2
+++ 4.8/patches/patch-gcc_config_gcc    11 Jan 2014 20:02:13 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-gcc_config_gcc,v 1.2 2013/12/02 22:34:55 pascal Exp $
---- gcc/config.gcc.orig        Thu Oct  3 02:47:24 2013
-+++ gcc/config.gcc     Wed Oct 16 18:56:48 2013
+--- gcc/config.gcc.orig        Wed Oct  2 20:47:24 2013
++++ gcc/config.gcc     Sat Jan 11 15:00:04 2014
 @@ -712,6 +712,14 @@ case ${target} in
        default_use_cxa_atexit=yes
        ;;
@@ -33,7 +33,15 @@ $OpenBSD: patch-gcc_config_gcc,v 1.2 201
        tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-stdint.h 
openbsd-libpthread.h \
                 pa/pa-openbsd.h pa/pa32-regs.h pa/pa32-openbsd.h"
        tmake_file="${tmake_file} pa/t-openbsd"
-@@ -1252,6 +1261,7 @@ i[34567]86-*-openbsd*)
+@@ -1245,6 +1254,7 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
+       use_collect2=yes
+       ;;
+ i[34567]86-*-openbsd*)
++      tm_defines="${tm_defines} PIE_DEFAULT=1"
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
+       tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h 
i386/openbsdelf.h"
+       extra_options="${extra_options} openbsd.opt"
+@@ -1252,6 +1262,7 @@ i[34567]86-*-openbsd*)
        gnu_ld=yes
        ;;
  x86_64-*-openbsd*)
@@ -41,7 +49,7 @@ $OpenBSD: patch-gcc_config_gcc,v 1.2 201
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
        tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h 
i386/x86-64.h i386/openbsdelf.h"
        extra_options="${extra_options} openbsd.opt"
-@@ -1973,11 +1983,12 @@ picochip-*)
+@@ -1973,11 +1984,11 @@ picochip-*)
        use_gcc_stdint=wrap
        tmake_file="picochip/t-picochip t-pnt16-warn"
          ;;
@@ -51,7 +59,6 @@ $OpenBSD: patch-gcc_config_gcc,v 1.2 201
 -#     extra_headers=
 -#     ;;
 +powerpc-*-openbsd*)
-+      tm_defines="${tm_defines} PIE_DEFAULT=2"
 +      tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-libpthread.h 
freebsd-spec.h rs6000/sysv4.h rs6000/openbsd.h"
 +      tmake_file="${tmake_file} rs6000/t-openbsd"
 +      extra_options="${extra_options} rs6000/sysv4.opt openbsd.opt"

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to