From: https://github.com/void-linux/void-packages/tree/7bfdb7ab051fbb43309c764ed4613d39ee590679/srcpkgs/lshw/patches/

For musl libc declare a macro version of basename(3).

--- a/src/core/dasd.cc
+++ b/src/core/dasd.cc
@@ -10,6 +10,10 @@
 #include <linux/fs.h>
 #include <map>
 
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
 using namespace std;
 
 /*Read only block devices, not partitions*/
--- a/src/core/sysfs.cc
+++ b/src/core/sysfs.cc
@@ -19,6 +19,10 @@
 
 __ID("@(#) $Id$");
 
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
 using namespace sysfs;
 
 struct sysfs::entry_i
