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 6D6E3C4332F for ; Sat, 15 Oct 2022 07:20:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46F1F84D3D; Sat, 15 Oct 2022 09:20:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de 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=suse.de header.i=@suse.de header.b="WpSkqyeB"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="9zNkxlOI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F18A084DD6; Sat, 15 Oct 2022 09:19:57 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (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 149B884C6F for ; Sat, 15 Oct 2022 09:19:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C10D72270F; Sat, 15 Oct 2022 07:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1665818394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5qhqqe1EZtE/N0irI2BYlrZLkqC7ES5RdHpDwPmnKoA=; b=WpSkqyeBYTcBUHCtZAs1VhZvwfD0vnyEGNEbbQMLYch/HaT35cm81tS5wojxI5cn/X5xHY hpxpbRmD+qV42X19FYkdHjA013lLMJkaoShffjZlQD5NnEkvmHG33qopYAdZk+ukX7xBPi kz5JVPhjBxOgc+IGVhT2HX8NPqbPwfQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1665818394; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5qhqqe1EZtE/N0irI2BYlrZLkqC7ES5RdHpDwPmnKoA=; b=9zNkxlOINJF7Sj6V2fOMWZ53t7SLQZxPmK5lgpzBuafTTOAHB4mSmBdHIgEmnCoQMq1Hrb EI/2M77TKTSOR3Aw== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A4C622C142; Sat, 15 Oct 2022 07:19:54 +0000 (UTC) Date: Sat, 15 Oct 2022 09:19:53 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Heinrich Schuchardt Cc: Simon Glass , u-boot@lists.denx.de Subject: Re: [PATCH v2] tests: Build correct sandbox configuration on 32bit Message-ID: <20221015071953.GK28810@kitsune.suse.cz> References: <20221014205234.19385-1-msuchanek@suse.de> <0943142d-ef2c-b69c-9373-47c562d55aaf@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0943142d-ef2c-b69c-9373-47c562d55aaf@gmx.de> User-Agent: Mutt/1.10.1 (2018-07-13) 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 On Sat, Oct 15, 2022 at 06:54:02AM +0200, Heinrich Schuchardt wrote: > On 10/14/22 22:52, Michal Suchanek wrote: > > Currently sandbox configuration defautls to 64bit and there is no > > automation for building 32bit sandbox on 32bit hosts. > > > > Use _LP64 macro as heuristic for detecting 64bit targets. > > > > Signed-off-by: Michal Suchanek > > Please, explain why you think a Kconfig level patch is preferable to > what I proposed in > > [PATCH] sandbox: Eliminate CONFIG_HOST_32/64BIT > https://lists.denx.de/pipermail/u-boot/2022-October/497236.html The existing dependency canot be described when the option is eliminated: > config SANDBOX64 > bool "Use 64-bit addresses" > select PHYS_64BIT > - select HOST_64BIT > + depends on HOST_64BIT If we can run SANDBOX64 on 32bit eliminating the option is fine. Thanks Michal > > > --- > > > > Changes in v2: > > simplify and move detection to kconfig > > > > --- > > arch/sandbox/Kconfig | 18 +++--------------- > > scripts/Kconfig.include | 4 ++++ > > 2 files changed, 7 insertions(+), 15 deletions(-) > > > > diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig > > index 852a7c8bf2..35508c6b29 100644 > > --- a/arch/sandbox/Kconfig > > +++ b/arch/sandbox/Kconfig > > @@ -13,7 +13,7 @@ config SYS_CPU > > config SANDBOX64 > > bool "Use 64-bit addresses" > > select PHYS_64BIT > > - select HOST_64BIT > > + depends on HOST_64BIT > > > > config SANDBOX_RAM_SIZE_MB > > int "RAM size in MiB" > > @@ -41,23 +41,11 @@ config SYS_CONFIG_NAME > > default "sandbox_spl" if SANDBOX_SPL > > default "sandbox" if !SANDBOX_SPL > > > > -choice > > - prompt "Run sandbox on 32/64-bit host" > > - default HOST_64BIT > > - help > > - Sandbox can be built on 32-bit and 64-bit hosts. > > - The default is to build on a 64-bit host and run > > - on a 64-bit host. If you want to run sandbox on > > - a 32-bit host, change it here. > > - > > config HOST_32BIT > > - bool "32-bit host" > > - depends on !PHYS_64BIT > > + def_bool ! $(cc-define,_LP64) > > > > config HOST_64BIT > > - bool "64-bit host" > > - > > -endchoice > > + def_bool $(cc-define,_LP64) > > > > config SANDBOX_CRASH_RESET > > bool "Reset on crash" > > diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include > > index dad5583451..b7598ca5d9 100644 > > --- a/scripts/Kconfig.include > > +++ b/scripts/Kconfig.include > > This include is copied from Linux. From time to time we synchronize the > Kconfig framework from Linux. So we should avoid U-Boot specific changes > here. > > Best regards > > Heinrich > > > @@ -22,6 +22,10 @@ success = $(if-success,$(1),y,n) > > # Return y if the compiler supports , n otherwise > > cc-option = $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null) > > > > +# $(cc-define,) > > +# Return y if the compiler defines , n otherwise > > +cc-define = $(success,$(CC) -dM -E -x c /dev/null | grep -q '^#define \<$(1)\>') > > + > > # $(ld-option,) > > # Return y if the linker supports , n otherwise > > ld-option = $(success,$(LD) -v $(1)) >