850-use_shared_libgcc.patch 2.5 KB

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