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 | 1 - tools/testing/selftests/arm64/morello/freestanding.h | 4 ++++ 2 files 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..53e9fb236e55 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"
diff --git a/tools/testing/selftests/arm64/morello/freestanding.h b/tools/testing/selftests/arm64/morello/freestanding.h index 3575146ef732..19611b315de9 100644 --- a/tools/testing/selftests/arm64/morello/freestanding.h +++ b/tools/testing/selftests/arm64/morello/freestanding.h @@ -25,6 +25,10 @@ typedef __kernel_mode_t mode_t; typedef __uintcap_t uintcap_t; #endif
+#ifndef INT_MAX +#define INT_MAX __INT_MAX__ +#endif + #define EXIT_SUCCESS 0
struct __test_meta {