From patchwork Mon Dec 2 11:29:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 11269049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CC01139A for ; Mon, 2 Dec 2019 11:31:40 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAAFE2146E for ; Mon, 2 Dec 2019 11:31:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="ZHPzxViB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAAFE2146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ibju9-00039a-TN; Mon, 02 Dec 2019 11:30:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ibju8-00039V-QB for xen-devel@lists.xenproject.org; Mon, 02 Dec 2019 11:30:12 +0000 X-Inumbo-ID: 19dfa226-14f7-11ea-83b8-bc764e2007e4 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 19dfa226-14f7-11ea-83b8-bc764e2007e4; Mon, 02 Dec 2019 11:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1575286212; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=LgrI7imZTHW5E5wP8a35fEjqQd4LZ1IPO5hV5N7ABPU=; b=ZHPzxViBaOH1ubPkMLuLc0ZcILlqzKYCD6rkjkPpOWenusoADGKSh1jA gswKCqdY0ao9Ax6XY9UcmoPEWe+dUr/vVoGBY2tNHHmWbRzAt/Q60JvSZ 3f2FIOAgazAtjEhrd0O7oc2hN58ZZiwjGsvRIf64B7+lA4yGTuJrROkhs 8=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: RWCm50YdpxNH5YE8UOTPKWS02/GuzG/PCwCgBwfHwKXokkiO7FUcLDphf0noXeqL9C4MMAaFgA OebWBJMVuuL7Qmrxh8zMi9kmDgwrWSLBX4rvsG+GScog9ObcDHqLxs+6c3n8pIkuV0KrD2ABu7 1TBSPUsSHDmJuleducBubbib4fgn8p5Ur3CQG94sq08EmaE7Dt07r7Y2K/ftzYmh9yphPVOUoS luDMki+X2A9WdTCrmkN2JgzFUHmYFhuBluDFs9EGuUjz5hlnZ6S3VfhLz/EKM/nTlwacooX8Lu Ctw= X-SBRS: 2.7 X-MesageID: 9173521 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,268,1571716800"; d="scan'208";a="9173521" From: Roger Pau Monne To: Date: Mon, 2 Dec 2019 12:29:46 +0100 Message-ID: <20191202112946.25461-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-4.13] x86: re-order clang no integrated assembler tests X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Wei Liu , Andrew Cooper , Doug Goldstein , Jan Beulich , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The tests to check whether the integrated assembler is capable of building Xen should be performed before testing any assembler features, or else the feature specific tests would be stale if the integrated assembler is disabled afterwards. Fixes: ef286f67787a ('x86: move and fix clang .skip check') Reported-by: Andrew Cooper Reported-by: Doug Goldstein signed-off-by: Roger Pau Monné --- Cc: Juergen Gross --- xen/arch/x86/Rules.mk | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index a3c5eb9de7..92fdbe9d68 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -12,6 +12,30 @@ CFLAGS += '-D__OBJECT_LABEL__=$(subst /,$$,$(subst -,_,$(subst $(BASEDIR)/,,$(CU # Prevent floating-point variables from creeping into Xen. CFLAGS += -msoft-float +ifeq ($(clang),y) +# Note: Any test which adds -no-integrated-as will cause subsequent tests to +# succeed, and not trigger further additions. +# +# The tests to select whether the integrated assembler is usable need to happen +# before testing any assembler features, or else the result of the tests would +# be stale if the integrated assembler is not used. + +# Older clang's built-in assembler doesn't understand .skip with labels: +# https://bugs.llvm.org/show_bug.cgi?id=27369 +$(call as-option-add,CFLAGS,CC,".L0: .L1: .skip (.L1 - .L0)",,\ + -no-integrated-as) + +# Check whether clang asm()-s support .include. +$(call as-option-add,CFLAGS,CC,".include \"asm/indirect_thunk_asm.h\"",,\ + -no-integrated-as) + +# Check whether clang keeps .macro-s between asm()-s: +# https://bugs.llvm.org/show_bug.cgi?id=36110 +$(call as-option-add,CFLAGS,CC,\ + ".macro FOO;.endm"$$(close); asm volatile $$(open)".macro FOO;.endm",\ + -no-integrated-as) +endif + $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) $(call cc-option-add,CFLAGS,CC,-Wnested-externs) $(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX) @@ -70,22 +94,3 @@ endif # Set up the assembler include path properly for older toolchains. CFLAGS += -Wa,-I$(BASEDIR)/include -ifeq ($(clang),y) -# Note: Any test which adds -no-integrated-as will cause subsequent tests to -# succeed, and not trigger further additions. - -# Older clang's built-in assembler doesn't understand .skip with labels: -# https://bugs.llvm.org/show_bug.cgi?id=27369 -$(call as-option-add,CFLAGS,CC,".L0: .L1: .skip (.L1 - .L0)",,\ - -no-integrated-as) - -# Check whether clang asm()-s support .include. -$(call as-option-add,CFLAGS,CC,".include \"asm/indirect_thunk_asm.h\"",,\ - -no-integrated-as) - -# Check whether clang keeps .macro-s between asm()-s: -# https://bugs.llvm.org/show_bug.cgi?id=36110 -$(call as-option-add,CFLAGS,CC,\ - ".macro FOO;.endm"$$(close); asm volatile $$(open)".macro FOO;.endm",\ - -no-integrated-as) -endif