From patchwork Mon Nov 28 10:26:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 13057257 X-Patchwork-Delegate: palmer@dabbelt.com 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DFE4C43217 for ; Mon, 28 Nov 2022 10:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l4tMif1xmgDIODFauR9lcracteamtELDq34d1oe1pN8=; b=QiVsjecyj9tb0M 64jzS+XmC8hwybYwsKPfJm0LsFL0oLVi/w23ffPtcdS6FKoPuc8klIP6XjMfQxx+Bn49SPPcPJ5Jw jSO00YmFHYZn22vlFjNb5gR0Stpz5LOMK45nEjyiSvEE51eTF2OwcQZYgkLb4MLH4V5EvwBPVv+f3 SXj43I1d260RbtHjK3BXGXi+SIZxjTUf+NfONye5ty7pq2S3mU0RmH5SHWHpeRQBoeOMRy9YBBzlf x90HLjtkfE6jA1mD2TRmLy0nAQMdfxMK/5UeowM8uLqIeJA7F8AL7Vc83/8Wmu1Xf+oqWYhQT2L1+ eMtu91OAY08Kxn0PZP/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozbMq-0012FY-Ua; Mon, 28 Nov 2022 10:28:04 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozbMn-0012Dq-TR for linux-riscv@lists.infradead.org; Mon, 28 Nov 2022 10:28:03 +0000 Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ozbLW-0004Xi-68; Mon, 28 Nov 2022 11:26:42 +0100 From: Heiko Stuebner To: linux-riscv@lists.infradead.org, palmer@dabbelt.com Cc: christoph.muellner@vrull.eu, prabhakar.csengg@gmail.com, conor@kernel.org, philipp.tomsich@vrull.eu, ajones@ventanamicro.com, heiko@sntech.de, emil.renner.berthing@canonical.com, Heiko Stuebner , Conor Dooley Subject: [PATCH v2 11/13] efi/riscv: libstub: mark when compiling libstub Date: Mon, 28 Nov 2022 11:26:30 +0100 Message-Id: <20221128102632.435174-12-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221128102632.435174-1-heiko@sntech.de> References: <20221128102632.435174-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221128_022801_972552_B018848A X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Heiko Stuebner We may want to runtime-optimize some core functions (str*, mem*), but not have this leak into libstub and cause build issues. Instead libstub, for the short while it's running, should just use the generic implementation. So, to be able to determine whether functions, that are used both in libstub and the main kernel, are getting compiled as part of libstub or not, add a compile-flag we can check via #ifdef. Reviewed-by: Conor Dooley Signed-off-by: Heiko Stuebner --- drivers/firmware/efi/libstub/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index b1601aad7e1a..39c8e3da1937 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -25,7 +25,7 @@ cflags-$(CONFIG_ARM) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \ -fno-builtin -fpic \ $(call cc-option,-mno-single-pic-base) cflags-$(CONFIG_RISCV) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \ - -fpic + -fpic -DRISCV_EFISTUB cflags-$(CONFIG_LOONGARCH) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \ -fpie