patches/gcc/4.4.6/290-freebsd.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 02 18:26:53 2011 +0200 (2011-08-02)
changeset 2592 4908eb2b6f17
parent 2149 98b7806295cc
permissions -rw-r--r--
scripts/functions: cvs retrieval first tries the mirror for tarballs

The cvs download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via cvs.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard cvs retrieval will kick in.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@2149
     1
diff -durN gcc-4.4.5.orig/gcc/config/freebsd-spec.h gcc-4.4.5/gcc/config/freebsd-spec.h
yann@2149
     2
--- gcc-4.4.5.orig/gcc/config/freebsd-spec.h	2010-10-09 23:09:53.000000000 +0200
yann@2149
     3
+++ gcc-4.4.5/gcc/config/freebsd-spec.h	2010-10-09 23:10:02.000000000 +0200
yann@2149
     4
@@ -86,9 +86,10 @@
yann@2149
     5
 #define FBSD_STARTFILE_SPEC \
yann@2149
     6
   "%{!shared: \
yann@2149
     7
      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
yann@2149
     8
-		       %{!p:%{profile:gcrt1.o%s} \
yann@2149
     9
-			 %{!profile:crt1.o%s}}}} \
yann@2149
    10
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
yann@2149
    11
+	%{!p:%{profile:gcrt1.o%s} \
yann@2149
    12
+	 %{!profile:crt1.o%s}}}} \
yann@2149
    13
+   crti.o%s \
yann@2149
    14
+   %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
yann@2149
    15
 
yann@2149
    16
 /* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
yann@2149
    17
    the magical crtend.o file (see crtstuff.c) which provides part of 
yann@2149
    18
@@ -126,7 +127,8 @@
yann@2149
    19
     %{pg:  -lc_p}							\
yann@2149
    20
   }"
yann@2149
    21
 #else
yann@2149
    22
-#if FBSD_MAJOR < 5
yann@2149
    23
+#include <sys/param.h>
yann@2149
    24
+#if __FreeBSD_version < 500016
yann@2149
    25
 #define FBSD_LIB_SPEC "							\
yann@2149
    26
   %{!shared:								\
yann@2149
    27
     %{!pg:								\
yann@2149
    28
@@ -136,17 +138,34 @@
yann@2149
    29
       %{!pthread:-lc_p}							\
yann@2149
    30
       %{pthread:-lc_r_p}}						\
yann@2149
    31
   }"
yann@2149
    32
-#else
yann@2149
    33
+#elif __FreeBSD_version < 700022
yann@2149
    34
 #define FBSD_LIB_SPEC "							\
yann@2149
    35
   %{!shared:								\
yann@2149
    36
     %{!pg: %{pthread:-lpthread} -lc}					\
yann@2149
    37
     %{pg:  %{pthread:-lpthread_p} -lc_p}				\
yann@2149
    38
   }"
yann@2149
    39
+#else
yann@2149
    40
+#define FBSD_LIB_SPEC "							\
yann@2149
    41
+  %{!shared:								\
yann@2149
    42
+    %{!pg: %{pthread:-lpthread} -lc}					\
yann@2149
    43
+    %{pg:  %{pthread:-lpthread_p} -lc_p}}				\
yann@2149
    44
+  %{shared:								\
yann@2149
    45
+    %{pthread:-lpthread} -lc}						\
yann@2149
    46
+  "
yann@2149
    47
 #endif
yann@2149
    48
 #endif
yann@2149
    49
 
yann@2149
    50
-#if FBSD_MAJOR < 6
yann@2149
    51
+#if FBSD_MAJOR < 5
yann@2149
    52
 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
yann@2149
    53
 #else
yann@2149
    54
 #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
yann@2149
    55
 #endif
yann@2149
    56
+
yann@2149
    57
+#if defined(HAVE_LD_EH_FRAME_HDR)
yann@2149
    58
+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
yann@2149
    59
+#endif
yann@2149
    60
+
yann@2149
    61
+/* Use --as-needed -lgcc_s for eh support.  */
yann@2149
    62
+#ifdef HAVE_LD_AS_NEEDED
yann@2149
    63
+#define USE_LD_AS_NEEDED 1
yann@2149
    64
+#endif