0002-musl-gcc5-fixes.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. musl gcc5 fixes
  2. Fetch from:
  3. http://git.alpinelinux.org/cgit/aports/plain/main/mpd/musl-gcc5-fixes.patch
  4. Problem has been reported upstream and closed with WONTFIX:
  5. http://bugs.musicpd.org/view.php?id=4387
  6. http://bugs.musicpd.org/view.php?id=4110
  7. however...
  8. POSIX does not permit using PTHREAD_COND_INITIALIZER except for static
  9. initialization, and certainly does not permit using it as a value
  10. also POSIX does not specify the type of the object (it's opaque) so if
  11. there are any types for which their code would be invalid C++, then their
  12. code is invalid
  13. also, volatile in the type is necessary. without that, LTO can break the code.
  14. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  15. --- ./src/notify.hxx.orig
  16. +++ ./src/notify.hxx
  17. @@ -28,7 +28,7 @@
  18. Cond cond;
  19. bool pending;
  20. -#if !defined(WIN32) && !defined(__NetBSD__) && !defined(__BIONIC__)
  21. +#if defined(__GLIBC__)
  22. constexpr
  23. #endif
  24. notify():pending(false) {}
  25. --- ./src/thread/PosixCond.hxx.orig
  26. +++ ./src/thread/PosixCond.hxx
  27. @@ -41,7 +41,7 @@
  28. pthread_cond_t cond;
  29. public:
  30. -#if defined(__NetBSD__) || defined(__BIONIC__)
  31. +#if !defined(__GLIBC__)
  32. /* NetBSD's PTHREAD_COND_INITIALIZER is not compatible with
  33. "constexpr" */
  34. PosixCond() {
  35. --- ./src/thread/PosixMutex.hxx.orig
  36. +++ ./src/thread/PosixMutex.hxx
  37. @@ -41,7 +41,7 @@
  38. pthread_mutex_t mutex;
  39. public:
  40. -#if defined(__NetBSD__) || defined(__BIONIC__)
  41. +#if !defined(__GLIBC__)
  42. /* NetBSD's PTHREAD_MUTEX_INITIALIZER is not compatible with
  43. "constexpr" */
  44. PosixMutex() {