You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

  1. Add a patch from the Alpine Linux project to fix a musl build issue with gcc 5:
  2. Problem has been reported upstream and closed with WONTFIX:
  3. http://bugs.musicpd.org/view.php?id=4387
  4. http://bugs.musicpd.org/view.php?id=4110
  5. however...
  6. POSIX does not permit using PTHREAD_COND_INITIALIZER except for static
  7. initialization, and certainly does not permit using it as a value
  8. POSIX does not specify the type of the object (it's opaque) so if
  9. there are any types for which their code would be invalid C++, then their
  10. code is invalid
  11. Volatile in the type is necessary. without that, LTO can break the code.
  12. --- a/src/notify.hxx
  13. +++ b/src/notify.hxx
  14. @@ -28,7 +28,7 @@ struct notify {
  15. Cond cond;
  16. bool pending;
  17. -#if !defined(WIN32) && !defined(__NetBSD__) && !defined(__BIONIC__)
  18. +#if defined(__GLIBC__)
  19. constexpr
  20. #endif
  21. notify():pending(false) {}
  22. --- a/src/thread/PosixCond.hxx
  23. +++ b/src/thread/PosixCond.hxx
  24. @@ -41,7 +41,7 @@ class PosixCond {
  25. pthread_cond_t cond;
  26. public:
  27. -#if defined(__NetBSD__) || defined(__BIONIC__)
  28. +#if !defined(__GLIBC__)
  29. /* NetBSD's PTHREAD_COND_INITIALIZER is not compatible with
  30. "constexpr" */
  31. PosixCond() {
  32. --- a/src/thread/PosixMutex.hxx
  33. +++ b/src/thread/PosixMutex.hxx
  34. @@ -41,7 +41,7 @@ class PosixMutex {
  35. pthread_mutex_t mutex;
  36. public:
  37. -#if defined(__NetBSD__) || defined(__BIONIC__)
  38. +#if !defined(__GLIBC__)
  39. /* NetBSD's PTHREAD_MUTEX_INITIALIZER is not compatible with
  40. "constexpr" */
  41. PosixMutex() {