0003-gcc-define-_REENTRANT-for-OpenRISC-when-pthread-is-p.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 48ced46a5f81f49737ea13d11a099e03062cf141 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. Upstream: cac2f69cdad434ad5cb60f5fe931d45cd82ef476
  9. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  10. [Romain: add Upstream tag]
  11. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  12. ---
  13. gcc/config/or1k/linux.h | 2 ++
  14. 1 file changed, 2 insertions(+)
  15. diff --git a/gcc/config/or1k/linux.h b/gcc/config/or1k/linux.h
  16. index 196f3f3c8f0..0cbdc934af1 100644
  17. --- a/gcc/config/or1k/linux.h
  18. +++ b/gcc/config/or1k/linux.h
  19. @@ -32,6 +32,8 @@
  20. #undef MUSL_DYNAMIC_LINKER
  21. #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-or1k.so.1"
  22. +#define CPP_SPEC "%{pthread:-D_REENTRANT}"
  23. +
  24. #undef LINK_SPEC
  25. #define LINK_SPEC "%{h*} \
  26. %{static:-Bstatic} \
  27. --
  28. 2.34.3