From 81e51f9469ad6b1936e313376a87085a8a094d40 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Fri, 31 Mar 2023 13:39:34 +0200 Subject: [PATCH] MUSL regtest: fix a comple of build problems building regression tests on Alpine --- memcheck/tests/linux/capget.c | 6 ++++-- memcheck/tests/linux/sys-statx.c | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/memcheck/tests/linux/capget.c b/memcheck/tests/linux/capget.c index ce9b18b0b..4ebf2f4ae 100644 --- a/memcheck/tests/linux/capget.c +++ b/memcheck/tests/linux/capget.c @@ -1,4 +1,6 @@ -#if defined(linux) +#include "../../../config.h" + +#if defined(linux) && !defined(MUSL_LIBC) #include /* printf() */ @@ -45,7 +47,7 @@ int main() int main() { - fprintf(stderr, "This program is Linux-specific\n"); + fprintf(stderr, "This program is Linux with GNU libc specific\n"); return 0; } diff --git a/memcheck/tests/linux/sys-statx.c b/memcheck/tests/linux/sys-statx.c index fcbc2e0de..3cbbd3404 100644 --- a/memcheck/tests/linux/sys-statx.c +++ b/memcheck/tests/linux/sys-statx.c @@ -8,9 +8,14 @@ #include #include #include -#ifndef HAVE_STRUCT_STATX_IN_SYS_STAT_H +#if defined(MUSL_LIBC) +/* musl has __NR_statx but not the structs that it needs */ +#undef __NR_statx +#else +#if !defined(HAVE_STRUCT_STATX_IN_SYS_STAT_H) #include -#endif +#endif /* HAVE_STRUCT_STATX_IN_SYS_STAT_H */ +#endif /* MUSL_LIBC */ #include int check_stat2; -- 2.11.4.GIT