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 E5FE5C433EF for ; Sun, 22 May 2022 13:58:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 352FE83ED8; Sun, 22 May 2022 15:58:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fFzDxGlT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 216DB83E8E; Sun, 22 May 2022 15:58:51 +0200 (CEST) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D196D83EBA for ; Sun, 22 May 2022 15:58:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ed1-x530.google.com with SMTP id er5so16037768edb.12 for ; Sun, 22 May 2022 06:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=PCktnDhjsWNuccPbM1qN3D3UToUQhkZVrHE/kAgTiTI=; b=fFzDxGlTshDJqgf5XiwHKHQnoqoL/OvVCW+l4u/KTIH+qdSFhYZCghEBj0jnZ5w+K1 PF/sv+AOJ5XGHooXmERVs8f1wcdTBy7VBnGK68uGQIB0OapNMN+D9oq3P9oXE19FmDs3 NOt+5R+4vhPHVkX065UReLVixjpNKqJd1VRhA0wTkOor/KPJSiqT5FdBQynScxNTbbIr zoFxamaPdBrVcEoSFzUkXHXUNwY51SWo4R3O/cRG9K3aJGH2of0Ekr8ZasyRLbU6VxoX jfRtai+ViHEImrzLObzfoqKI07Ld6CXcmefcg3PfHmdvkhk80cQcRwWFVeVidcDU+lBi dtRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=PCktnDhjsWNuccPbM1qN3D3UToUQhkZVrHE/kAgTiTI=; b=DHSlD57gXavHBKriR16Q2aN9NDTkMcvMCP9DWXW6XFzQlnsgmXorkpLHo7eQtu9rGM bH2I6fOKni8BZRa5W59n/j0JsQPQjJL0PNPN9myOgoeEwwfGCjz9Hceb2CH4G6FdWZg2 d8ZncldzlHxE4r3wDtezbAH/YSrSp19Zsxc7DbOWojZnUSk+NT97vgJCazDujfLf4rjs U1E1AVvcCSuIIjelwIKTTbU+UtaAOPeZYNW1IiZlfN0b0cTpr6o93AABAt6LU+EKiWD/ yi3akmQNcDSMgKGuZQKRxkwha7H8rC7717GeNPj9bNof9VAfJDMWCs7WtamWHu834cHC ceSQ== X-Gm-Message-State: AOAM533/dkPYduhqWuqviejgE6P0kMbEPjhx1yQwfNsXr7pNlNVJzijT Mbqnrt+cN4fgGQmD/ImEXDM= X-Google-Smtp-Source: ABdhPJx3BG9Qc522ERKsima9GFnK/m7HYE2X86MKTmyZEWtvEvrVyML1Cd1jvExLLA7j40lB1+ejXg== X-Received: by 2002:a05:6402:2713:b0:427:d414:3bf6 with SMTP id y19-20020a056402271300b00427d4143bf6mr19890575edd.180.1653227927409; Sun, 22 May 2022 06:58:47 -0700 (PDT) Received: from [192.168.0.74] ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id 1-20020a170906004100b006f3ef214dc7sm5140701ejg.45.2022.05.22.06.58.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 May 2022 06:58:46 -0700 (PDT) Message-ID: Date: Sun, 22 May 2022 16:56:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 From: Alper Nebi Yasak Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86 To: Tom Rini , Peng Fan Cc: "Peng Fan (OSS)" , "sbabic@denx.de" , "festevam@gmail.com" , "ariel.dalessandro@collabora.com" , "michael@amarulasolutions.com" , "tharvey@gateworks.com" , "sjg@chromium.org" , "marek.behun@nic.cz" , "pali@kernel.org" , "sr@denx.de" , Ricardo Salveti , "patrick.delaunay@foss.st.com" , "u-boot@lists.denx.de" References: <20220520141048.20034-1-peng.fan@oss.nxp.com> <20220520141048.20034-2-peng.fan@oss.nxp.com> <20220520152127.GC13239@bill-the-cat> <20220521120518.GI13239@bill-the-cat> Content-Language: en-US In-Reply-To: <20220521120518.GI13239@bill-the-cat> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 21/05/2022 15:05, Tom Rini wrote: > On Sat, May 21, 2022 at 08:33:56AM +0000, Peng Fan wrote: >>> Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86 >>> >>> On Fri, May 20, 2022 at 10:10:40PM +0800, Peng Fan (OSS) wrote: >>> >>>> From: Peng Fan >>>> >>>> set the symbol as weak not work if LTO is enabled. Since u_boot_any is >>>> only used on X86 for now, so guard it with X86, otherwise build break >>>> if we use BINMAN_SYMBOLS on i.MX. >>>> >>>> Tested-by: Tim Harvey #imx8m[m,n,p]-venice >>>> Signed-off-by: Peng Fan >>>> --- >>>> common/spl/spl.c | 8 ++++++-- >>>> common/spl/spl_ram.c | 4 ++++ >>>> 2 files changed, 10 insertions(+), 2 deletions(-) >>> >>> I think we long term need to figure this out and address it so LTO works. But >>> for now can you please guard this with a test on LTO instead, so it's clear >>> where the problem is? >> >> Sorry, I could not get your point about guard with a test on LTO. >> >> Actually binman weak symbol will report a warning log if there is no u_boot_any >> binman symbol. Since only X86 use it, I guard with X86. > > Why are you mentioning LTO in the commit message? When I read the > commit message it sounds like you're saying the problem is that LTO > doesn't like how this symbol is handled, but if LTO was disabled, > everything would be fine. If it's not LTO-related, please re-word the > message instead. It looks like we should be able to change things in common/spl/spl.c to: #if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) /* See spl.h for information about this */ binman_sym_declare_optional(ulong, u_boot_any, image_pos); binman_sym_declare_optional(ulong, u_boot_any, size); #endif which would mark the symbol as 'weak' and turn the error into a warning on the binman side. But that is somehow being undone by LTO. I'm trying to build for imx8mm-beacon with that change instead of this patch. With CONFIG_LTO=y, build fails and spl/u-boot-spl.sym has: > 00000000007fbe28 l O .binman_sym 0000000000000008 _binman_u_boot_any_prop_image_pos Looks like the size symbol is optimized out. With CONFIG_LTO unset, the build succeeds and the same file has: > 00000000007fe90c w O .binman_sym 0000000000000008 _binman_u_boot_any_prop_image_pos > 00000000007fe904 w O .binman_sym 0000000000000008 _binman_u_boot_any_prop_size I don't know much about linking stuff, so this is as deep as I could dig...