patches/gcc/4.4.3/290-freebsd.patch
changeset 1752 2a0656d9c905
parent 1611 e2516bba8fe5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.4.3/290-freebsd.patch	Sun Jan 24 22:53:51 2010 +0100
     1.3 @@ -0,0 +1,64 @@
     1.4 +diff -durN gcc-4.4.0.orig/gcc/config/freebsd-spec.h gcc-4.4.0/gcc/config/freebsd-spec.h
     1.5 +--- gcc-4.4.0.orig/gcc/config/freebsd-spec.h	2009-05-27 21:38:47.000000000 +0200
     1.6 ++++ gcc-4.4.0/gcc/config/freebsd-spec.h	2009-05-27 21:38:47.000000000 +0200
     1.7 +@@ -86,9 +86,10 @@
     1.8 + #define FBSD_STARTFILE_SPEC \
     1.9 +   "%{!shared: \
    1.10 +      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
    1.11 +-		       %{!p:%{profile:gcrt1.o%s} \
    1.12 +-			 %{!profile:crt1.o%s}}}} \
    1.13 +-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
    1.14 ++	%{!p:%{profile:gcrt1.o%s} \
    1.15 ++	 %{!profile:crt1.o%s}}}} \
    1.16 ++   crti.o%s \
    1.17 ++   %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
    1.18 + 
    1.19 + /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
    1.20 +    the magical crtend.o file (see crtstuff.c) which provides part of 
    1.21 +@@ -126,7 +127,8 @@
    1.22 +     %{pg:  -lc_p}							\
    1.23 +   }"
    1.24 + #else
    1.25 +-#if FBSD_MAJOR < 5
    1.26 ++#include <sys/param.h>
    1.27 ++#if __FreeBSD_version < 500016
    1.28 + #define FBSD_LIB_SPEC "							\
    1.29 +   %{!shared:								\
    1.30 +     %{!pg:								\
    1.31 +@@ -136,17 +138,34 @@
    1.32 +       %{!pthread:-lc_p}							\
    1.33 +       %{pthread:-lc_r_p}}						\
    1.34 +   }"
    1.35 +-#else
    1.36 ++#elif __FreeBSD_version < 700022
    1.37 + #define FBSD_LIB_SPEC "							\
    1.38 +   %{!shared:								\
    1.39 +     %{!pg: %{pthread:-lpthread} -lc}					\
    1.40 +     %{pg:  %{pthread:-lpthread_p} -lc_p}				\
    1.41 +   }"
    1.42 ++#else
    1.43 ++#define FBSD_LIB_SPEC "							\
    1.44 ++  %{!shared:								\
    1.45 ++    %{!pg: %{pthread:-lpthread} -lc}					\
    1.46 ++    %{pg:  %{pthread:-lpthread_p} -lc_p}}				\
    1.47 ++  %{shared:								\
    1.48 ++    %{pthread:-lpthread} -lc}						\
    1.49 ++  "
    1.50 + #endif
    1.51 + #endif
    1.52 + 
    1.53 +-#if FBSD_MAJOR < 6
    1.54 ++#if FBSD_MAJOR < 5
    1.55 + #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
    1.56 + #else
    1.57 + #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
    1.58 + #endif
    1.59 ++
    1.60 ++#if defined(HAVE_LD_EH_FRAME_HDR)
    1.61 ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
    1.62 ++#endif
    1.63 ++
    1.64 ++/* Use --as-needed -lgcc_s for eh support.  */
    1.65 ++#ifdef HAVE_LD_AS_NEEDED
    1.66 ++#define USE_LD_AS_NEEDED 1
    1.67 ++#endif