tests: Adjust header inclusions and Makefile.test
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 3 Apr 2020 02:46:36 +0000 (13:46 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 3 Apr 2020 02:46:36 +0000 (13:46 +1100)
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 <paulus@ozlabs.org>
tests/Makefile.test
tests/decrementer/decrementer.c
tests/illegal/illegal.c
tests/sc/sc.c

index a043810c0b2668c2f272239b58bf5c300bece2fb..96763700906ea2224dbdd9e4f47c582d9070c278 100644 (file)
@@ -1,7 +1,7 @@
 ARCH = $(shell uname -m)
 ifneq ("$(ARCH)", "ppc64")
 ifneq ("$(ARCH)", "ppc64le")
-        CROSS_COMPILE = powerpc64le-linux-
+        CROSS_COMPILE ?= powerpc64le-linux-
         endif
         endif
 
index 36ac922e750c1658df72bd2936136e9dc97c6cbe..2617a9462f2ea2113377daca6acfe9d74898a437 100644 (file)
@@ -1,5 +1,4 @@
-#include <unistd.h>
-#include <string.h>
+#include <stddef.h>
 #include <stdint.h>
 #include <stdbool.h>
 
index 0778ffeec3bf1995f28a3444b79e88b4a24c695f..a1ea3255d211da01f7bbb2c82d72618f023aa57b 100644 (file)
@@ -1,5 +1,4 @@
-#include <unistd.h>
-#include <string.h>
+#include <stddef.h>
 #include <stdint.h>
 #include <stdbool.h>
 
index 67d80b966b7df4d82fd453e00fd91bc886063a15..2914291e78fb6eacc261d17a6562be7d47537c72 100644 (file)
@@ -1,5 +1,4 @@
-#include <unistd.h>
-#include <string.h>
+#include <stddef.h>
 #include <stdint.h>
 #include <stdbool.h>