From nobody Tue Oct 7 06:57:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551386516634604.9600514002934; Thu, 28 Feb 2019 12:41:56 -0800 (PST) Received: from localhost ([127.0.0.1]:46238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzSV7-0004EU-IS for importer@patchew.org; Thu, 28 Feb 2019 15:41:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzSKj-0004mW-0i for qemu-devel@nongnu.org; Thu, 28 Feb 2019 15:31:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzSKh-0002Fi-3M for qemu-devel@nongnu.org; Thu, 28 Feb 2019 15:31:08 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:35587) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzSKd-00027i-ER for qemu-devel@nongnu.org; Thu, 28 Feb 2019 15:31:05 -0500 Received: by mail-wr1-x441.google.com with SMTP id t18so23463963wrx.2 for ; Thu, 28 Feb 2019 12:31:03 -0800 (PST) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n189sm9744379wmb.28.2019.02.28.12.31.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 12:31:01 -0800 (PST) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 139691FF91; Thu, 28 Feb 2019 20:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tjLSIWJEgeVweWOD3dvO1il0QaXnyiXHZBI5XL4xPeE=; b=iwzz0PtNgoipvE/jx+KbXSTYYZWim1YS4eNGQOwMStLhB3mIx900kqpMOvm8Ns6jDU cqkcAT5s39rI2aA5O5WUOR3JuEwAEPePVQrdVtsa4gbkAl6OYY0tl2248CrzedK7DeoU 9aIEEMg0K0jFSas3hHZuFMXfpH5qm5PrBqpDNBvamR1xPq5/Lskf0eCjJ/AblCKD1TeP ce0capIo1VpYIYBQKZRgIKEnPJScpoahNsvWy+EgsV48qzSaGNc4/7HyTMB5tyoBrWck hIciT7ejDdK9pYmmqyb+jEqKXl/E438MFZy2gxev+rRub06ABKxwC4dT95rxGRn9YgEL Vr0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tjLSIWJEgeVweWOD3dvO1il0QaXnyiXHZBI5XL4xPeE=; b=p2HPed3XPLBE7SSZ8h6+Wg3YtAcesCLCUYEjmKjZGeKGUZHgvRUTvB9HuWuXBZw7y9 c+UQP4puccy7BzUDVDpwS3rhL1BWp7gF1eVxi6Tn7iSuyg4Iirr03XfmIxK31fALN4xH f/CrIwKEnaGTpMZnYcAEkdkDpliEcEp0hz55iZ6LymPGFp0Jgh7THmHS92SZ6nMhw/Ld a+FRD71eE2t/rqEVCxhKL3w/bAPh7Oae2fy4GmKyFPh1eSEcXungNbimHoPp4ZEDCMrt kEhGLd102kUSpbWImqVG2xQL3DulDXHHkeVHZSM9GcWlMrlExOk0ccH5B2j/le1jI5MD iLHA== X-Gm-Message-State: APjAAAUmZK8Itol9Fksa7iK9N00dTxI6qoXE5ZYrnlWRQCAY4gUOmpkp PyaHl+S8QrF3wgTBvztYCsD0yw== X-Google-Smtp-Source: APXvYqwRgM+5SVvQbj1ZJpWC5ZGTQgwtJwRgPTROHf8T239nszR2+OgcelBkU58eYj8W9vGw1dZV5Q== X-Received: by 2002:adf:ba84:: with SMTP id p4mr882316wrg.156.1551385861754; Thu, 28 Feb 2019 12:31:01 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 28 Feb 2019 20:25:35 +0000 Message-Id: <20190228202537.4638-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190228202537.4638-1-alex.bennee@linaro.org> References: <20190228202537.4638-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v2 14/16] tests/tcg: enable cris base user-mode tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , jcmvbkbc@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This converts the existing Makefile into a Makefile.target and updates it so it can be called by the tcg build system. The original Makefile didn't set -cpu except for the v17 tests however that has broken (I assume because linux-user is a "max" cpu) so here I force it to be crisv17. I've also replicated the GNU simulator targets (run-FOO-on-sim). Signed-off-by: Alex Benn=C3=A9e --- tests/docker/Makefile.include | 1 + tests/tcg/cris/Makefile | 168 -------------------------------- tests/tcg/cris/Makefile.include | 6 ++ tests/tcg/cris/Makefile.target | 58 +++++++++++ 4 files changed, 65 insertions(+), 168 deletions(-) delete mode 100644 tests/tcg/cris/Makefile create mode 100644 tests/tcg/cris/Makefile.include create mode 100644 tests/tcg/cris/Makefile.target diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 83d43c50e4..60314d293a 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -116,6 +116,7 @@ docker-image-tricore-cross: docker-image-debian9 DOCKER_PARTIAL_IMAGES +=3D debian-alpha-cross debian-hppa-cross debian-m68= k-cross debian-sh4-cross DOCKER_PARTIAL_IMAGES +=3D debian-sparc64-cross debian-mips64-cross debian= -riscv64-cross DOCKER_PARTIAL_IMAGES +=3D debian-tricore-cross debian-powerpc-cross fedor= a-i386-cross +DOCKER_PARTIAL_IMAGES +=3D fedora-cris-cross =20 # Rules for building linux-user powered images # diff --git a/tests/tcg/cris/Makefile b/tests/tcg/cris/Makefile deleted file mode 100644 index 664b30ce81..0000000000 --- a/tests/tcg/cris/Makefile +++ /dev/null @@ -1,168 +0,0 @@ --include ../../../config-host.mak - -CROSS=3Dcrisv32-axis-linux-gnu- -SIM=3D../../../cris-linux-user/qemu-cris -L ./ -SIMG=3Dcris-axis-linux-gnu-run --sysroot=3D./ - -CC =3D $(CROSS)gcc -#AS =3D $(CROSS)as -AS =3D $(CC) -x assembler-with-cpp -SIZE =3D $(CROSS)size -LD =3D $(CC) -OBJCOPY =3D $(CROSS)objcopy - -# we rely on GCC inline:ing the stuff we tell it to in many places here. -CFLAGS =3D -Winline -Wall -g -O2 -static -NOSTDFLAGS =3D -nostartfiles -nostdlib -ASFLAGS +=3D -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/ -LDLIBS =3D -NOSTDLIBS =3D -lgcc - -CRT =3D crt.o -SYS =3D sys.o -TESTCASES +=3D check_abs.tst -TESTCASES +=3D check_addc.tst -TESTCASES +=3D check_addcm.tst -TESTCASES +=3D check_addcv17.tst -TESTCASES +=3D check_addo.tst -TESTCASES +=3D check_addoq.tst -TESTCASES +=3D check_addi.tst -TESTCASES +=3D check_addiv32.tst -TESTCASES +=3D check_addm.tst -TESTCASES +=3D check_addr.tst -TESTCASES +=3D check_addq.tst -TESTCASES +=3D check_addxc.tst -TESTCASES +=3D check_addxm.tst -TESTCASES +=3D check_addxr.tst -TESTCASES +=3D check_andc.tst -TESTCASES +=3D check_andm.tst -TESTCASES +=3D check_andr.tst -TESTCASES +=3D check_andq.tst -TESTCASES +=3D check_asr.tst -TESTCASES +=3D check_ba.tst -TESTCASES +=3D check_bas.tst -TESTCASES +=3D check_bcc.tst -TESTCASES +=3D check_bound.tst -TESTCASES +=3D check_boundc.tst -TESTCASES +=3D check_boundr.tst -TESTCASES +=3D check_btst.tst -TESTCASES +=3D check_clearfv32.tst -TESTCASES +=3D check_cmpc.tst -TESTCASES +=3D check_cmpr.tst -TESTCASES +=3D check_cmpq.tst -TESTCASES +=3D check_cmpm.tst -TESTCASES +=3D check_cmpxc.tst -TESTCASES +=3D check_cmpxm.tst -TESTCASES +=3D check_cmp-2.tst -TESTCASES +=3D check_clrjmp1.tst -TESTCASES +=3D check_dstep.tst -TESTCASES +=3D check_ftag.tst -TESTCASES +=3D check_int64.tst -# check_jsr is broken. -#TESTCASES +=3D check_jsr.tst -TESTCASES +=3D check_mcp.tst -TESTCASES +=3D check_movei.tst -TESTCASES +=3D check_mover.tst -TESTCASES +=3D check_moverm.tst -TESTCASES +=3D check_moveq.tst -TESTCASES +=3D check_movemr.tst -TESTCASES +=3D check_movemrv32.tst -TESTCASES +=3D check_movecr.tst -TESTCASES +=3D check_movmp.tst -TESTCASES +=3D check_movpr.tst -TESTCASES +=3D check_movprv32.tst -TESTCASES +=3D check_movdelsr1.tst -TESTCASES +=3D check_movpmv32.tst -TESTCASES +=3D check_movsr.tst -TESTCASES +=3D check_movsm.tst -TESTCASES +=3D check_movscr.tst -TESTCASES +=3D check_movur.tst -TESTCASES +=3D check_movum.tst -TESTCASES +=3D check_movucr.tst -TESTCASES +=3D check_mulx.tst -TESTCASES +=3D check_mulv32.tst -TESTCASES +=3D check_neg.tst -TESTCASES +=3D check_not.tst -TESTCASES +=3D check_lz.tst -TESTCASES +=3D check_lapc.tst -TESTCASES +=3D check_lsl.tst -TESTCASES +=3D check_lsr.tst -TESTCASES +=3D check_orc.tst -TESTCASES +=3D check_orm.tst -TESTCASES +=3D check_orr.tst -TESTCASES +=3D check_orq.tst -TESTCASES +=3D check_ret.tst -TESTCASES +=3D check_swap.tst -TESTCASES +=3D check_scc.tst -TESTCASES +=3D check_subc.tst -TESTCASES +=3D check_subq.tst -TESTCASES +=3D check_subr.tst -TESTCASES +=3D check_subm.tst -TESTCASES +=3D check_glibc_kernelversion.tst -TESTCASES +=3D check_xarith.tst - -TESTCASES +=3D check_hello.ctst -TESTCASES +=3D check_stat1.ctst -TESTCASES +=3D check_stat2.ctst -TESTCASES +=3D check_stat3.ctst -TESTCASES +=3D check_stat4.ctst -TESTCASES +=3D check_openpf1.ctst -TESTCASES +=3D check_openpf2.ctst -TESTCASES +=3D check_openpf3.ctst -TESTCASES +=3D check_openpf5.ctst -TESTCASES +=3D check_mapbrk.ctst -TESTCASES +=3D check_mmap1.ctst -TESTCASES +=3D check_mmap2.ctst -TESTCASES +=3D check_mmap3.ctst -TESTCASES +=3D check_sigalrm.ctst -TESTCASES +=3D check_time2.ctst -TESTCASES +=3D check_settls1.ctst - -TESTCASES +=3D check_gcctorture_pr28634-1.ctst -#TESTCASES +=3D check_gcctorture_pr28634.ctst - -all: build - -%.o: $(SRC_PATH)/tests/tcg/cris/%.c - $(CC) $(CFLAGS) -c $< -o $@ - -%.o: $(SRC_PATH)/tests/tcg/cris/%.s - $(AS) $(ASFLAGS) -c $< -o $@ - -%.tst: %.o - $(CC) $(CFLAGS) $(NOSTDFLAGS) $(LDLIBS) $(NOSTDLIBS) $(CRT) $< $(SYS) -o = $@ - -%.ctst: %.o - $(CC) $(CFLAGS) $(LDLIBS) $< -o $@ - - -sysv10.o: sys.c - $(CC) $(CFLAGS) -mcpu=3Dv10 -c $< -o $@ - -crtv10.o: crt.s - $(AS) $(ASFLAGS) -mcpu=3Dv10 -c $< -o $@ - -check_addcv17.tst: ASFLAGS +=3D -mcpu=3Dv10 -check_addcv17.tst: CRT :=3D crtv10.o -check_addcv17.tst: SYS :=3D sysv10.o -check_addcv17.tst: crtv10.o sysv10.o - -build: $(CRT) $(SYS) $(TESTCASES) - -check: $(CRT) $(SYS) $(TESTCASES) - @printf "\nQEMU simulator.\n" - for case in $(TESTCASES); do \ - printf %s "$$case "; \ - SIMARGS=3D; \ - case $$case in *v17*) SIMARGS=3D"-cpu crisv17";; esac; \ - $(SIM) $$SIMARGS ./$$case; \ - done -check-g: $(CRT) $(SYS) $(TESTCASES) - @printf "\nGDB simulator.\n" - @for case in $(TESTCASES); do \ - printf %s "$$case "; \ - $(SIMG) $$case; \ - done - -clean: - $(RM) -fr $(TESTCASES) *.o diff --git a/tests/tcg/cris/Makefile.include b/tests/tcg/cris/Makefile.incl= ude new file mode 100644 index 0000000000..1c037824bf --- /dev/null +++ b/tests/tcg/cris/Makefile.include @@ -0,0 +1,6 @@ +# +# Makefile.include for all CRIS targets +# + +DOCKER_IMAGE=3Dfedora-cris-cross +DOCKER_CROSS_COMPILER=3Dcris-linux-gnu-gcc diff --git a/tests/tcg/cris/Makefile.target b/tests/tcg/cris/Makefile.target new file mode 100644 index 0000000000..c1173ead42 --- /dev/null +++ b/tests/tcg/cris/Makefile.target @@ -0,0 +1,58 @@ +# -*- Mode: makefile -*- +# +# Cris tests +# +# Currently we can only build the "bare" tests with the docker +# supplied cross-compiler. +# + +CRIS_SRC =3D $(SRC_PATH)/tests/tcg/cris/bare +CRIS_ALL =3D $(wildcard $(CRIS_SRC)/*.s) +CRIS_TESTS =3D $(patsubst $(CRIS_SRC)/%.s, %, $(CRIS_ALL)) +# Filter out common blobs and broken tests +CRIS_BROKEN_TESTS =3D crt check_jsr +# upstream GCC doesn't support v32 +CRIS_BROKEN_TESTS +=3D check_mcp check_mulv32 check_addiv32 check_movpmv32 +CRIS_BROKEN_TESTS +=3D check_movprv32 check_clearfv32 check_movemrv32 chec= k_bas +CRIS_BROKEN_TESTS +=3D check_lapc check_movei +# no sure why +CRIS_BROKEN_TESTS +=3D check_scc check_xarith + +CRIS_USABLE_TESTS =3D $(filter-out $(CRIS_BROKEN_TESTS), $(CRIS_TESTS)) +CRIS_RUNS =3D $(patsubst %, run-%, $(CRIS_USABLE_TESTS)) + +# override the list of tests, as we can't build the multiarch tests +TESTS =3D $(CRIS_USABLE_TESTS) +VPATH =3D $(CRIS_SRC) + +AS =3D $(CC) -x assembler-with-cpp +LD =3D $(CC) + +# we rely on GCC inline:ing the stuff we tell it to in many places here. +CFLAGS =3D -Winline -Wall -g -O2 -static +NOSTDFLAGS =3D -nostartfiles -nostdlib +ASFLAGS +=3D -mcpu=3Dv10 -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/bare +CRT_FILES =3D crt.o sys.o + +# stop make deleting crt files if build fails +.PRECIOUS: $(CRT_FILES) + +%.o: %.c + $(CC) -c $< -o $@ + +%.o: %.s + $(AS) $(ASFLAGS) -c $< -o $@ + +%: %.s $(CRT_FILES) + $(CC) $(ASFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT_FILES) + +# The default CPU breaks (possibly as it's max?) so force crisv17 +$(CRIS_RUNS): QEMU_OPTS=3D-cpu crisv17 + +# Additional runners to run under GNU SIM +CRIS_RUNS_ON_SIM=3D$(patsubst %, %-on-sim, $(CRIS_RUNS)) +SIMG:=3Dcris-axis-linux-gnu-run + +# e.g.: make -f ../../tests/tcg/Makefile run-check_orm-on-sim +run-%-on-sim: + $(call run-test, $<, $(SIMG) $<, "$< on $(TARGET_NAME) with SIM") --=20 2.20.1