1
0

850-use_shared_libgcc.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd
  2. Author: Felix Fietkau <nbd@openwrt.org>
  3. Date: Sun Feb 12 20:25:47 2012 +0000
  4. gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary
  5. SVN-Revision: 30486
  6. --- a/gcc/config/arm/linux-eabi.h
  7. +++ b/gcc/config/arm/linux-eabi.h
  8. @@ -126,10 +126,6 @@
  9. "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
  10. LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
  11. -/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
  12. - do not use -lfloat. */
  13. -#undef LIBGCC_SPEC
  14. -
  15. /* Clear the instruction cache from `beg' to `end'. This is
  16. implemented in lib1funcs.S, so ensure an error if this definition
  17. is used. */
  18. --- a/gcc/config/linux.h
  19. +++ b/gcc/config/linux.h
  20. @@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI
  21. builtin_assert ("system=posix"); \
  22. } while (0)
  23. +#ifndef LIBGCC_SPEC
  24. +#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
  25. +#endif
  26. +
  27. /* Determine which dynamic linker to use depending on whether GLIBC or
  28. uClibc or Bionic or musl is the default C library and whether
  29. -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
  30. --- a/libgcc/mkmap-symver.awk
  31. +++ b/libgcc/mkmap-symver.awk
  32. @@ -136,5 +136,5 @@ function output(lib) {
  33. else if (inherit[lib])
  34. printf("} %s;\n", inherit[lib]);
  35. else
  36. - printf ("\n local:\n\t*;\n};\n");
  37. + printf ("\n\t*;\n};\n");
  38. }
  39. --- a/gcc/config/rs6000/linux.h
  40. +++ b/gcc/config/rs6000/linux.h
  41. @@ -60,6 +60,9 @@
  42. #undef CPP_OS_DEFAULT_SPEC
  43. #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
  44. +#undef LIBGCC_SPEC
  45. +#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
  46. +
  47. #undef LINK_SHLIB_SPEC
  48. #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
  49. %{static-pie:-static -pie --no-dynamic-linker -z text}"