Unlike Clang, Gcc toolchain does not keep limits.h in the system include path obtained with -print-file-name=include option.
As the kselftests does not use libc at the moment so avoid using limits.h. But this causes clone.c to complain about missing INT_MAX so define INT_MAX if not defined.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@arm.com --- tools/testing/selftests/arm64/morello/clone.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/morello/clone.c b/tools/testing/selftests/arm64/morello/clone.c index a405b0fd0e4a..d42a8b5a0eb5 100644 --- a/tools/testing/selftests/arm64/morello/clone.c +++ b/tools/testing/selftests/arm64/morello/clone.c @@ -9,7 +9,6 @@ #include <linux/errno.h> #include <linux/signal.h> #include <linux/types.h> -#include <limits.h> #include <cheriintrin.h> #include "signal_common.h"
@@ -36,6 +35,10 @@ #define CLONE_TH_TLS BIT(2) #define CLONE_TH_RUSAGE BIT(3)
+#ifndef INT_MAX +#define INT_MAX ((int)(~0U >> 1)) +#endif + struct test_fixture { int status; int flags;