patch-gcc_config_gcc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. $OpenBSD: patch-gcc_config_gcc,v 1.9 2014/01/15 20:16:03 brad Exp $
  2. --- gcc/config.gcc.orig Wed Mar 6 12:40:07 2013
  3. +++ gcc/config.gcc Sun Jan 12 19:32:57 2014
  4. @@ -668,6 +668,14 @@ case ${target} in
  5. *-*-openbsd2.*|*-*-openbsd3.[012])
  6. tm_defines="${tm_defines} HAS_LIBC_R=1" ;;
  7. esac
  8. + case ${target} in
  9. + *-*-openbsd[0-3].*|*-*-openbsd4.[012])
  10. + # keep default of no cxa_atexit support for these older releases
  11. + ;;
  12. + *)
  13. + default_use_cxa_atexit=yes
  14. + ;;
  15. + esac
  16. ;;
  17. *-*-rtems*)
  18. case ${enable_threads} in
  19. @@ -741,7 +749,7 @@ alpha*-*-netbsd*)
  20. tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
  21. ;;
  22. alpha*-*-openbsd*)
  23. - tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
  24. + tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT PIE_DEFAULT=2"
  25. tm_file="alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
  26. extra_options="${extra_options} openbsd.opt alpha/elf.opt"
  27. # default x-alpha is only appropriate for dec-osf.
  28. @@ -1057,10 +1065,14 @@ hppa*-*-linux*)
  29. tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
  30. fi
  31. ;;
  32. -# port not yet contributed.
  33. -#hppa*-*-openbsd*)
  34. -# target_cpu_default="MASK_PA_11"
  35. -# ;;
  36. +hppa*-*-openbsd*)
  37. + target_cpu_default="MASK_PA_11"
  38. + tm_defines="${tm_defines} PIE_DEFAULT=1"
  39. + tm_file="${tm_file} dbxelf.h elfos.h openbsd-libpthread.h \
  40. + pa/pa32-regs.h pa/openbsd.h openbsd.h"
  41. + tmake_file="${tmake_file} pa/t-openbsd"
  42. + extra_options="${extra_options} openbsd.opt"
  43. + ;;
  44. hppa[12]*-*-hpux10*)
  45. case ${target} in
  46. hppa1.1-*-* | hppa2*-*-*)
  47. @@ -1248,12 +1260,19 @@ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
  48. use_collect2=yes
  49. ;;
  50. i[34567]86-*-openbsd*)
  51. + tm_defines="${tm_defines} PIE_DEFAULT=1"
  52. tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
  53. tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
  54. extra_options="${extra_options} openbsd.opt"
  55. gas=yes
  56. gnu_ld=yes
  57. ;;
  58. +x86_64-*-openbsd*)
  59. + tm_defines="${tm_defines} PIE_DEFAULT=1"
  60. + 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"
  61. + tm_file="${tm_file} exec-stack.h"
  62. + tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
  63. + ;;
  64. i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
  65. # Intel 80386's running GNU/*
  66. # with ELF format using glibc 2
  67. @@ -1914,14 +1933,15 @@ mips*-*-linux*) # Linux MIPS, either endian.
  68. test x$with_llsc != x || with_llsc=yes
  69. ;;
  70. mips*-*-openbsd*)
  71. - tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
  72. - target_cpu_default="MASK_ABICALLS"
  73. - tm_file="mips/mips.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/openbsd.h mips/sdb.h"
  74. + tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_64 PIE_DEFAULT=1"
  75. + tm_file="dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/mips.h mips/openbsd64.h"
  76. extra_options="${extra_options} openbsd.opt"
  77. case ${target} in
  78. mips*el-*-openbsd*)
  79. - tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
  80. - *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";;
  81. + tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0"
  82. + target_cpu_default="MASK_ABICALLS";;
  83. + *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN"
  84. + target_cpu_default="MASK_ABICALLS|MASK_FIX_R4000|MASK_FIX_R4400";;
  85. esac
  86. ;;
  87. mips*-sde-elf*)
  88. @@ -2061,10 +2081,11 @@ picochip-*)
  89. tmake_file="picochip/t-picochip t-pnt16-warn"
  90. ;;
  91. # port not yet contributed
  92. -#powerpc-*-openbsd*)
  93. -# tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-fprules-fpbit "
  94. -# extra_headers=
  95. -# ;;
  96. +powerpc-*-openbsd*)
  97. + tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-libpthread.h freebsd-spec.h rs6000/sysv4.h rs6000/openbsd.h"
  98. + tmake_file="${tmake_file} rs6000/t-openbsd"
  99. + extra_options="${extra_options} rs6000/sysv4.opt"
  100. + ;;
  101. powerpc-*-darwin*)
  102. extra_options="${extra_options} rs6000/darwin.opt"
  103. extra_parts="crt2.o"
  104. @@ -2665,6 +2686,7 @@ sparc64-*-netbsd*)
  105. tmake_file="${tmake_file} sparc/t-netbsd64"
  106. ;;
  107. sparc64-*-openbsd*)
  108. + tm_defines="${tm_defines} PIE_DEFAULT=2"
  109. tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
  110. tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
  111. extra_options="${extra_options} openbsd.opt"
  112. @@ -2826,6 +2848,12 @@ case ${target} in
  113. else
  114. arch=i386
  115. fi
  116. + cpu=generic
  117. + arch_without_sse2=yes
  118. + arch_without_64bit=yes
  119. + ;;
  120. + i386-*-openbsd*)
  121. + arch=i486
  122. cpu=generic
  123. arch_without_sse2=yes
  124. arch_without_64bit=yes