From patchwork Thu Dec 12 18:27:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11289061 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 5A3D8188B for ; Thu, 12 Dec 2019 18:29:06 +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 366FA2253D for ; Thu, 12 Dec 2019 18:29:06 +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="CP1IVSi1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 366FA2253D 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 1ifTC7-0007Gb-B0; Thu, 12 Dec 2019 18:28:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifTC5-0007Fu-Gq for xen-devel@lists.xenproject.org; Thu, 12 Dec 2019 18:28:09 +0000 X-Inumbo-ID: 1d833f14-1d0d-11ea-88e7-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1d833f14-1d0d-11ea-88e7-bc764e2007e4; Thu, 12 Dec 2019 18:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1576175275; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rmyFJ9d+smpRLDE6b4uNXfrBb6V1qK0qwOw/oUdO9Ho=; b=CP1IVSi1cCaNaMBibqkb87u+m0Dw3rRj/fUpJrKzivaB7L6GZrEphhKH +kvsCK3ZxxzGz52IX9uArn6Gfh6wulrDIvFMByLjRp7RjS0G8mVe3zoMF sLie2ahrMtUhpMWbBh27YDLXq+8k3YuZzf1errEV7JeOqZAeyXZxFnKZy Y=; 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: Pj/NMGzt7i+K1y2ttizHCwMFErXajba+aMZ1NoiP13cpZzfJl49qnnQPyoihQ34pSVyfAuyZnE l2ZwgMar+yDvgA0vAFMqi2oOTx/ia1h57vragaEXcwW/AzcR5eZTgpkXTiZj5rwmyWcT/o90Pv NzuPY0bFNSHbs8ci2ImSRDucOfh5peud38LCmRNNcfye613CWwBzARKFZ1bfLU0nS5fVhaUsGW 9Za19zteJZT139m9l/KX1gsvVOCFCFBpFeYbdwnlkV4BvZK2psoEfGofJ51uVvl5b5ra/BCi7z Mw0= X-SBRS: 2.7 X-MesageID: 10021233 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,306,1571716800"; d="scan'208";a="10021233" From: Anthony PERARD To: Date: Thu, 12 Dec 2019 18:27:40 +0000 Message-ID: <20191212182740.2190199-9-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191212182740.2190199-1-anthony.perard@citrix.com> References: <20191212182740.2190199-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH 8/8] 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 --- 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