0004-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch 954 B

12345678910111213141516171819202122232425262728293031
  1. From d2e4e3e72b5f2f68d595dfd3a77f58744f3f243e Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Fri, 27 Mar 2020 21:23:53 +0100
  4. Subject: [PATCH] gcc: define _REENTRANT for OpenRISC when -pthread is passed
  5. The detection of pthread support fails on OpenRISC unless _REENTRANT
  6. is defined. Added the CPP_SPEC definition to correct this.
  7. Patch sent upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94372
  8. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  9. ---
  10. gcc/config/or1k/linux.h | 2 ++
  11. 1 file changed, 2 insertions(+)
  12. diff --git a/gcc/config/or1k/linux.h b/gcc/config/or1k/linux.h
  13. index 21cef067dda..2e1bb5601a9 100644
  14. --- a/gcc/config/or1k/linux.h
  15. +++ b/gcc/config/or1k/linux.h
  16. @@ -32,6 +32,8 @@
  17. #undef MUSL_DYNAMIC_LINKER
  18. #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-or1k.so.1"
  19. +#define CPP_SPEC "%{pthread:-D_REENTRANT}"
  20. +
  21. #undef LINK_SPEC
  22. #define LINK_SPEC "%{h*} \
  23. %{static:-Bstatic} \
  24. --
  25. 2.34.3