commit 1dd20c4c9f5bd457787c3a10d0c06c4de16ce25f
Author: Leigh Scott <leigh123linux(a)googlemail.com>
Date: Wed Apr 3 16:21:00 2019 +0100
Add upstream commit to fix gcc-9 build issue
gcc-9_buildfix.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
mpd.spec | 5 +++++
2 files changed, 55 insertions(+)
---
diff --git a/gcc-9_buildfix.patch b/gcc-9_buildfix.patch
new file mode 100644
index 0000000..97ecc81
--- /dev/null
+++ b/gcc-9_buildfix.patch
@@ -0,0 +1,50 @@
+From 37b54179d882fef38ca6735b53e322027414b62e Mon Sep 17 00:00:00 2001
+From: Max Kellermann <max(a)musicpd.org>
+Date: Wed, 3 Apr 2019 16:59:53 +0200
+Subject: [PATCH] net/IPv[46]Address: add cast to void* to fix GCC9 build
+ failure
+
+Fixes:
+
+ src/net/IPv4Address.hxx: In member function 'constexpr IPv4Address::operator
SocketAddress() const':
+ src/net/IPv4Address.hxx:171:24: error: a reinterpret_cast is not a constant expression
+ 171 | return SocketAddress((const struct sockaddr *)&address,
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ src/net/IPv6Address.hxx: In member function 'constexpr IPv6Address::operator
SocketAddress() const':
+ src/net/IPv6Address.hxx:138:24: error: a reinterpret_cast is not a constant expression
+ 138 | return SocketAddress((const struct sockaddr *)&address,
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Closes
https://github.com/MusicPlayerDaemon/MPD/issues/522
+---
+ src/net/IPv4Address.hxx | 2 +-
+ src/net/IPv6Address.hxx | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/net/IPv4Address.hxx b/src/net/IPv4Address.hxx
+index 7a39ed016..3af0210c3 100644
+--- a/src/net/IPv4Address.hxx
++++ b/src/net/IPv4Address.hxx
+@@ -168,7 +168,7 @@ public:
+ }
+
+ constexpr operator SocketAddress() const noexcept {
+- return SocketAddress((const struct sockaddr *)&address,
++ return SocketAddress((const struct sockaddr *)(const void *)&address,
+ sizeof(address));
+ }
+
+diff --git a/src/net/IPv6Address.hxx b/src/net/IPv6Address.hxx
+index e9531b3f7..eae9b60c1 100644
+--- a/src/net/IPv6Address.hxx
++++ b/src/net/IPv6Address.hxx
+@@ -135,7 +135,7 @@ public:
+ }
+
+ constexpr operator SocketAddress() const noexcept {
+- return SocketAddress((const struct sockaddr *)&address,
++ return SocketAddress((const struct sockaddr *)(const void *)&address,
+ sizeof(address));
+ }
+
diff --git a/mpd.spec b/mpd.spec
index f2d9081..a1674c0 100644
--- a/mpd.spec
+++ b/mpd.spec
@@ -33,6 +33,9 @@ Source3: mpd.tmpfiles.d
Source4: mpd.xml
Patch0: mpd-0.18-mpdconf.patch
Patch1: mpd-0.20-remove_NoNewPrivileges.patch
+#
https://github.com/MusicPlayerDaemon/MPD/issues/522
+#
https://github.com/MusicPlayerDaemon/MPD/commit/37b54179d882fef38ca6735b5...
+Patch2: gcc-9_buildfix.patch
BuildRequires: alsa-lib-devel
BuildRequires: audiofile-devel
@@ -119,6 +122,7 @@ This package contains FirewallD file for MPD.
%setup -q
%patch0 -p0
%patch1 -p1
+%patch2 -p1
# Force python3-sphinx
sed -i -e 's@sphinx-build@sphinx-build-3@g' doc/meson.build
@@ -226,6 +230,7 @@ fi
%changelog
* Wed Apr 03 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1:0.21.7-1
- Update to 0.21.7
+- Add upstream commit to fix gcc-9 build issue
* Mon Mar 18 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1:0.21.6-1
- Update to 0.21.6