From patchwork Thu Aug 22 07:13:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13772825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B788C3DA4A for ; Thu, 22 Aug 2024 07:14:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43B156B0131; Thu, 22 Aug 2024 03:14:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34E086B0134; Thu, 22 Aug 2024 03:14:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DD5E6B0133; Thu, 22 Aug 2024 03:14:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D9FA66B0128 for ; Thu, 22 Aug 2024 03:14:09 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 98D23413B8 for ; Thu, 22 Aug 2024 07:14:09 +0000 (UTC) X-FDA: 82479017418.02.DD915C3 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf09.hostedemail.com (Postfix) with ESMTP id 67B3414001B for ; Thu, 22 Aug 2024 07:14:07 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724310807; a=rsa-sha256; cv=none; b=dEb2wbIm/Gpm/gxzh1mXzhNe/R8H8/dcdvpbO+nUhP0KpL1z1GeekAfIIfy6yxdWJTnuCy xOq2t4IfWce5E2O7qKW6+iI1QZPbGdjjKKY+5BQ+jflzf5I7xHHwGeCbmlHx/vwhfDAcWI bH1umOZ8SfkQ36paJY1XNT7v2SQ5qV0= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724310807; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gNvjGydXxM11R6iYxoD5Gjm3JZjBgCRgafHCl+6dfbQ=; b=h/p8ALKL2vSYAbw3OIv2t55bMXcC2HZDqKdg5bQNmXc9LWLaB+VyR+gBYEEhbSdlGS61As p4G1axDYMAio7kMpzSSr86bv+ZvOg0OvYybIIHxIMzl05HYOg7zzzuNb9U8105xE4xTooq e0YTEirIefnjWSSVtJSTVj86xj9TMv0= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WqDvK2DXtz9sSc; Thu, 22 Aug 2024 09:13:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8A21g5ZTDm9W; Thu, 22 Aug 2024 09:13:33 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4WqDvK1LWfz9sSH; Thu, 22 Aug 2024 09:13:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1C6448B77E; Thu, 22 Aug 2024 09:13:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id yCpxyD8Ro_93; Thu, 22 Aug 2024 09:13:33 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (PO16920.IDSI0.si.c-s.fr [192.168.232.181]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 09D248B763; Thu, 22 Aug 2024 09:13:32 +0200 (CEST) From: Christophe Leroy To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Theodore Ts'o" , "Jason A. Donenfeld" , Arnd Bergmann , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Vincenzo Frascino , Shuah Khan Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 10/17] powerpc/vdso: Refactor CFLAGS for CVDSO build Date: Thu, 22 Aug 2024 09:13:18 +0200 Message-ID: <6e3afc882145ee3b771ea41f1046c63f64f56b1e.1724309198.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1724310794; l=2748; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=Ezragzu3H5pSOY8WE3tKe7qLSwAgcLltpLmVKFEiFUM=; b=WaaKs+NofgcatkvWclAWUUw1Lix/JvqHhod4SpDdJ2RuWqwYcRwnwH5nv9cEl8nquqboddZWe nwWjcQtDkbCB2o3GzGri/WTviycNGBuIRjOZTFG132iZZ+ENyqyxk+o X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Stat-Signature: 34eah9kqjbapucbb7p7qjqin8p4wirr7 X-Rspamd-Queue-Id: 67B3414001B X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724310847-289509 X-HE-Meta: U2FsdGVkX1+v9+o/UScGUh0+XEcuUQx5EZyS5v1u1ywj0yKSlpOHSGqP2DrbR1IejEfjFq1C7Y1bE2CSmr9EDGHTVa2GCWmszL40JFu6tlMnQoUU62ciVc2Ki2jBohs9TDz+anykD1aktXczrB8EPig2E5MkWSoq2ooWNaYrbve+W7tWW87troUNlr3sBuFUt5mOK5cgcWt952YhI0arVrcTv1BwfMiiK3OyRSDB5VEzWLTXJCXXaXb3tvCZ0i4DlUjIc+QsrQN4utq3pov49qJO+Tfb+s4WDvBWPXuRnZOO6CfPq3iin0tXrvvTLZGHa0rYqpatRJ+dgpY/nJ2QEWFaNMta2bEnP2t9hdCvpL8NVGwDgROYJYSIK0ooUkCR2TMKTL9UNz7ivAh5VtRr2Mm3Rs+FKEVJAcLJDX2/X8/zPcq649uVkAUPPWD7i1jCPiLpumHa2Jz020k/8wY4Gf+f2kuLM5peb+OHuPSoutNkkQKmt0f9+zvutjnUC7cCmBuriyz8QGYTSHRcBY5o1kx/qWAxfvcoF2O2b33jebfjfXMFcAsITfXhPkXeso/VLGswnoyAKNnmJuXkiwQEASnNXTnu9/7XCwi9n24n8w77TtzAmtuXG+ydks+Sn8Vw2a+T7h+rPPy32/fO2UpA/hOWiyxdoGnwC1fr1eEY9wQWxDErV11dAoenuQWL8y/7D8L1vOB7wKbVbqIu4s3r9wN9hn3YXHjZyeVaIcKr222YRlujh1y9AjTIwPQwf9qtTmNl3BBj6DeQn1Y8zAFP5eBD66s6jelujDpM7V0Xm3Qr22L3ESyGwbJKGhg6OBxTI6nddhJzJmgmLEP02Vs7wBhKMFjhg42eYUKC7iWRG2rvcuzNpUeKxg7mzfjtVQitkERJMykwSEd1btepBcW8bVhHYlw9tD7di8XSfbEYZzTkDwG9mTdInO0TNAWhVyn3wrKc898FyRsrG3bOzxc 1umrRepH zge5OCMOnajisOBOiivTrXy3ccMUkBQX/uG50DNtTAkMMDDOIPZuSFRFq9khxRXZ2GnQMbaV1JZFSlsrTkppX8NAj2NOUWDwsV4vDortUqkba/Ws2tA/PrBx8iGQ4hTcDiWio X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In order to avoid duplication when we add new VDSO functionnalities in C like getrandom, refactor common CFLAGS. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso/Makefile | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile index c07a425b8f78..cd4ed09864f0 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -10,11 +10,6 @@ obj-vdso64 = sigtramp64-64.o gettimeofday-64.o datapage-64.o cacheflush-64.o not ifneq ($(c-gettimeofday-y),) CFLAGS_vgettimeofday-32.o += -include $(c-gettimeofday-y) - CFLAGS_vgettimeofday-32.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) - CFLAGS_vgettimeofday-32.o += $(call cc-option, -fno-stack-protector) - CFLAGS_vgettimeofday-32.o += -DDISABLE_BRANCH_PROFILING - CFLAGS_vgettimeofday-32.o += -ffreestanding -fasynchronous-unwind-tables - CFLAGS_REMOVE_vgettimeofday-32.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_vgettimeofday-32.o += -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc # This flag is supported by clang for 64-bit but not 32-bit so it will cause # an unused command line flag warning for this file. @@ -22,11 +17,6 @@ ifneq ($(c-gettimeofday-y),) CFLAGS_REMOVE_vgettimeofday-32.o += -fno-stack-clash-protection endif CFLAGS_vgettimeofday-64.o += -include $(c-gettimeofday-y) - CFLAGS_vgettimeofday-64.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) - CFLAGS_vgettimeofday-64.o += $(call cc-option, -fno-stack-protector) - CFLAGS_vgettimeofday-64.o += -DDISABLE_BRANCH_PROFILING - CFLAGS_vgettimeofday-64.o += -ffreestanding -fasynchronous-unwind-tables - CFLAGS_REMOVE_vgettimeofday-64.o = $(CC_FLAGS_FTRACE) # Go prior to 1.16.x assumes r30 is not clobbered by any VDSO code. That used to be true # by accident when the VDSO was hand-written asm code, but may not be now that the VDSO is # compiler generated. To avoid breaking Go tell GCC not to use r30. Impact on code @@ -49,7 +39,12 @@ targets += $(obj-vdso64) vdso64.so.dbg vgettimeofday-64.o obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) ccflags-y := -fno-common -fno-builtin +ccflags-y += $(DISABLE_LATENT_ENTROPY_PLUGIN) +ccflags-y += $(call cc-option, -fno-stack-protector) +ccflags-y += -DDISABLE_BRANCH_PROFILING +ccflags-y += -ffreestanding -fasynchronous-unwind-tables ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack $(CLANG_FLAGS) +ccflags-remove-y := $(CC_FLAGS_FTRACE) ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) ldflags-$(CONFIG_LD_ORPHAN_WARN) += -Wl,--orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)