Created attachment 886835 [details] build.log [...] make -j1 PKG_CONFIG=x86_64-gentoo-linux-musl-pkg-config CC=clang CWFLAGS=-Wall 'CXFLAGS=-Os -march=x86-64-v2 -pipe' UDEVDIR=/lib/udev SYSTEMD_DIR=/lib/systemd/system COROSYNC=-DNO_COROSYNC DLM=-DNO_DLM STRIP= all clang -Wall -Os -march=x86-64-v2 -pipe -DSendmail=\""/usr/sbin/sendmail -t"\" -DCONFFILE=\"/etc/mdadm.conf\" -DCONFFILE2=\"/etc/mdadm/mdadm.conf\" -DMAP_DIR=\"/run/mdadm\" -DMAP_FILE=\"map\" -DMDMON_DIR=\"/run/mdadm\" -DFAILED_SLOTS_DIR=\"/run/mdadm/failed-slots\" -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS -D_LARGEFILE64_SOURCE -DBINDIR=\"/sbin\" -o mdadm.o -c mdadm.c mdadm.c:1363:18: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1363 | char *bname = basename(devlist->devname); | ^ mdadm.c:1363:10: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion] 1363 | char *bname = basename(devlist->devname); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. make: *** [Makefile:193: mdadm.o] Error 1
Created attachment 886836 [details] emerge --info
cannot reproduce
You need musl-1.2.5.
util.c: In function 'get_md_name': util.c:1031:29: error: 'NAME_MAX' undeclared (first use in this function); did you mean 'MD_NAME_MAX'? 1031 | static char devname[NAME_MAX]; | ^~~~~~~~ | MD_NAME_MAX util.c:1031:29: note: each undeclared identifier is reported only once for each function it appears in util.c:1031:21: warning: unused variable 'devname' [-Wunused-variable] 1031 | static char devname[NAME_MAX]; | ^~~~~~~
I don't see how it can't be..
Created attachment 900110 [details, diff] musl_basename.patch Upstream patch: https://github.com/md-raid-utilities/mdadm/commit/9dbd11e091f84eb0bf9d717283774816c4c4453d Solves the 'basename' build issue on mdadm-4.2-r3 and mdadm-4.3 on musl-1.2.5-r1. This build issue still remains for mdadm-4.3 on musl-1.2.5-r1: [...] clang -Wall -Os -march=x86-64-v2 -pipe -DSendmail=\""/usr/sbin/sendmail -t"\" -DCONFFILE=\"/etc/mdadm.conf\" -DCONFFILE2=\"/etc/mdadm/mdadm.conf\" -DMAP_DIR=\"/run/mdadm\" -DMAP_FILE=\"map\" -DMDMON_DIR=\"/run/mdadm\" -DFAILED_SLOTS_DIR=\"/run/mdadm/failed-slots\" -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS -D_LARGEFILE64_SOURCE -DBINDIR=\"/sbin\" -o util.o -c util.c util.c:1031:22: error: use of undeclared identifier 'NAME_MAX' 1031 | static char devname[NAME_MAX]; | ^ 1 error generated. make: *** [Makefile:211: util.o] Error 1 * ERROR: sys-fs/mdadm-4.3::gentoo failed (compile phase):
Created attachment 900149 [details, diff] musl_limits.patch Upstream patch: https://github.com/md-raid-utilities/mdadm/commit/8bda86099089b44129ef6206764f9de47a45f0db Solves the 'error: use of undeclared identifier 'NAME_MAX'' build issue on mdadm-4.3 on musl-1.2.5-r1. With both patches applied mdadm-4.3 builds fine on musl-1.2.5-r1.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2637faef70821b8cfa25cd5ca4d340fa3ddf70bd commit 2637faef70821b8cfa25cd5ca4d340fa3ddf70bd Author: Sam James <sam@gentoo.org> AuthorDate: 2025-02-13 11:58:30 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-02-13 11:58:30 +0000 sys-fs/mdadm: backport musl build fixes to 4.3-r1 Closes: https://bugs.gentoo.org/926289 Thanks-to: ernsteiswuerfel <erhard_f@mailbox.org> Signed-off-by: Sam James <sam@gentoo.org> sys-fs/mdadm/files/mdadm-4.3-musl-basename.patch | 19 +++++++++++++++++++ sys-fs/mdadm/files/mdadm-4.3-musl-include.patch | 14 ++++++++++++++ sys-fs/mdadm/mdadm-4.3-r1.ebuild | 2 ++ 3 files changed, 35 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3a618d336bbf468e0a58fe7cfd5339fdceabe4a commit f3a618d336bbf468e0a58fe7cfd5339fdceabe4a Author: Sam James <sam@gentoo.org> AuthorDate: 2025-02-13 11:55:40 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-02-13 11:56:13 +0000 sys-fs/mdadm: add 4.4 Note that this drops mdadm_env.sh as was done upstream in a7a5e676a7eb2ac97acd31b13f75515e9573f891, it's not like it was working correctly anyway for systemd, and for OpenRC, the default config only had --syslog in there - yet for OpenRC, it'll continue working anyway as it wasn't using mdadm_env.sh to begin with. Bug: https://bugs.gentoo.org/926289 Closes: https://bugs.gentoo.org/948994 Signed-off-by: Sam James <sam@gentoo.org> sys-fs/mdadm/Manifest | 2 + sys-fs/mdadm/mdadm-4.4.ebuild | 122 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+)