From patchwork Wed May 12 10:20:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 435496 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4700629jao; Wed, 12 May 2021 03:41:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKOiIBIQ5g8BPz/zEtQWnLmBpNWeF2LnUw5PZqhd11r6T7EDLKTsNZfxV7o7VvSaK0PXZG X-Received: by 2002:a02:cf32:: with SMTP id s18mr2833092jar.31.1620816078989; Wed, 12 May 2021 03:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620816078; cv=none; d=google.com; s=arc-20160816; b=ZzQJJN4KtSh2fz1rSMhM6ulL0efl1X/u2M0gUUHV5Usjo88T8hjLiN2qOyCtBSoeN0 7xmEESU2yFt+2NlujaWQTJpOE0jtR0fSMMz+X56j11Bwu7IgUSFd9mSz06H9aH8DnNVR VJYKdXn2D4PROaof+lIwW9yErHkCQUEEScNIJzyMyDaSqwr6JGDU7A4WAdcNDBwj55SO FCReQ8fo4MyLt2ghpudV/nauUxRXRdnBJNsIJO7kYNLjg/b2KZmt1uGWEYXcounLg0aW /5Omuooz02Kf+5zK4AEXt6YzW0VJvZypjZbW5JaIuanPlKOLUSjiQXZIsvwIChPWW97q 4Gdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=iPq9uGOdfE2STV15D/gtYtThg7p+C48gB81bHaUpG4E=; b=IElqsLNKfBPNh2hhZSqsUpVuX1mhWNcRAAvr330kFpGXv1TdwSlNN4ZfaD/N/N06zV eKHOs/R2I9vWLL+WPOq4CxX0/nvIkNMLEPMHfQiob5kcKCcWC4YsBZ9tHq8ZGz0oJXC3 HAOfQEhjQbUr8C+d0IXXoHj2NIzsC00GskVRtDjwk5gwxu11feZaH+VS0Y8z6/NN4Wa7 IGZmHFxzE4NAAKG0LJyhdoATZ9ACh/gZSbOIZH15mkjqzMAG0Oj5zQCdpm1gXRLoHpWn 3J9NF/4On98ZKMU72EaS5wHeCRtYGho8K3kggwEwcKzttGKF0bJB/D7KHbqAPxp9oFZM p97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=P+NzgoOl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a9si9150581ilh.51.2021.05.12.03.41.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 May 2021 03:41:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=P+NzgoOl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgmIo-0004U5-AL for patch@linaro.org; Wed, 12 May 2021 06:41:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgm8X-0000aM-94 for qemu-devel@nongnu.org; Wed, 12 May 2021 06:30:41 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:40522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgm8M-0000ZQ-QH for qemu-devel@nongnu.org; Wed, 12 May 2021 06:30:41 -0400 Received: by mail-wr1-x436.google.com with SMTP id z17so4002648wrq.7 for ; Wed, 12 May 2021 03:30:28 -0700 (PDT) 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=iPq9uGOdfE2STV15D/gtYtThg7p+C48gB81bHaUpG4E=; b=P+NzgoOlr6njhzjVrNlIZ8tvcdsTsy/ik5QjmRKTJZ8T7DBl8d/dKYdEQBiCOdpuEy j3jXH0dI3v0+pLdEElffZlQ1TkRZOF6cdDNnle+eYaLcbYvWt7SlVGCkRhbSsetV5Tas 8BkTiJuc8e02LD9/EJcjHAKgGLSuB32z3KSjmiGtbgJeilAktMVhB2PQUZH1sFy1ZYWE lIUiYvRtlkstraW10HRYxk2CV1TOtkvrdQv1FUrSmcmhyxrpJUYixV0kJta8NTl4lTGD hFFPxUMi66S75ipuB3op5iiGELcJ/Hkd1sKEz6QAnAcvi/X9ttcLLpqkn6PtKDDfoIhR UGFg== 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=iPq9uGOdfE2STV15D/gtYtThg7p+C48gB81bHaUpG4E=; b=CdpqM3Qw/oHs9dMtaVjEJww43XmAL21ISpxNl0KHPg2rRyZQdhZVxVQ2c6dwWuxsZI ItMTG5wDp4UPuEMLlDSYprulJB2p1LbOUt3Zb9mIcZH25vK0jdiSSyicrhdbg5d7+UAy 11cHEj6DtaRdrs7HcLdZdtl00614vHZsw8+wWu1JnSOI+re+HKSO/IEe3L1dL5RNsLpG wEZ/tioUPBpfxLSkiKSxhzSRaHd/Q/o3DkwMm411+bq5F2EovYeP/wq+UVIsNSmMPds7 qyuvbk8GlfbTy6iz0PDb64X5RaI5kGigQ3sqT4QH0AmV3J09BdB8ZJXiv4EMlNCXbZm7 a/AA== X-Gm-Message-State: AOAM5329JOTOvgyzMqbeM0OqwowkQDu2sy+bAbOg2zzJmrTXgVrxvama ZXjwj2HXNFK/NhiQKGJrU8rELw== X-Received: by 2002:adf:e0c6:: with SMTP id m6mr45984304wri.66.1620815427667; Wed, 12 May 2021 03:30:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y17sm33738807wrw.90.2021.05.12.03.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 03:30:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 385111FF9A; Wed, 12 May 2021 11:20:52 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 11/31] tests/tcg: Add docker_as and docker_ld cmds Date: Wed, 12 May 2021 11:20:31 +0100 Message-Id: <20210512102051.12134-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512102051.12134-1-alex.bennee@linaro.org> References: <20210512102051.12134-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, Bastian Koppelmann , f4bug@amsat.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Bastian Koppelmann At least for the TriCore target no easily available c compiler exists. Thus we need to rely on "as" and "ld". This allows us to run them through the docker image. We don't test the generation capabilities of docker images as they are assumed to work. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Bastian Koppelmann [AJB: fix quoting, only handle docker & clear, test -n, tweak commit msg] Signed-off-by: Alex Bennée --- v2 - only pass down AS/LD if defined --- tests/tcg/Makefile.qemu | 17 +++++++++++++++++ tests/tcg/configure.sh | 17 ++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu index a56564660c..84c8543878 100644 --- a/tests/tcg/Makefile.qemu +++ b/tests/tcg/Makefile.qemu @@ -22,6 +22,8 @@ quiet-@ = $(if $(V),,@) quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3) CROSS_CC_GUEST:= +CROSS_AS_GUEST:= +CROSS_LD_GUEST:= DOCKER_IMAGE:= -include tests/tcg/config-$(TARGET).mak @@ -42,6 +44,8 @@ cross-build-guest-tests: $(call quiet-command, \ (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \ $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \ + $(if $(CROSS_AS_GUEST),AS="$(CROSS_AS_GUEST)") \ + $(if $(CROSS_LD_GUEST),LD="$(CROSS_LD_GUEST)") \ SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \ EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \ "BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)") @@ -59,11 +63,24 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \ -i qemu/$(DOCKER_IMAGE) \ -s $(SRC_PATH) -- " +DOCKER_AS_CMD=$(if $(DOCKER_CROSS_AS_GUEST),"$(DOCKER_SCRIPT) cc \ + --cc $(DOCKER_CROSS_AS_GUEST) \ + -i qemu/$(DOCKER_IMAGE) \ + -s $(SRC_PATH) -- ") + +DOCKER_LD_CMD=$(if $(DOCKER_CROSS_LD_GUEST),"$(DOCKER_SCRIPT) cc \ + --cc $(DOCKER_CROSS_LD_GUEST) \ + -i qemu/$(DOCKER_IMAGE) \ + -s $(SRC_PATH) -- ") + + .PHONY: docker-build-guest-tests docker-build-guest-tests: docker-image-$(DOCKER_IMAGE) $(call quiet-command, \ (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \ $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \ + $(if $(DOCKER_AS_CMD),AS=$(DOCKER_AS_CMD)) \ + $(if $(DOCKER_LD_CMD),LD=$(DOCKER_LD_CMD)) \ SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \ EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \ "BUILD","$(TARGET) guest-tests with docker qemu/$(DOCKER_IMAGE)") diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index e6c1be5450..ed378e7840 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -75,7 +75,13 @@ fi for target in $target_list; do arch=${target%%-*} + # reset all container fields container_image= + container_hosts= + container_cross_cc= + container_cross_as= + container_cross_ld= + case $target in aarch64-*) # We don't have any bigendian build tools so we only use this for AArch64 @@ -273,7 +279,16 @@ for target in $target_list; do for host in $container_hosts; do if test "$host" = "$ARCH"; then echo "DOCKER_IMAGE=$container_image" >> $config_target_mak - echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak + echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> \ + $config_target_mak + if test -n "$container_cross_as"; then + echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> \ + $config_target_mak + fi + if test -n "$container_cross_ld"; then + echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> \ + $config_target_mak + fi fi done fi