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 41353C433EF for ; Thu, 16 Dec 2021 22:17:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36C7283050; Thu, 16 Dec 2021 23:17:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 5BA528304E; Thu, 16 Dec 2021 23:17:42 +0100 (CET) Received: from mail.nic.cz (lists.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A2DB482EBB for ; Thu, 16 Dec 2021 23:17:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id 6988314078D; Thu, 16 Dec 2021 23:17:37 +0100 (CET) Date: Thu, 16 Dec 2021 23:17:36 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Stefan Roese , u-boot@lists.denx.de Subject: Re: [PATCH u-boot-marvell v2 8/9] arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible Message-ID: <20211216231736.77180c27@thinkpad> In-Reply-To: <20211216230903.2e8e37f7@thinkpad> References: <20211126143738.23830-1-kabel@kernel.org> <20211126143738.23830-9-kabel@kernel.org> <20211214093600.e2sy5yrtpz7gvfna@pali> <20211214104515.2ae03d0d@thinkpad> <20211214111234.ie54zex6veoirfam@pali> <20211214134536.2baeb2a0@thinkpad> <6cf901fd-01d7-6461-18e4-b362a37bac7c@denx.de> <20211214140104.7a410847@thinkpad> <20211216181640.c3aolyfege4675ib@pali> <20211216230903.2e8e37f7@thinkpad> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 16 Dec 2021 23:09:03 +0100 Marek Beh=C3=BAn wrote: > On Thu, 16 Dec 2021 19:16:40 +0100 > Pali Roh=C3=A1r wrote: >=20 > > The reason that it currently works is just because > > gcc compiler does not do all checks before doing optimizations and so it > > currently does generate any errors or warnings. =20 >=20 > Compiler cannot currently check this, only linker, because the function > is always declared in mvebu's cpu.h. >=20 > See https://lore.kernel.org/u-boot/20211214134536.2baeb2a0@thinkpad/ > where I also proposed empty static inline implementations for non-A375 > platforms, but Stefan thinks it's not an issue currently, because it > does not cause any regressions, I guess. U-Boot's build system > currently does not allow for -O0, you can choose only -O2 or -Os. >=20 > We can always add empty static inline implementations into mvebu's > cpu.h when it becomes an issue, or you can send a patch now, if you > want a completely perfect code ASAP. >=20 > But note that for that you'll need to check other functions there, as > well. (If you look at > https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/mach-mvebu/= include/mach/cpu.h > there are functions declared, without guarding #ifs, for all mvebu > platforms: A3k, A7k, A37x and A38x.) And btw, I just tried forcing -O0, and didn't even get to SPL compiling stage. U-Boot proper didn't failed to link with: undefined reference to `of_read_u32_index' undefined reference to `of_read_u64' undefined reference to `of_find_property' undefined reference to `of_read_u32_array' undefined reference to `of_device_is_available' undefined reference to `of_get_parent' undefined reference to `of_get_address' undefined reference to `of_n_size_cells' undefined reference to `of_translate_address' undefined reference to `of_n_addr_cells' undefined reference to `of_property_match_string' undefined reference to `of_parse_phandle_with_args' undefined reference to `of_count_phandle_with_args' undefined reference to `of_find_node_opts_by_path' undefined reference to `of_get_property' undefined reference to `of_device_is_available' undefined reference to `of_get_property' undefined reference to `of_simple_addr_cells' undefined reference to `of_simple_size_cells' undefined reference to `of_device_is_compatible' undefined reference to `of_get_stdout' Since no-one noticed this till now, I would bet the reality is that -O0 really isn't done, and if someone really needs it, they will have to fix other things as well. Also with -O0 I think SPL would be too big so you won't be able to test it anyway. Although you could study generated and linked assembler code, but why would you do that? You can just disassemble the object file. Marek