5818cf4da0ab8334501944a4b6b679011f81567f
[openwrt/openwrt.git] / toolchain / gcc / patches / 5.4.0 / 850-use_shared_libgcc.patch
1 --- a/gcc/config/arm/linux-eabi.h
2 +++ b/gcc/config/arm/linux-eabi.h
3 @@ -131,10 +131,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 @@ -53,6 +53,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 or musl is the default C library and whether
26 -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
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 @@ -60,6 +60,9 @@
39 #undef CPP_OS_DEFAULT_SPEC
40 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
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