patches/gcc/4.4.4/290-freebsd.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Dec 23 20:43:32 2010 +0100 (2010-12-23)
changeset 2307 2efd46963086
parent 1948 d341be24dc68
permissions -rw-r--r--
buildtools: move to working directory

There is absolutely *no* reason for the buildtools (wrappers to gcc, g++,
as, ld... for the local machine) to be in the toolchain directory. Moreover,
they are removed after the build completes.

Move them out of the toolchain directory, and into the build directory (but
yet the part specific to the current toolchain). This means we no longer
need to explicitly remove them either, BTW, but we need to save/restore them
for the restart feature.

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