patches/gcc/4.4.4/290-freebsd.patch
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
child 2148 ada9128c98b8
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

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