gcc: fix visibility of symbols libgcc.a
[openwrt.git] / toolchain / gcc / patches / 4.8.0 / 850-use_shared_libgcc.patch
1 --- a/gcc/config/arm/linux-eabi.h
2 +++ b/gcc/config/arm/linux-eabi.h
3 @@ -114,10 +114,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.S, so ensure an error if this definition
13     is used.  */
14 --- a/gcc/config/linux.h
15 +++ b/gcc/config/linux.h
16 @@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
17         builtin_assert ("system=posix");                        \
18      } while (0)
19  
20 +#ifndef LIBGCC_SPEC
21 +#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
22 +#endif
23 +
24  /* Determine which dynamic linker to use depending on whether GLIBC or
25     uClibc or Bionic is the default C library and whether
26     -muclibc or -mglibc or -mbionic has been passed to change the default.  */
27 --- a/libgcc/mkmap-symver.awk
28 +++ b/libgcc/mkmap-symver.awk
29 @@ -132,5 +132,5 @@ function output(lib) {
30    else if (inherit[lib])
31      printf("} %s;\n", inherit[lib]);
32    else
33 -    printf ("\n  local:\n\t*;\n};\n");
34 +    printf ("\n\t*;\n};\n");
35  }
36 --- a/gcc/config/rs6000/linux.h
37 +++ b/gcc/config/rs6000/linux.h
38 @@ -61,6 +61,9 @@
39  #undef  CPLUSPLUS_CPP_SPEC
40  #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
41  
42 +#undef LIBGCC_SPEC
43 +#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
44 +
45  #undef  LINK_SHLIB_SPEC
46  #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
47