From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A19B1C4332F for ; Wed, 4 Jan 2023 19:02:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9801D85553; Wed, 4 Jan 2023 20:02:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=pschenker.ch Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=pschenker.ch header.i=@pschenker.ch header.b="xTaZO12k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E6E285582; Wed, 4 Jan 2023 20:02:22 +0100 (CET) Received: from smtp-bc0b.mail.infomaniak.ch (smtp-bc0b.mail.infomaniak.ch [45.157.188.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 86DB885248 for ; Wed, 4 Jan 2023 20:02:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=pschenker.ch Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dev@pschenker.ch Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4NnJrC1cphzMqXDv; Wed, 4 Jan 2023 20:02:19 +0100 (CET) Received: from unknown by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4NnJrB4kyPzMq1Tj; Wed, 4 Jan 2023 20:02:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pschenker.ch; s=20220412; t=1672858939; bh=lDqslrmZrqFUk8NjUugJ+uCBH7P/1mCSe69xbTY+7a0=; h=From:To:Cc:Subject:Date:From; b=xTaZO12kq4oPCCCF+6FGcBXI9cmdjMpcmaexEr3oVVvviFTABWOAbbvv2kB8d61lX K/AlsnvnZax0PBPd7C3jtO0vCR22aVe96WSbsWgs2nYkDogGRspVuZ9DR5jk4k9KKv knE7T8FTJGykbDxqxCdLWZXNAJur/IaVLAdoosfU= From: Philippe Schenker To: u-boot@lists.denx.de Cc: Francesco Dolcini , Philippe Schenker , Fabio Estevam , "NXP i.MX U-Boot Team" , Stefano Babic Subject: [PATCH 1/2] imx: bootaux: Fix build warning when LTO is enabled Date: Wed, 4 Jan 2023 20:02:15 +0100 Message-Id: <20230104190216.145187-1-dev@pschenker.ch> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Francesco Dolcini Fix conflicting declaration of hostmap[] variable. When building with CONFIG_LTO=y we get the following warning: KSLCC keep-syms-lto.o LTO u-boot arch/arm/mach-imx/imx_bootaux.c:24:31: warning: type of ‘hostmap’ does not match original declaration [-Wlto-type-mismatch] 24 | const __weak struct rproc_att hostmap[] = { }; | ^ arch/arm/mach-imx/imx8m/soc.c:1590:24: note: array types have different bounds 1590 | const struct rproc_att hostmap[] = { | ^ arch/arm/mach-imx/imx8m/soc.c:1590:24: note: ‘hostmap’ was previously declared here OBJCOPY u-boot.srec OBJCOPY u-boot-nodtb.bin Just remove the __weak declaration and add an extern, in any case this variable is supposed to be declared in the SOC file and there is no way to have imx_bootaux build with this variable not declared. In addition to that the weak variable definition is not correct, get_host_mapping() will just reference non initialized data, if ever now will have a build error instead of undefined behavior at runtime. Signed-off-by: Francesco Dolcini Signed-off-by: Philippe Schenker --- arch/arm/mach-imx/imx_bootaux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c index 8115bf40f1a9..6c00ef6007e7 100644 --- a/arch/arm/mach-imx/imx_bootaux.c +++ b/arch/arm/mach-imx/imx_bootaux.c @@ -21,7 +21,7 @@ #define SRC_M4_REG_OFFSET 0 #endif -const __weak struct rproc_att hostmap[] = { }; +extern const struct rproc_att hostmap[]; static const struct rproc_att *get_host_mapping(unsigned long auxcore) { -- 2.39.0