201-musl_arm.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --- a/gcc/config/arm/linux-eabi.h
  2. +++ b/gcc/config/arm/linux-eabi.h
  3. @@ -77,6 +77,23 @@
  4. %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
  5. %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
  6. +/* For ARM musl currently supports four dynamic linkers:
  7. + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
  8. + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
  9. + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
  10. + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
  11. + musl does not support the legacy OABI mode.
  12. + All the dynamic linkers live in /lib.
  13. + We default to soft-float, EL. */
  14. +#undef MUSL_DYNAMIC_LINKER
  15. +#if TARGET_BIG_ENDIAN_DEFAULT
  16. +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
  17. +#else
  18. +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
  19. +#endif
  20. +#define MUSL_DYNAMIC_LINKER \
  21. + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
  22. +
  23. /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
  24. use the GNU/Linux version, not the generic BPABI version. */
  25. #undef LINK_SPEC
  26. --- a/libitm/config/arm/hwcap.cc
  27. +++ b/libitm/config/arm/hwcap.cc
  28. @@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
  29. #ifdef __linux__
  30. #include <unistd.h>
  31. +#ifdef __GLIBC__
  32. #include <sys/fcntl.h>
  33. +#else
  34. +#include <fcntl.h>
  35. +#endif
  36. #include <elf.h>
  37. static void __attribute__((constructor))