From: Paul Floyd Date: Fri, 31 Mar 2023 11:39:34 +0000 (+0200) Subject: MUSL regtest: fix a comple of build problems building regression tests on Alpine X-Git-Tag: VALGRIND_3_21_0~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81e51f9469ad6b1936e313376a87085a8a094d40;p=thirdparty%2Fvalgrind.git MUSL regtest: fix a comple of build problems building regression tests on Alpine --- diff --git a/memcheck/tests/linux/capget.c b/memcheck/tests/linux/capget.c index ce9b18b0b0..4ebf2f4aef 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 fcbc2e0de7..3cbbd34049 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;