aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2024-05-09 19:26:12 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2024-05-09 19:26:12 +0200
commit35ee7e31648f52308727519dfcf9142aae6f3363 (patch)
tree5a8767fbf6e0e32c1c3c2b31e2a49bf1f4ecaf7b
parentc910777a9576acf4ca341296ecd97b5db8994b53 (diff)
community/ezstream: fix segfault caused by implicit function declarationHEADmaster
Since musl 1.2.5, musl no longer provides a basename(3) prototype in string.h. Instead, in accordance with POSIX, musl requires libgen.h to be included for the basename function prototype. Unfortunately, ezstream does not include libgen.h on Linux (probably because they incorrectly assume it to be declared by string.h already). This causes a -Wimplicit-function-declaration warning and this warning is by no means cosmetic as implicit function declaration can affect code generation and actually do affect it in this case. In this case, this causes a segfault in the ezstream test suite. Fixing the implicit function declaration also fixes the segfault. See also: https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
-rw-r--r--community/ezstream/0001-Unconditionally-include-libgen.h-for-basename-3-func.patch62
-rw-r--r--community/ezstream/APKBUILD10
2 files changed, 69 insertions, 3 deletions
diff --git a/community/ezstream/0001-Unconditionally-include-libgen.h-for-basename-3-func.patch b/community/ezstream/0001-Unconditionally-include-libgen.h-for-basename-3-func.patch
new file mode 100644
index 00000000000..159bb422eba
--- /dev/null
+++ b/community/ezstream/0001-Unconditionally-include-libgen.h-for-basename-3-func.patch
@@ -0,0 +1,62 @@
+From f3523a90684838eb8953bc9acf4a3f6ca4a3db00 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Thu, 9 May 2024 18:17:45 +0200
+Subject: [PATCH] Unconditionally include libgen.h for basename(3) function
+ prototype
+
+Since musl 1.2.5, musl no longer defines basename.h in string.h. This
+is in accordance with POSIX, hence libgen.h must be included by ezstream
+in order to use basename(3).
+
+See: https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+---
+ src/ezstream-cfgmigrate.c | 4 +---
+ src/ezstream.h | 4 +---
+ src/mdata.c | 4 +---
+ 3 files changed, 3 insertions(+), 9 deletions(-)
+
+diff --git a/src/ezstream-cfgmigrate.c b/src/ezstream-cfgmigrate.c
+index 0a3b4ff..28d5bf8 100644
+--- a/src/ezstream-cfgmigrate.c
++++ b/src/ezstream-cfgmigrate.c
+@@ -20,9 +20,7 @@
+
+ #include "compat.h"
+
+-#if defined(HAVE_LIBGEN_H) && !defined(__linux__)
+-# include <libgen.h>
+-#endif /* HAVE_LIBGEN_H && !__linux__ */
++#include <libgen.h>
+ #include <limits.h>
+ #include <stdio.h>
+ #include <string.h>
+diff --git a/src/ezstream.h b/src/ezstream.h
+index 1867386..a4945d0 100644
+--- a/src/ezstream.h
++++ b/src/ezstream.h
+@@ -32,9 +32,7 @@
+ #include <ctype.h>
+ #include <errno.h>
+ #include <fcntl.h>
+-#if defined(HAVE_LIBGEN_H) && !defined(__linux__)
+-# include <libgen.h>
+-#endif /* HAVE_LIBGEN_H && !__linux__ */
++#include <libgen.h>
+ #include <limits.h>
+ #ifdef HAVE_PATHS_H
+ # include <paths.h>
+diff --git a/src/mdata.c b/src/mdata.c
+index bd9c333..2d69b15 100644
+--- a/src/mdata.c
++++ b/src/mdata.c
+@@ -24,9 +24,7 @@
+ #include <sys/wait.h>
+
+ #include <errno.h>
+-#if defined(HAVE_LIBGEN_H) && !defined(__linux__)
+-# include <libgen.h>
+-#endif /* HAVE_LIBGEN_H && !__linux__ */
++#include <libgen.h>
+ #include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/community/ezstream/APKBUILD b/community/ezstream/APKBUILD
index 4d37a71d321..d04acb1c0fa 100644
--- a/community/ezstream/APKBUILD
+++ b/community/ezstream/APKBUILD
@@ -2,14 +2,15 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=ezstream
pkgver=1.0.2
-pkgrel=3
+pkgrel=4
pkgdesc="Ezstream is a command line source client for Icecast media streaming servers"
url="https://icecast.org/ezstream/"
arch="all"
license="GPL-2.0"
makedepends="libshout-dev libxml2-dev libvorbis-dev check-dev taglib-dev bsd-compat-headers"
subpackages="$pkgname-doc"
-source="https://downloads.xiph.org/releases/ezstream/ezstream-$pkgver.tar.gz"
+source="https://downloads.xiph.org/releases/ezstream/ezstream-$pkgver.tar.gz
+ 0001-Unconditionally-include-libgen.h-for-basename-3-func.patch"
build() {
./configure \
@@ -25,4 +26,7 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="54a11b6db9fd15259bbd3cfff11d95100b4c334e19a58a39b8b98f97300c57fbcaa19dabc751d93158ec3f7eb7a7101178c99d9eba193e49b7917ed5731aa48d ezstream-1.0.2.tar.gz"
+sha512sums="
+54a11b6db9fd15259bbd3cfff11d95100b4c334e19a58a39b8b98f97300c57fbcaa19dabc751d93158ec3f7eb7a7101178c99d9eba193e49b7917ed5731aa48d ezstream-1.0.2.tar.gz
+f0654b9634dd28657792a5b81e18ee5afe4d7d06e41fac1f8f6ca9b863a31bc387308b8211af99eee5bace12ce2da5c2b460fdcdeaae5413b79a958b9b12ab87 0001-Unconditionally-include-libgen.h-for-basename-3-func.patch
+"