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