From patchwork Tue Dec 17 10:59:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11297259 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 DFEFD112B for ; Tue, 17 Dec 2019 11:00:30 +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 BBFD62064B for ; Tue, 17 Dec 2019 11:00:30 +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="ScgbLz0t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBFD62064B 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 1ihAZb-0008Dh-Vb; Tue, 17 Dec 2019 10:59:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihAZb-0008DN-Bk for xen-devel@lists.xenproject.org; Tue, 17 Dec 2019 10:59:27 +0000 X-Inumbo-ID: 3ef8eb5c-20bc-11ea-8e9d-12813bfff9fa Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3ef8eb5c-20bc-11ea-8e9d-12813bfff9fa; Tue, 17 Dec 2019 10:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1576580349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jpatUXK7f8bEn0Z7hPW7toHzZ3qGUNcaCE7FiD3GcQc=; b=ScgbLz0t6hntqe5PhEJYuhZfBLp3EGN3YD7Ohod6iGtTpQqFnpICq+CR 7uKPx9DGokJ11OIXlIqRYQrUXfnAgsuc8wstRhBvIFGw5tdVKx5CINkAJ ThffKkKZzipU3rOXUEJg+zeCPY2vMaGifSbz3nUdZ9mTlABLsmOHkwRMP Q=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: AbDgBrSp/pc+jcSz9CH52kO6znGGYPIz7Ie4Jcmx0jkuLnhsdEZg1477HCsf58lDOSewTiI9f+ vJLfWzSdMOvQcdaU5mpZegYBJ2LFr/tpFm2Bo9e1k3GI1MPncb5j9rg3mApzyQq3MZrCcYwRm6 AuuIoqX/NnvlOdAPLEVUtsGsHXk/evhocz58z2bNf2LwVeLy0q1C+xAL8AKFUXF7p4mIHBeCFk B9YgRA4afiUtrX/eHVblT8F/vjjIGZfzZCws2+oCVmJ8XQgV0GNz7n4zeME15OQ7AtQAcfy79+ ebM= X-SBRS: 2.7 X-MesageID: 10211659 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,325,1571716800"; d="scan'208";a="10211659" From: Anthony PERARD To: Date: Tue, 17 Dec 2019 10:59:01 +0000 Message-ID: <20191217105901.68158-7-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191217105901.68158-1-anthony.perard@citrix.com> References: <20191217105901.68158-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 6/6] xen: Move GCC_HAS_VISIBILITY_ATTRIBUTE to Kconfig and common 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: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Anthony PERARD , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The check for $(CC) -fvisibility=hidden is done by both arm and x86, so the patch also move the check to the common area. The check doesn't check if $(CC) is gcc, and clang can accept that option as well, so s/GCC/CC/ is done to the define name. Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper --- xen/Kconfig | 4 ++++ xen/arch/arm/Rules.mk | 4 ---- xen/arch/x86/Rules.mk | 5 ----- xen/include/xen/compiler.h | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/xen/Kconfig b/xen/Kconfig index 9f6512d65b08..fc49f4c30a29 100644 --- a/xen/Kconfig +++ b/xen/Kconfig @@ -24,6 +24,10 @@ config CLANG_VERSION int default $(shell,$(BASEDIR)/scripts/clang-version.sh $(CC)) +# -fvisibility=hidden reduces -fpic cost, if it's available +config CC_HAS_VISIBILITY_ATTRIBUTE + def_bool $(cc-option,-fvisibility=hidden) + source "arch/$(SRCARCH)/Kconfig" config DEFCONFIG_LIST diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index 3d9a0ed357bc..022a3a6f82ba 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -18,10 +18,6 @@ CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc -ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n) -CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE -endif - EARLY_PRINTK := n ifeq ($(CONFIG_DEBUG),y) diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index b98e14e28c5a..e69b8e697cc0 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -65,11 +65,6 @@ CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables # SSE setup for variadic function calls. CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup) -# -fvisibility=hidden reduces -fpic cost, if it's available -ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n) -CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE -endif - # Compile with thunk-extern, indirect-branch-register if avaiable. ifeq ($(CONFIG_INDIRECT_THUNK),y) CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index ff6c0f5cdd18..8c846261d241 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -78,7 +78,7 @@ #define __must_be_array(a) \ BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0]))) -#ifdef GCC_HAS_VISIBILITY_ATTRIBUTE +#ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE /* Results in more efficient PIC code (no indirections through GOT or PLT). */ #pragma GCC visibility push(hidden) #endif