diff --git a/srcpkgs/scanmem/patches/fix-musl.patch b/srcpkgs/scanmem/patches/fix-musl.patch
new file mode 100644
index 0000000000..bc109407b8
--- /dev/null
+++ b/srcpkgs/scanmem/patches/fix-musl.patch
@@ -0,0 +1,28 @@
+diff --git a/scanroutines.c b/scanroutines.c
+index 2c5f33a..edc7c29 100644
+--- scanroutines.c
++++ scanroutines.c
+@@ -20,6 +20,8 @@
+ along with this library. If not, see .
+ */
+
++#define _GNU_SOURCE 1
++#include
+ #include
+ #include
+
+diff --git a/targetmem.h b/targetmem.h
+index b62a4f2..25b5c9c 100644
+--- targetmem.h
++++ targetmem.h
+@@ -24,6 +24,9 @@
+ #ifndef TARGETMEM_H
+ #define TARGETMEM_H
+
++#define _GNU_SOURCE 1
++#include
++
+ #include
+ #include
+ #include
+
diff --git a/srcpkgs/scanmem/template b/srcpkgs/scanmem/template
index 101562abfd..736019b19c 100644
--- a/srcpkgs/scanmem/template
+++ b/srcpkgs/scanmem/template
@@ -15,12 +15,6 @@ distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
checksum=f02054b91322cf41517506158fcb74554e9fc6644e696f8aa25e5acf162d374b
CFLAGS="-D__NEED_pid_t"
-case "$XBPS_TARGET_MACHINE" in
- *-musl)
- broken="yes"
- ;;
-esac
-
pre_configure() {
NOCONFIGURE=1 ./autogen.sh
}