mpd: request stack size on newer musl systems

since 1.1.21 musl supports reading the minimal stack size from the
PT_GNU_STACK elf header[1].

[1] https://git.musl-libc.org/cgit/musl/commit/?id=7b3348a98c139b4b4238384e52d4b0eb237e4833
This commit is contained in:
Enno Boland 2019-01-29 07:25:01 +01:00 committed by maxice8
parent bda6b4e1d7
commit f5fcea3aba
2 changed files with 2 additions and 18 deletions

View File

@ -1,17 +0,0 @@
--- src/thread/Thread.cxx 2018-02-03 20:15:41.896969703 +0100
+++ src/thread/Thread.cxx 2018-02-03 20:17:12.640990964 +0100
@@ -35,8 +35,12 @@
if (handle == nullptr)
throw MakeLastError("Failed to create thread");
#else
- int e = pthread_create(&handle, nullptr, ThreadProc, this);
-
+ pthread_attr_t attr, *attrptr = nullptr;
+ if ((pthread_attr_init(&attr) == 0)
+ && (pthread_attr_setstacksize(&attr, 1024*1024) == 0)) {
+ attrptr = &attr;
+ }
+ int e = pthread_create(&handle, attrptr, ThreadProc, this);
if (e != 0)
throw MakeErrno(e, "Failed to create thread");
#endif

View File

@ -1,7 +1,7 @@
# Template file for 'mpd' # Template file for 'mpd'
pkgname=mpd pkgname=mpd
version=0.21.4 version=0.21.4
revision=2 revision=3
build_style=meson build_style=meson
configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true configure_args="-Dopus=enabled -Dmikmod=enabled -Dneighbor=true
-Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled -Dsoundcloud=enabled -Dpipe=true -Dtwolame=enabled -Dbzip2=enabled
@ -34,6 +34,7 @@ homepage="https://www.musicpd.org/"
changelog="https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/v${version}/NEWS" changelog="https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/v${version}/NEWS"
distfiles="https://www.musicpd.org/download/mpd/${version%.*}/mpd-${version}.tar.xz" distfiles="https://www.musicpd.org/download/mpd/${version%.*}/mpd-${version}.tar.xz"
checksum=247112eabf1b818a4052db7f0f5917ab00831ebc60a1ec3bf1154da4dc16a5c7 checksum=247112eabf1b818a4052db7f0f5917ab00831ebc60a1ec3bf1154da4dc16a5c7
LDFLAGS+=" -Wl,-z,stack-size=1048576"
system_accounts="mpd" system_accounts="mpd"
mpd_homedir="/var/lib/mpd" mpd_homedir="/var/lib/mpd"