tests/tcg: move some multiarch files and make conditional
We had some messy code to filter out stuff we can't build. Lets junk that and simplify the logic by pushing some stuff into subdirs. In particular we move: float_helpers into libs - not a standalone test linux-test into linux - so we only build on Linux hosts This allows for at least some of the tests to be nominally usable by *BSD user builds. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Warner Losh <imp@bsdimp.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-Id: <20210917162332.3511179-4-alex.bennee@linaro.org>
This commit is contained in:
parent
4f0ebed418
commit
5343a837cd
@ -9,17 +9,22 @@ MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
|
||||
|
||||
# Set search path for all sources
|
||||
VPATH += $(MULTIARCH_SRC)
|
||||
MULTIARCH_SRCS =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
|
||||
MULTIARCH_TESTS =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=))
|
||||
MULTIARCH_SRCS = $(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
|
||||
ifneq ($(CONFIG_LINUX),)
|
||||
VPATH += $(MULTIARCH_SRC)/linux
|
||||
MULTIARCH_SRCS += $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c))
|
||||
endif
|
||||
MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=)
|
||||
|
||||
$(info SRCS=${MULTIARCH_SRCS} and ${MULTIARCH_TESTS})
|
||||
#
|
||||
# The following are any additional rules needed to build things
|
||||
#
|
||||
|
||||
|
||||
float_%: LDFLAGS+=-lm
|
||||
float_%: float_%.c float_helpers.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/float_helpers.c -o $@ $(LDFLAGS)
|
||||
float_%: float_%.c libs/float_helpers.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/libs/float_helpers.c -o $@ $(LDFLAGS)
|
||||
|
||||
run-float_%: float_%
|
||||
$(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<,"$< on $(TARGET_NAME)")
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <float.h>
|
||||
#include <fenv.h>
|
||||
|
||||
#include "float_helpers.h"
|
||||
#include "../float_helpers.h"
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
@ -8,8 +8,12 @@
|
||||
|
||||
include $(SRC_PATH)/tests/tcg/i386/Makefile.target
|
||||
|
||||
ifneq ($(CONFIG_LINUX),)
|
||||
X86_64_TESTS += vsyscall
|
||||
TESTS=$(MULTIARCH_TESTS) $(X86_64_TESTS) test-x86_64
|
||||
else
|
||||
TESTS=$(MULTIARCH_TESTS)
|
||||
endif
|
||||
QEMU_OPTS += -cpu max
|
||||
|
||||
test-x86_64: LDFLAGS+=-lm -lc
|
||||
|
Loading…
Reference in New Issue
Block a user