From nobody Tue Feb 10 06:07:49 2026 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 1552408825752994.9773581938956; Tue, 12 Mar 2019 09:40:25 -0700 (PDT) Received: from localhost ([127.0.0.1]:55545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3kRx-0006Tb-Lt for importer@patchew.org; Tue, 12 Mar 2019 12:40:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ju5-0002ZU-N7 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:05:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3ju1-00037m-Vt for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:05:21 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:38962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3ju1-00034W-BD for qemu-devel@nongnu.org; Tue, 12 Mar 2019 12:05:17 -0400 Received: by mail-wr1-x444.google.com with SMTP id p8so3315654wrq.6 for ; Tue, 12 Mar 2019 09:05:14 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q10sm9265752wrr.75.2019.03.12.09.05.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 09:05:10 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 629D51FF9A; Tue, 12 Mar 2019 15:59:48 +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=Kd8JVLxf1eZNN1lfzIE2XIc+L/Pi5+U3M0YIIsHVuZ33CAejknfybTpLr7V744lTK6 53bvbtATqw0sZB9kcW116LH6zqyBgRLVMei7mdfqaxBX1lKAJ4osbfmg2gtfDX3YnSqr CSNT6YmJSOvWn+uyh61PQwAhYPDn7lTbPLeh2V2sNEP+/XnWlR9V0foUMr115hWRiyaW ZbJl+v89JqOQk2gWYehtLFLzryT2rL91C5KxB1DoaFeJbARzm1y8MvlFgOyOL1tjfaSQ 8ZUywKwiS+64UXXdK4cHnRoR9sMu+WjZYJEcofI0MDph5RTkKTFbGhtS18H0ncSwE72o nBQg== 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=sHtqILzrJDwZpB93QtcA6/oLUak9y0gCf7DAW6Ih/G9RxpUc6zNpugOp1Hc5npFl6E Xy1mAQzOCr+swXzECyYo9c3r/Uvg5Qq0+bFPeu3OUpGmCEfb6KdM1j0Hqc4jJo8XePj1 kxXQHLtfDGYtfsFIp2c0wxi6N5Z4HTSbUtc6x0b9b9h0gS0MHFriC4fkdey0arjRdBOX TcnQmaqcOvOgNGOmdokyDflgOA38LmsoOa00FjGakyfxjaEHiE6nHtB6NgntQZPX0yx+ NmY0sfogmpOACMxKNm5HPBaOdJTZOHyrb17u+IimVk0/ksHOcjy5f2wzH3gok1ePexyz +eIw== X-Gm-Message-State: APjAAAWs8+Edq+oUv96hLTxNb+bXA2RCBc81sjKiHoRsiQX+CMpt+hEf APcBcIEbh51odPUjveMO2zINUA== X-Google-Smtp-Source: APXvYqyPrcp33WJQYQtd6Nqc37VcyVhvDuT9pwq3KadEtAafT/JHbkpx6p9BSd2JvH3dhFAUDQX3bw== X-Received: by 2002:a5d:40c5:: with SMTP id b5mr24943424wrq.107.1552406712996; Tue, 12 Mar 2019 09:05:12 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 15:59:41 +0000 Message-Id: <20190312155947.14918-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190312155947.14918-1-alex.bennee@linaro.org> References: <20190312155947.14918-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::444 Subject: [Qemu-devel] [PATCH v4 15/21] 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: peter.maydell@linaro.org, famz@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, agraf@suse.de, cota@braap.org, aurelien@aurel32.net 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