Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 192403 | Differences between
and this patch

Collapse All | Expand All

(-)gcc-4.3.1.orig/gcc/config/freebsd-spec.h (-8 / +33 lines)
Lines 63-74 Link Here
63
/* Define the default FreeBSD-specific per-CPU hook code.  */
63
/* Define the default FreeBSD-specific per-CPU hook code.  */
64
#define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
64
#define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
65
65
66
/* Provide a CPP_SPEC appropriate for FreeBSD.  We just deal with the GCC 
66
/* Provide a CPP_SPEC appropriate for FreeBSD.  We just deal with the GCC
67
   option `-posix', and PIC issues.  */
67
   option `-posix', and PIC issues.  Try to detect support for the
68
   `long long' type.  Unfortunately the GCC spec parser will not allow us
69
   to properly detect the "iso9899:1990" and "iso9899:199409" forms of
70
   -std=c89.  Because of the ':' in the -std argument. :-(  I have left
71
   them in the spec as a place holder in hopes someone knows a way to make
72
   the detection of them work.  */
68
73
69
#define FBSD_CPP_SPEC "							\
74
#define FBSD_CPP_SPEC "							\
70
  %(cpp_cpu)								\
75
  %(cpp_cpu)								\
71
  %(cpp_arch)								\
76
  %(cpp_arch)								\
77
  %{!ansi:%{!std=c89:%{!std=iso9899.1990:%{!std=iso9899.199409:-D_LONGLONG}}}} \
72
  %{posix:-D_POSIX_SOURCE}"
78
  %{posix:-D_POSIX_SOURCE}"
73
79
74
/* Provide a STARTFILE_SPEC appropriate for FreeBSD.  Here we add
80
/* Provide a STARTFILE_SPEC appropriate for FreeBSD.  Here we add
Lines 79-87 Link Here
79
#define FBSD_STARTFILE_SPEC \
85
#define FBSD_STARTFILE_SPEC \
80
  "%{!shared: \
86
  "%{!shared: \
81
     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
87
     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
82
		       %{!p:%{profile:gcrt1.o%s} \
88
	%{!p:%{profile:gcrt1.o%s} \
83
			 %{!profile:crt1.o%s}}}} \
89
	 %{!profile:crt1.o%s}}}} \
84
   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
90
   crti.o%s \
91
   %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
85
92
86
/* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
93
/* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
87
   the magical crtend.o file (see crtstuff.c) which provides part of 
94
   the magical crtend.o file (see crtstuff.c) which provides part of 
Lines 119-125 Link Here
119
    %{pg:  -lc_p}							\
122
    %{pg:  -lc_p}							\
120
  }"
123
  }"
121
#else
124
#else
122
#if FBSD_MAJOR < 5
125
#include <sys/param.h>
126
#if __FreeBSD_version < 500016
123
#define FBSD_LIB_SPEC "							\
127
#define FBSD_LIB_SPEC "							\
124
  %{!shared:								\
128
  %{!shared:								\
125
    %{!pg:								\
129
    %{!pg:								\
Lines 129-145 Link Here
129
      %{!pthread:-lc_p}							\
133
      %{!pthread:-lc_p}							\
130
      %{pthread:-lc_r_p}}						\
134
      %{pthread:-lc_r_p}}						\
131
  }"
135
  }"
132
#else
136
#elif __FreeBSD_version < 700022
133
#define FBSD_LIB_SPEC "							\
137
#define FBSD_LIB_SPEC "							\
134
  %{!shared:								\
138
  %{!shared:								\
135
    %{!pg: %{pthread:-lpthread} -lc}					\
139
    %{!pg: %{pthread:-lpthread} -lc}					\
136
    %{pg:  %{pthread:-lpthread_p} -lc_p}				\
140
    %{pg:  %{pthread:-lpthread_p} -lc_p}				\
137
  }"
141
  }"
142
#else
143
#define FBSD_LIB_SPEC "							\
144
  %{!shared:								\
145
    %{!pg: %{pthread:-lpthread} -lc}					\
146
    %{pg:  %{pthread:-lpthread_p} -lc_p}}				\
147
  %{shared:								\
148
    %{pthread:-lpthread} -lc}						\
149
  "
138
#endif
150
#endif
139
#endif
151
#endif
140
152
141
#if FBSD_MAJOR < 6
153
#if FBSD_MAJOR < 5
142
#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
154
#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
143
#else
155
#else
144
#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
156
#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
145
#endif
157
#endif
158
159
#if defined(HAVE_LD_EH_FRAME_HDR)
160
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
161
#endif
162
163
/* Use --as-needed -lgcc_s for eh support.  */
164
#ifdef HAVE_LD_AS_NEEDED
165
#define USE_LD_AS_NEEDED 1
166
#endif
(-)gcc-4.3.1.orig/gcc/config/t-freebsd-eh (+4 lines)
Line 0 Link Here
1
# Use unwind-dw2-fde-glibc
2
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
3
  $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
4
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
(-)gcc-4.3.1.orig/gcc/config.gcc (-1 / +5 lines)
Lines 462-468 Link Here
462
  # pleases around the provided core setting.
462
  # pleases around the provided core setting.
463
  gas=yes
463
  gas=yes
464
  gnu_ld=yes
464
  gnu_ld=yes
465
  extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
465
  extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
466
  fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
466
  fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
467
  tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
467
  tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
468
  tmake_file="t-slibgcc-elf-ver t-freebsd"
468
  tmake_file="t-slibgcc-elf-ver t-freebsd"
Lines 1116-1121 Link Here
1116
	;;
1116
	;;
1117
i[34567]86-*-freebsd*)
1117
i[34567]86-*-freebsd*)
1118
	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
1118
	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
1119
	fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
1120
	if test ${fbsd_major} -ge 7; then
1121
		tmake_file="${tmake_file} t-freebsd-eh"
1122
	fi
1119
	;;
1123
	;;
1120
x86_64-*-freebsd*)
1124
x86_64-*-freebsd*)
1121
	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"
1125
	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"
(-)gcc-4.3.1.orig/gcc/crtstuff.c (-3 / +5 lines)
Lines 90-102 Link Here
90
    && !defined(OBJECT_FORMAT_FLAT) \
90
    && !defined(OBJECT_FORMAT_FLAT) \
91
    && defined(HAVE_LD_EH_FRAME_HDR) \
91
    && defined(HAVE_LD_EH_FRAME_HDR) \
92
    && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
92
    && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
93
    && defined(__GLIBC__) && __GLIBC__ >= 2
93
    && ((defined(__GLIBC__) && __GLIBC__ >= 2) \
94
    || (defined(__FreeBSD_version) && __FreeBSD_version >= 700022))
94
#include <link.h>
95
#include <link.h>
95
/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
96
/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
96
   But it doesn't use PT_GNU_EH_FRAME ELF segment currently.  */
97
   But it doesn't use PT_GNU_EH_FRAME ELF segment currently.  */
97
# if !defined(__UCLIBC__) \
98
# if !defined(__UCLIBC__) \
98
     && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
99
     || (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
99
     || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
100
     || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
101
     || (__FreeBSD_version >= 700022)
100
#  define USE_PT_GNU_EH_FRAME
102
#  define USE_PT_GNU_EH_FRAME
101
# endif
103
# endif
102
#endif
104
#endif
(-)gcc-4.3.1.orig/gcc/unwind-dw2-fde-glibc.c (-2 / +10 lines)
Lines 49-56 Link Here
49
#include "gthr.h"
49
#include "gthr.h"
50
50
51
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
51
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
52
    && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
52
    && ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
53
	|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
53
	|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
54
    || (__FreeBSD_version >= 700022 ))
54
55
55
#ifndef __RELOC_POINTER
56
#ifndef __RELOC_POINTER
56
# define __RELOC_POINTER(ptr, base) ((ptr) + (base))
57
# define __RELOC_POINTER(ptr, base) ((ptr) + (base))
Lines 66-71 Link Here
66
#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
67
#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
67
#endif
68
#endif
68
69
70
/* Support FreeBSD */
71
#ifndef ElfW
72
# ifdef __ElfN
73
#  define ElfW __ElfN
74
# endif
75
#endif
76
69
struct unw_eh_callback_data
77
struct unw_eh_callback_data
70
{
78
{
71
  _Unwind_Ptr pc;
79
  _Unwind_Ptr pc;

Return to bug 192403