pkgsrc/lang/gcc48/patches/patch-gcc_config.gcc
obache 24efdc1fe4 Bump PKGREVISION.
* Fixes regressions, revive parts removed at "Fix build under OpenBSD/amd64 5.5"
* Drop default behaviour changes and local features from OpenBSD ports,
  it break other platforms, at least, NetBSD-6.0/i386.
* Remove needless patches after "Restore monolithic gcc48 and gcc48-libs".
2014-11-28 09:57:32 +00:00

167 lines
6.2 KiB
Text

$NetBSD: patch-gcc_config.gcc,v 1.3 2014/11/28 09:57:32 obache Exp $
--- gcc/config.gcc.orig 2014-05-06 15:29:04.000000000 +0000
+++ gcc/config.gcc
@@ -625,6 +625,26 @@ case ${target} in
# need_64bit_hwint=yes # system compiler has this for all arch!
use_gcc_stdint=wrap
;;
+*-*-dragonfly*)
+ gas=yes
+ gnu_ld=yes
+ tmake_file="t-slibgcc"
+ case ${enable_threads} in
+ "" | yes | posix)
+ thread_file='posix'
+ ;;
+ no | gnat | single)
+ # Let these no-posix thread selections fail through if required
+ ;;
+ *)
+ echo 'Unknown thread configuration for DragonFly BSD'
+ exit 1
+ ;;
+ esac
+ extra_options="$extra_options rpath.opt dragonfly.opt"
+ default_use_cxa_atexit=yes
+ use_gcc_stdint=wrap
+ ;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
extra_options="$extra_options gnu-user.opt"
gas=yes
@@ -684,6 +704,7 @@ case ${target} in
target_has_targetcm=yes
;;
*-*-netbsd*)
+ use_gcc_stdint=wrap
tmake_file="t-slibgcc"
gas=yes
gnu_ld=yes
@@ -712,6 +733,14 @@ case ${target} in
default_use_cxa_atexit=yes
;;
esac
+ case ${target} in
+ *-*-openbsd[0-3].*|*-*-openbsd4.[012])
+ # keep default of no cxa_atexit support for these older releases
+ ;;
+ *)
+ default_use_cxa_atexit=yes
+ ;;
+ esac
;;
*-*-openbsd*)
tmake_file="t-openbsd"
@@ -851,7 +880,7 @@ alpha*-*-netbsd*)
alpha/elf.opt"
;;
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="elfos.h 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.
@@ -1070,6 +1099,7 @@ hppa*-*-linux*)
;;
hppa*-*-openbsd*)
target_cpu_default="MASK_PA_11"
+ tm_defines="${tm_defines} PIE_DEFAULT=1"
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"
@@ -1222,6 +1252,14 @@ x86_64-*-rdos*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
tmake_file="i386/t-i386elf t-svr4"
;;
+i[34567]86-*-dragonfly*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
+ tmake_file="${tmake_file} i386/t-ctstuff"
+ ;;
+x86_64-*-dragonfly*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h"
+ tmake_file="${tmake_file} i386/t-ctstuff"
+ ;;
i[34567]86-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
;;
@@ -1229,12 +1267,14 @@ x86_64-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
;;
i[34567]86-*-netbsdelf*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h netbsd-stdint.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ tmake_file="${tmake_file} i386/t-crtstuff"
;;
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"
+ 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 netbsd-stdint.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ tmake_file="${tmake_file} i386/t-crtstuff"
;;
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"
@@ -1245,6 +1285,7 @@ i[34567]86-*-openbsd2.*|i[34567]86-*open
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 +1293,7 @@ i[34567]86-*-openbsd*)
gnu_ld=yes
;;
x86_64-*-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/x86-64.h i386/openbsdelf.h"
extra_options="${extra_options} openbsd.opt"
@@ -1981,11 +2023,12 @@ picochip-*)
use_gcc_stdint=wrap
tmake_file="picochip/t-picochip t-pnt16-warn"
;;
-# port not yet contributed
-#powerpc-*-openbsd*)
-# tmake_file="${tmake_file} rs6000/t-fprules"
-# 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"
+ ;;
powerpc-*-darwin*)
extra_options="${extra_options} rs6000/darwin.opt"
case ${target} in
@@ -2545,6 +2588,7 @@ sparc64-*-netbsd*)
tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
;;
sparc64-*-openbsd*)
+ tm_defines="${tm_defines} PIE_DEFAULT=2"
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"
@@ -2735,6 +2779,12 @@ case ${target} in
arch_without_sse2=yes
arch_without_64bit=yes
;;
+ i386-*-openbsd*)
+ arch=i486
+ cpu=generic
+ arch_without_sse2=yes
+ arch_without_64bit=yes
+ ;;
i386-*-*)
arch=i386
cpu=i386
@@ -3750,6 +3800,8 @@ case ${target} in
;;
i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
;;
+ i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
+ ;;
i[34567]86-*-freebsd* | x86_64-*-freebsd*)
;;
ia64*-*-linux*)