gcc: enable LTO support unconditionally
[openwrt.git] / toolchain / gcc / patches / 4.6-linaro / 850-use_shared_libgcc.patch
1 --- a/gcc/config/arm/linux-eabi.h
2 +++ b/gcc/config/arm/linux-eabi.h
3 @@ -115,10 +115,6 @@
4  #define ENDFILE_SPEC \
5    LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
6  
7 -/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
8 -   do not use -lfloat.  */
9 -#undef LIBGCC_SPEC
10 -
11  /* Clear the instruction cache from `beg' to `end'.  This is
12     implemented in lib1funcs.asm, so ensure an error if this definition
13     is used.  */
14 --- a/gcc/config/arm/linux-elf.h
15 +++ b/gcc/config/arm/linux-elf.h
16 @@ -60,8 +60,6 @@
17     %{shared:-lc} \
18     %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
19  
20 -#define LIBGCC_SPEC "-lgcc"
21 -
22  #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
23  
24  #define LINUX_TARGET_LINK_SPEC  "%{h*} \
25 --- a/gcc/config/linux.h
26 +++ b/gcc/config/linux.h
27 @@ -52,6 +52,10 @@ see the files COPYING3 and COPYING.RUNTI
28         builtin_assert ("system=posix");                        \
29      } while (0)
30  
31 +#ifndef LIBGCC_SPEC
32 +#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
33 +#endif
34 +
35  /* Determine which dynamic linker to use depending on whether GLIBC or
36     uClibc or Bionic is the default C library and whether
37     -muclibc or -mglibc or -mbionic has been passed to change the default.  */
38 --- a/gcc/config/rs6000/linux.h
39 +++ b/gcc/config/rs6000/linux.h
40 @@ -88,6 +88,8 @@
41  #define USE_LD_AS_NEEDED 1
42  #endif
43  
44 +#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
45 +
46  #undef  TARGET_VERSION
47  #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
48  
49 --- a/gcc/mkmap-symver.awk
50 +++ b/gcc/mkmap-symver.awk
51 @@ -132,5 +132,5 @@ function output(lib) {
52    else if (inherit[lib])
53      printf("} %s;\n", inherit[lib]);
54    else
55 -    printf ("\n  local:\n\t*;\n};\n");
56 +    printf ("\n\t*;\n};\n");
57  }
58 --- a/libgcc/Makefile.in
59 +++ b/libgcc/Makefile.in
60 @@ -269,6 +269,12 @@ ifeq ($(enable_shared),yes)
61      install-libunwind = install-libunwind
62    endif
63  
64 +else
65 +# Not enable_shared.
66 +iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items))
67 +endif
68 +
69 +
70  # For -fvisibility=hidden.  We need both a -fvisibility=hidden on
71  # the command line, and a #define to prevent libgcc2.h etc from
72  # overriding that with #pragmas.
73 @@ -291,13 +297,6 @@ else
74  gen-hide-list = echo > $@
75  endif
76  
77 -else
78 -# Not enable_shared.
79 -iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items))
80 -vis_hide =
81 -gen-hide-list = echo > \$@
82 -endif
83 -
84  ifneq ($(EXTRA_PARTS),)
85    extra-parts = libgcc-extra-parts
86    INSTALL_PARTS = $(EXTRA_PARTS)