|
From: Paul F. <pa...@so...> - 2023-03-31 11:40:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=81e51f9469ad6b1936e313376a87085a8a094d40 commit 81e51f9469ad6b1936e313376a87085a8a094d40 Author: Paul Floyd <pj...@wa...> Date: Fri Mar 31 13:39:34 2023 +0200 MUSL regtest: fix a comple of build problems building regression tests on Alpine Diff: --- 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 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 <stdio.h> /* 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 <assert.h> #include <string.h> #include <sys/syscall.h> -#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 <linux/stat.h> -#endif +#endif /* HAVE_STRUCT_STATX_IN_SYS_STAT_H */ +#endif /* MUSL_LIBC */ #include <errno.h> int check_stat2; |