From c13c73f1ae93c4d33458fa050953d6675f4e269d Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 3 Apr 2020 13:46:36 +1100 Subject: [PATCH] tests: Adjust header inclusions and Makefile.test This fixes the decrementer, illegal and sc tests to compile successfully with cross-compilers that don't provide unistd.h or string.h. Instead of those headers we include stddef.h. This also fixes tests/Makefile.test to do what one expects when CROSS_COMPILE is defined in the environment. Signed-off-by: Paul Mackerras --- tests/Makefile.test | 2 +- tests/decrementer/decrementer.c | 3 +-- tests/illegal/illegal.c | 3 +-- tests/sc/sc.c | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/Makefile.test b/tests/Makefile.test index a043810..9676370 100644 --- a/tests/Makefile.test +++ b/tests/Makefile.test @@ -1,7 +1,7 @@ ARCH = $(shell uname -m) ifneq ("$(ARCH)", "ppc64") ifneq ("$(ARCH)", "ppc64le") - CROSS_COMPILE = powerpc64le-linux- + CROSS_COMPILE ?= powerpc64le-linux- endif endif diff --git a/tests/decrementer/decrementer.c b/tests/decrementer/decrementer.c index 36ac922..2617a94 100644 --- a/tests/decrementer/decrementer.c +++ b/tests/decrementer/decrementer.c @@ -1,5 +1,4 @@ -#include -#include +#include #include #include diff --git a/tests/illegal/illegal.c b/tests/illegal/illegal.c index 0778ffe..a1ea325 100644 --- a/tests/illegal/illegal.c +++ b/tests/illegal/illegal.c @@ -1,5 +1,4 @@ -#include -#include +#include #include #include diff --git a/tests/sc/sc.c b/tests/sc/sc.c index 67d80b9..2914291 100644 --- a/tests/sc/sc.c +++ b/tests/sc/sc.c @@ -1,5 +1,4 @@ -#include -#include +#include #include #include