400-LoongArch-Fix-MUSL_DYNAMIC_LINKER.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From a80c68a08604b0ac625ac7fc59eae40b551b1176 Mon Sep 17 00:00:00 2001
  2. From: Peng Fan <[email protected]>
  3. Date: Wed, 19 Apr 2023 16:23:42 +0800
  4. Subject: [PATCH] LoongArch: Fix MUSL_DYNAMIC_LINKER
  5. The system based on musl has no '/lib64', so change it.
  6. https://wiki.musl-libc.org/guidelines-for-distributions.html,
  7. "Multilib/multi-arch" section of this introduces it.
  8. gcc/
  9. * config/loongarch/gnu-user.h (MUSL_DYNAMIC_LINKER): Redefine.
  10. Signed-off-by: Peng Fan <[email protected]>
  11. Suggested-by: Xi Ruoyao <[email protected]>
  12. ---
  13. gcc/config/loongarch/gnu-user.h | 7 ++++++-
  14. 1 file changed, 6 insertions(+), 1 deletion(-)
  15. diff --git a/gcc/config/loongarch/gnu-user.h b/gcc/config/loongarch/gnu-user.h
  16. index aecaa02a199..fa1a5211419 100644
  17. --- a/gcc/config/loongarch/gnu-user.h
  18. +++ b/gcc/config/loongarch/gnu-user.h
  19. @@ -33,9 +33,14 @@ along with GCC; see the file COPYING3. If not see
  20. #define GLIBC_DYNAMIC_LINKER \
  21. "/lib" ABI_GRLEN_SPEC "/ld-linux-loongarch-" ABI_SPEC ".so.1"
  22. +#define MUSL_ABI_SPEC \
  23. + "%{mabi=lp64d:-lp64d}" \
  24. + "%{mabi=lp64f:-lp64f}" \
  25. + "%{mabi=lp64s:-lp64s}"
  26. +
  27. #undef MUSL_DYNAMIC_LINKER
  28. #define MUSL_DYNAMIC_LINKER \
  29. - "/lib" ABI_GRLEN_SPEC "/ld-musl-loongarch-" ABI_SPEC ".so.1"
  30. + "/lib/ld-musl-loongarch" ABI_GRLEN_SPEC MUSL_ABI_SPEC ".so.1"
  31. #undef GNU_USER_TARGET_LINK_SPEC
  32. #define GNU_USER_TARGET_LINK_SPEC \
  33. --
  34. 2.39.3