From patchwork Fri May 17 22:09:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 1936638 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm1 header.b=CBMpy1m0; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=XfedN0to; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (unknown [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vh1NT5KxHz20KJ for ; Sat, 18 May 2024 08:10:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB0638857D; Sat, 18 May 2024 00:09:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=flygoat.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=flygoat.com header.i=@flygoat.com header.b="CBMpy1m0"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="XfedN0to"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05D3D87DEA; Sat, 18 May 2024 00:09:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from fout4-smtp.messagingengine.com (fout4-smtp.messagingengine.com [103.168.172.147]) (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 A69F987E9B for ; Sat, 18 May 2024 00:09:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jiaxun.yang@flygoat.com Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id BED0A138006B; Fri, 17 May 2024 18:09:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 17 May 2024 18:09:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1715983771; x=1716070171; bh=4YJ3AZ6ryMEndiQEyVK2gZCzZw64TU+PEaTotcB/Agc=; b= CBMpy1m0WKnFUhFdYGAIk3lE4VrQexskm/BGmrt6j5VyqEdfoQJQu409zyRVFrHk SHC7tvR4F97BShyxD+6iwSoA3Men6lHSllsIP9TeElWrLc+0DQpAU6rdhelu2Mj4 I2PWGGwto7+s70a76MNlvfo/mJlHw/QBn63FUze1wdMc2c08qEmfCk3LgW1h0wq/ xQUpyjH0Fp9zrGDYG7kEV4laTUs1xgAOFY1IXcDs0lalMAI811qu8s2S/kr7Dze7 F1RaDzo3Bvif9nFQOJlnUGLXSk/shD30gs5mVlDh3TugtFdsEh66WKMe9v31EYSc wUdASvLs1101d5/V3wP8uw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715983771; x= 1716070171; bh=4YJ3AZ6ryMEndiQEyVK2gZCzZw64TU+PEaTotcB/Agc=; b=X fedN0to1gjuVXirWsOLpbN4UitwohdsjN0AqFct936UZ3PnL5HNrDyppUxCduCJw csfO78CCN1nuhFhcJqFxbBP8KHaLKZk5UOBSTPBmIEy0nELk3jcr8GNUuC5i8BOY 6q2wWTvbbDvUaH22e3Y5+0rw3zj/lUQ9yrzI1H5nka64gdsI9Yu5eI6HGFZxp0N6 tX0a8hqf4OraMm9vWdkGb9Dyh9b2gEJJyp+SNmlCZtpkbqCdvWMl3PUJXpA06bLS L2V9cff82o/VjeQ+E/RHWJ9LqG//FXrTBPzqV9ATm1OJci8uM+LIwdvfLFkBuF09 d8mJEqPdah9mkAzLcLiKg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehhedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhephfdufefhkeeuhffhleehudellefhkedvffduteehgfduieef gfeltdegueekleevnecuffhomhgrihhnpegtrhhttdgpshgrnhgusghogigpvghfihdrsh gsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhi rgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 May 2024 18:09:30 -0400 (EDT) From: Jiaxun Yang Date: Fri, 17 May 2024 23:09:27 +0100 Subject: [PATCH 1/3] sandbox: Move HOST_ARCH detection to Kconfig MIME-Version: 1.0 Message-Id: <20240517-sandbox-hostarch-kconfig-v1-1-716c146635c9@flygoat.com> References: <20240517-sandbox-hostarch-kconfig-v1-0-716c146635c9@flygoat.com> In-Reply-To: <20240517-sandbox-hostarch-kconfig-v1-0-716c146635c9@flygoat.com> To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Jiaxun Yang X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=10629; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=MgF3M1iQLnuEMpuL47mnLqTwJ35Mgxzxhldo75aX+EY=; b=owGbwMvMwCHmXMhTe71c8zDjabUkhjT3q7M68ngX6WQImQiWrd2/7xT/696pH+95JP7xkRNYe KM9MeloRykLgxgHg6yYIkuIgFLfhsaLC64/yPoDM4eVCWQIAxenAEykOJDhnwbfv/M5kwoe8yZ1 XPjtF8P/SGfOpKmHfp3jkC96vGBfVTwjwyPrFY2JAUZ3jlq8zbJbtG+pqe3GTdPLipWW/C8yPvN 2CS8A X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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.8 at phobos.denx.de X-Virus-Status: Clean Move host arch detection to Kconfig so we can make some options depend on HOST_ARCH. Also now we are using compiler macros to detect target arch, which is more robust than looking at uname -a. Signed-off-by: Jiaxun Yang --- Makefile | 24 --------------------- arch/sandbox/Kconfig | 23 ++++++++++++++++++++ arch/sandbox/config.mk | 12 +++++------ arch/sandbox/lib/crt0_sandbox_efi.S | 14 ++++++------ arch/sandbox/lib/reloc_sandbox_efi.c | 14 ++++++------ include/efi_default_filename.h | 14 ++++++------ include/host_arch.h | 26 ----------------------- lib/efi_selftest/efi_selftest_miniapp_exception.c | 6 +++--- 8 files changed, 53 insertions(+), 80 deletions(-) diff --git a/Makefile b/Makefile index 44deb339af19..596f6458e6b2 100644 --- a/Makefile +++ b/Makefile @@ -16,29 +16,6 @@ NAME = # (this increases performance and avoids hard-to-debug behaviour) MAKEFLAGS += -rR -# Determine target architecture for the sandbox -include include/host_arch.h -ifeq ("", "$(CROSS_COMPILE)") - MK_ARCH="${shell uname -m}" -else - MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}" -endif -unexport HOST_ARCH -ifeq ("x86_64", $(MK_ARCH)) - export HOST_ARCH=$(HOST_ARCH_X86_64) -else ifneq (,$(findstring $(MK_ARCH), "i386" "i486" "i586" "i686")) - export HOST_ARCH=$(HOST_ARCH_X86) -else ifneq (,$(findstring $(MK_ARCH), "aarch64" "armv8l")) - export HOST_ARCH=$(HOST_ARCH_AARCH64) -else ifneq (,$(findstring $(MK_ARCH), "arm" "armv7" "armv7a" "armv7l")) - export HOST_ARCH=$(HOST_ARCH_ARM) -else ifeq ("riscv32", $(MK_ARCH)) - export HOST_ARCH=$(HOST_ARCH_RISCV32) -else ifeq ("riscv64", $(MK_ARCH)) - export HOST_ARCH=$(HOST_ARCH_RISCV64) -endif -undefine MK_ARCH - # Avoid funny character set dependencies unexport LC_ALL LC_COLLATE=C @@ -1963,7 +1940,6 @@ define filechk_version.h echo \#define U_BOOT_VERSION_NUM $(VERSION); \ echo \#define U_BOOT_VERSION_NUM_PATCH $$(echo $(PATCHLEVEL) | \ sed -e "s/^0*//"); \ - echo \#define HOST_ARCH $(HOST_ARCH); \ echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \ echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; ) endef diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 1c8353d6156d..c3954e33aceb 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -47,6 +47,29 @@ config HOST_32BIT config HOST_64BIT def_bool $(cc-define,_LP64) +config HOST_ARCH_X86 + def_bool $(cc-define,__i386__) + +config HOST_ARCH_X86_64 + def_bool $(cc-define,__x86_64__) + +config HOST_ARCH_ARM + def_bool $(cc-define,__arm__) + +config HOST_ARCH_AARCH64 + def_bool $(cc-define,__aarch64__) + +config HOST_ARCH_RISCV32 + def_bool $(cc-define,__riscv_xlen 32) + +config HOST_ARCH_RISCV64 + def_bool $(cc-define,__riscv_xlen 64) + +config HOST_ARCH_UNKNOWN + def_bool !HOST_ARCH_X86 && !HOST_ARCH_X86_64 && \ + !HOST_ARCH_ARM && !HOST_ARCH_AARCH64 && \ + !HOST_ARCH_RISCV32 && !HOST_ARCH_RISCV64 + config HOST_HAS_SDL def_bool $(success,sdl2-config --version) diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 405843800e9e..6b1da993ba4e 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -44,27 +44,27 @@ cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T u-boot-spl.lds \ -Wl,--no-whole-archive \ $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections) -ifeq ($(HOST_ARCH),$(HOST_ARCH_X86_64)) +ifeq ($(CONFIG_HOST_ARCH_X86_64),y) EFI_LDS := ${SRCDIR}/../../../arch/x86/lib/elf_x86_64_efi.lds EFI_TARGET := --target=efi-app-x86_64 -else ifeq ($(HOST_ARCH),$(HOST_ARCH_X86)) +else ifeq ($(CONFIG_HOST_ARCH_X86),y) EFI_LDS := ${SRCDIR}/../../../arch/x86/lib/elf_ia32_efi.lds EFI_TARGET := --target=efi-app-ia32 -else ifeq ($(HOST_ARCH),$(HOST_ARCH_AARCH64)) +else ifeq ($(CONFIG_HOST_ARCH_AARCH64),y) EFI_LDS := ${SRCDIR}/../../../arch/arm/lib/elf_aarch64_efi.lds OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \ -j __u_boot_list -j .rela.dyn -j .got -j .got.plt \ -j .binman_sym_table -j .text_rest \ -j .efi_runtime -j .efi_runtime_rel -else ifeq ($(HOST_ARCH),$(HOST_ARCH_ARM)) +else ifeq ($(CONFIG_HOST_ARCH_ARM),y) EFI_LDS := ${SRCDIR}/../../../arch/arm/lib/elf_arm_efi.lds OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \ -j .data -j .got -j .got.plt -j __u_boot_list -j .rel.dyn \ -j .binman_sym_table -j .text_rest \ -j .efi_runtime -j .efi_runtime_rel -else ifeq ($(HOST_ARCH),$(HOST_ARCH_RISCV32)) +else ifeq ($(CONFIG_HOST_ARCH_RISCV32),y) EFI_LDS := ${SRCDIR}/../../../arch/riscv/lib/elf_riscv32_efi.lds -else ifeq ($(HOST_ARCH),$(HOST_ARCH_RISCV64)) +else ifeq ($(CONFIG_HOST_ARCH_RISCV64),y) EFI_LDS := ${SRCDIR}/../../../arch/riscv/lib/elf_riscv64_efi.lds endif EFI_CRT0 := crt0_sandbox_efi.o diff --git a/arch/sandbox/lib/crt0_sandbox_efi.S b/arch/sandbox/lib/crt0_sandbox_efi.S index 88537345ddb3..ffac3520f7df 100644 --- a/arch/sandbox/lib/crt0_sandbox_efi.S +++ b/arch/sandbox/lib/crt0_sandbox_efi.S @@ -5,28 +5,28 @@ * Copyright (c) 2019 Heinrich Schuchardt */ -#include +#include -#if HOST_ARCH == HOST_ARCH_X86_64 +#if CONFIG_IS_ENABLED(HOST_ARCH_X86_64) #include "../../../arch/x86/lib/crt0_x86_64_efi.S" #endif -#if HOST_ARCH == HOST_ARCH_X86 +#if CONFIG_IS_ENABLED(HOST_ARCH_X86) #include "../../../arch/x86/lib/crt0_ia32_efi.S" #endif -#if HOST_ARCH == HOST_ARCH_AARCH64 +#if CONFIG_IS_ENABLED(HOST_ARCH_AARCH64) #include "../../../arch/arm/lib/crt0_aarch64_efi.S" #endif -#if HOST_ARCH == HOST_ARCH_ARM +#if CONFIG_IS_ENABLED(HOST_ARCH_ARM) #include "../../../arch/arm/lib/crt0_arm_efi.S" #endif -#if HOST_ARCH == HOST_ARCH_RISCV32 +#if CONFIG_IS_ENABLED(HOST_ARCH_RISCV32) #include "../../../arch/riscv/lib/crt0_riscv_efi.S" #endif -#if HOST_ARCH == HOST_ARCH_RISCV64 +#if CONFIG_IS_ENABLED(HOST_ARCH_RISCV64) #include "../../../arch/riscv/lib/crt0_riscv_efi.S" #endif diff --git a/arch/sandbox/lib/reloc_sandbox_efi.c b/arch/sandbox/lib/reloc_sandbox_efi.c index a21e6757c551..b88c427b5f74 100644 --- a/arch/sandbox/lib/reloc_sandbox_efi.c +++ b/arch/sandbox/lib/reloc_sandbox_efi.c @@ -5,28 +5,28 @@ * Copyright (c) 2019 Heinrich Schuchardt */ -#include +#include -#if HOST_ARCH == HOST_ARCH_X86_64 +#if CONFIG_IS_ENABLED(HOST_ARCH_X86_64) #include "../../../arch/x86/lib/reloc_x86_64_efi.c" #endif -#if HOST_ARCH == HOST_ARCH_X86 +#if CONFIG_IS_ENABLED(HOST_ARCH_X86) #include "../../../arch/x86/lib/reloc_ia32_efi.c" #endif -#if HOST_ARCH == HOST_ARCH_AARCH64 +#if CONFIG_IS_ENABLED(HOST_ARCH_AARCH64) #include "../../../arch/arm/lib/reloc_aarch64_efi.c" #endif -#if HOST_ARCH == HOST_ARCH_ARM +#if CONFIG_IS_ENABLED(HOST_ARCH_ARM) #include "../../../arch/arm/lib/reloc_arm_efi.c" #endif -#if HOST_ARCH == HOST_ARCH_RISCV32 +#if CONFIG_IS_ENABLED(HOST_ARCH_RISCV32) #include "../../../arch/riscv/lib/reloc_riscv_efi.c" #endif -#if HOST_ARCH == HOST_ARCH_RISCV64 +#if CONFIG_IS_ENABLED(HOST_ARCH_RISCV64) #include "../../../arch/riscv/lib/reloc_riscv_efi.c" #endif diff --git a/include/efi_default_filename.h b/include/efi_default_filename.h index 77932984b557..480fa694b6a9 100644 --- a/include/efi_default_filename.h +++ b/include/efi_default_filename.h @@ -11,23 +11,23 @@ #ifndef _EFI_DEFAULT_FILENAME_H #define _EFI_DEFAULT_FILENAME_H -#include +#include #undef BOOTEFI_NAME #ifdef CONFIG_SANDBOX -#if HOST_ARCH == HOST_ARCH_X86_64 +#if CONFIG_IS_ENABLED(HOST_ARCH_X86_64) #define BOOTEFI_NAME "BOOTX64.EFI" -#elif HOST_ARCH == HOST_ARCH_X86 +#elif CONFIG_IS_ENABLED(HOST_ARCH_X86) #define BOOTEFI_NAME "BOOTIA32.EFI" -#elif HOST_ARCH == HOST_ARCH_AARCH64 +#elif CONFIG_IS_ENABLED(HOST_ARCH_AARCH64) #define BOOTEFI_NAME "BOOTAA64.EFI" -#elif HOST_ARCH == HOST_ARCH_ARM +#elif CONFIG_IS_ENABLED(HOST_ARCH_ARM) #define BOOTEFI_NAME "BOOTARM.EFI" -#elif HOST_ARCH == HOST_ARCH_RISCV32 +#elif CONFIG_IS_ENABLED(HOST_ARCH_RISCV32) #define BOOTEFI_NAME "BOOTRISCV32.EFI" -#elif HOST_ARCH == HOST_ARCH_RISCV64 +#elif CONFIG_IS_ENABLED(HOST_ARCH_RISCV64) #define BOOTEFI_NAME "BOOTRISCV64.EFI" #else #error Unsupported UEFI architecture diff --git a/include/host_arch.h b/include/host_arch.h deleted file mode 100644 index 261194bd7c6e..000000000000 --- a/include/host_arch.h +++ /dev/null @@ -1,26 +0,0 @@ -#if 0 -# SPDX SPDX-License-Identifier: GPL-2.0+ -# -# Constants defining the host architecture in assembler, C, and make files. -# The values are arbitrary. -# -# Copyright 2019 Heinrich Schuchardt -#endif - -#if 0 -export HOST_ARCH_AARCH64=0xaa64 -export HOST_ARCH_ARM=0x00a7 -export HOST_ARCH_RISCV32=0x5032 -export HOST_ARCH_RISCV64=0x5064 -export HOST_ARCH_X86=0x0386 -export HOST_ARCH_X86_64=0x8664 -#endif - -#include - -#define HOST_ARCH_AARCH64 0xaa64 -#define HOST_ARCH_ARM 0x00a7 -#define HOST_ARCH_RISCV32 0x5032 -#define HOST_ARCH_RISCV64 0x5064 -#define HOST_ARCH_X86 0x0386 -#define HOST_ARCH_X86_64 0x8664 diff --git a/lib/efi_selftest/efi_selftest_miniapp_exception.c b/lib/efi_selftest/efi_selftest_miniapp_exception.c index f668cdac4ab2..2dfbb7c74075 100644 --- a/lib/efi_selftest/efi_selftest_miniapp_exception.c +++ b/lib/efi_selftest/efi_selftest_miniapp_exception.c @@ -36,11 +36,11 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, #elif defined(CONFIG_X86) asm volatile (".word 0xffff\n"); #elif defined(CONFIG_SANDBOX) -#if (HOST_ARCH == HOST_ARCH_ARM || HOST_ARCH == HOST_ARCH_AARCH64) +#if (CONFIG_IS_ENABLED(HOST_ARCH_ARM) || CONFIG_IS_ENABLED(HOST_ARCH_AARCH64)) asm volatile (".word 0xe7f7defb\n"); -#elif (HOST_ARCH == HOST_ARCH_RISCV32 || HOST_ARCH == HOST_ARCH_RISCV64) +#elif (CONFIG_IS_ENABLED(HOST_ARCH_RISCV32) || CONFIG_IS_ENABLED(HOST_ARCH_RISCV64)) asm volatile (".word 0xffffffff\n"); -#elif (HOST_ARCH == HOST_ARCH_X86 || HOST_ARCH == HOST_ARCH_X86_64) +#elif (CONFIG_IS_ENABLED(HOST_ARCH_X86) || CONFIG_IS_ENABLED(HOST_ARCH_X86_64)) asm volatile (".word 0xffff\n"); #endif #endif From patchwork Fri May 17 22:09:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 1936639 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm1 header.b=MsxYFTta; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=lE19xbJD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vh1NY2PC7z20KJ for ; Sat, 18 May 2024 08:10:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51950885E4; Sat, 18 May 2024 00:09:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=flygoat.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=flygoat.com header.i=@flygoat.com header.b="MsxYFTta"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="lE19xbJD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A28B1885DC; Sat, 18 May 2024 00:09:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from fout4-smtp.messagingengine.com (fout4-smtp.messagingengine.com [103.168.172.147]) (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 CB6A2882CF for ; Sat, 18 May 2024 00:09:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jiaxun.yang@flygoat.com Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id E7A8A13814EF; Fri, 17 May 2024 18:09:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 17 May 2024 18:09:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1715983772; x=1716070172; bh=f9RJ36sX8SAsAspZh86VjaznR7vuuOOF017xPEwY1Zc=; b= MsxYFTtayNm171SKbKdHW5jo70cJgQrqWOtbOWgWfojqwVnMR6Z/grPqmqFYTrxo ffbh3jS7JdATVYeXQ21ciVeSrgVLb0PlHkZMulzBbCxJtdOFz3EPi6UrGZm/YzSw qjBwAlESCKUaido1rVILMSMIIe7BXLTUXAnO+aIQaiXEOxw+frhGTI050NfKSkTk y7d/ChV9QdZRlIWYtidPAnKgRQ3K1wZ6zFBuFk8oGL5Epm8VtaOSt5KlrFbwPLiH 6YSV1xmvMR7rmCjwc9B+BZBIE7SnqY7ecLVBJDavPorXI1kFf6sj8jwg1K8inTuZ hHBZeeyi0ydU5gw+sj7PHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715983772; x= 1716070172; bh=f9RJ36sX8SAsAspZh86VjaznR7vuuOOF017xPEwY1Zc=; b=l E19xbJDh4N2t02UPGlQ15arrEGIMJCN/N0uCWZoK8ng9uu6dkaO55WIfLV7L/lRL 2xE3CTFtXoccuLOWS8jN54NMuUDsXU7iXVBBaINFT1eSkUOuKDhAsVHiczV/ailu Ldwkn35IdSw0AHPORRLDSfl5yGtO8zJvUT4nsDf7zcCdE7+xEQJC07G4VHya1zEK YAwzTz2GtPDeguUjq4lSyyAlZG5+8e82Dhpoq3WDREkLQElNZ3Sh7e87PbVskiTA LV3AD8kgVsOx5U1YbyWDuUuMK9TF7oU4Sk7VGQA6/1eYnp8i+bsT/5CJIbMeD3I1 cL86/DKCpRgW9ckJn0AlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehhedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 May 2024 18:09:31 -0400 (EDT) From: Jiaxun Yang Date: Fri, 17 May 2024 23:09:28 +0100 Subject: [PATCH 2/3] EFI: Make EFI loader depend sandbox HOST_ARCH MIME-Version: 1.0 Message-Id: <20240517-sandbox-hostarch-kconfig-v1-2-716c146635c9@flygoat.com> References: <20240517-sandbox-hostarch-kconfig-v1-0-716c146635c9@flygoat.com> In-Reply-To: <20240517-sandbox-hostarch-kconfig-v1-0-716c146635c9@flygoat.com> To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Jiaxun Yang X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1118; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=rEmujuOwsi/1eJM03/w+0Z/Zuzk9b/dzlFtnuX+I1qA=; b=owGbwMvMwCHmXMhTe71c8zDjabUkhjT3q7NuTZMsshZ4MfdT1ZbJd52+hNmfN/U3OnPqeP0Et RPCHJVuHaUsDGIcDLJiiiwhAkp9GxovLrj+IOsPzBxWJpAhDFycAjARt6sM/9NftG/Zp7V+edYh Z8fIjYVPBbd/ENhoM7d395w7pYpLN9oxMuzbn+i7Zt69NwfOeHTYLDhVefFWmf3l94c3Ktp22b0 oOsEDAA== X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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.8 at phobos.denx.de X-Virus-Status: Clean Since EFI loader on sandbox requires some architecture code, make it depend on HOST_ARCH to ensure it's only compiled on desired host. Signed-off-by: Jiaxun Yang --- lib/efi_loader/Kconfig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 430bb7f0f7dc..54d180fe31c1 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -1,11 +1,14 @@ config EFI_LOADER bool "Support running UEFI applications" - depends on OF_LIBFDT && ( \ + depends on OF_LIBFDT && (( \ ARM && (SYS_CPU = arm1136 || \ SYS_CPU = arm1176 || \ SYS_CPU = armv7 || \ SYS_CPU = armv8) || \ - X86 || RISCV || SANDBOX) + X86 || RISCV) || \ + (SANDBOX && (HOST_ARCH_X86 || HOST_ARCH_X86_64 || \ + HOST_ARCH_ARM || HOST_ARCH_AARCH64 || \ + HOST_ARCH_RISCV32 || HOST_ARCH_RISCV64))) # We need EFI_STUB_64BIT to be set on x86_64 with EFI_STUB depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB From patchwork Fri May 17 22:09:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 1936640 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=flygoat.com header.i=@flygoat.com header.a=rsa-sha256 header.s=fm1 header.b=L2qOTx/P; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=QfibnVHC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vh1Nj2tlhz20KF for ; Sat, 18 May 2024 08:10:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA7EF885E9; Sat, 18 May 2024 00:09:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=flygoat.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=flygoat.com header.i=@flygoat.com header.b="L2qOTx/P"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="QfibnVHC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 484B087DEA; Sat, 18 May 2024 00:09:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from fhigh1-smtp.messagingengine.com (fhigh1-smtp.messagingengine.com [103.168.172.152]) (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 2FE1A87DEA for ; Sat, 18 May 2024 00:09:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jiaxun.yang@flygoat.com Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 1C0131140091; Fri, 17 May 2024 18:09:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 17 May 2024 18:09:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1715983774; x=1716070174; bh=t8l/7y4mhZg6+xdS8K6hKjbj9GufHDzDVYvDwzl2qC8=; b= L2qOTx/PlxTuqQxE236lpv++gjYvf6bIuja8TanYmM/1EAcoLsgtU7J2LsJdtgig gEltnC1v86a5mU3Y9Vrz8R2QBRJKgR5F/Y0klt/w4aV6nvjhHGRirLMLy+6MZw5v 9eB6hTfZe8++14TRHUVrflNbz9Gos7av4VaXQdKpEvaiML+SMc1P3dSmxYInkr5Z 5kBDPc2PH1TgnVVCsUp0rTfWZ/28qVzZ1VL/37KNidxbjNJCWBILTydLXcEEkXow IpzjCAQgxgURmzXTWOi8tq2/Pt8Lr95Phg6QRV+jqEdS2ybJ3l5KBSzofH2sWazY ccaYVjuLZu0WkXzzcXAFKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1715983774; x= 1716070174; bh=t8l/7y4mhZg6+xdS8K6hKjbj9GufHDzDVYvDwzl2qC8=; b=Q fibnVHCljjG4hxOKkdP7bnsxlOCmn1XEfRvG4UMabE0KxAHmDUezMhTO2mA9gzUa AAmcUSVnunCNGI7dAqiPsyTYOlOBI+83SXfSVTXV8sXeWiTIyaIZTCHHZbFxTqdn YUo9w0EjCSyHD4BeP0ErX0tj1z5ti4O8lkJmgWfF6ahut2PYYN3cAUJQECXpd0Nh bX+lShlBDw4MBSXBeHFIoGy5ANtEjhI1MUv7yyrSqrGeOFCzvMzpiJY7yYL4XFRU 4AUKy0b00ZcVMaib41pYqF1ESQpQmSI5LBJhRuefBlVUSmsvOosiR76Nu3gVIFiy rnQhFIp1IqG47MT7Yr8SA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehhedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 May 2024 18:09:33 -0400 (EDT) From: Jiaxun Yang Date: Fri, 17 May 2024 23:09:29 +0100 Subject: [PATCH 3/3] sandbox: Use pkg-config to detect and config sdl2 MIME-Version: 1.0 Message-Id: <20240517-sandbox-hostarch-kconfig-v1-3-716c146635c9@flygoat.com> References: <20240517-sandbox-hostarch-kconfig-v1-0-716c146635c9@flygoat.com> In-Reply-To: <20240517-sandbox-hostarch-kconfig-v1-0-716c146635c9@flygoat.com> To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Jiaxun Yang X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3337; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=ZrV0I6ONEy/uVoeFco/sTMAFFoRNqDYU80b/rQwKFlk=; b=owGbwMvMwCHmXMhTe71c8zDjabUkhjT3q7P03HxaHRcYnYzwW2Oy1bpasSv4y/LPyX3/hJ2OC P5/MedrRykLgxgHg6yYIkuIgFLfhsaLC64/yPoDM4eVCWQIAxenAEyEQYbhf3Z+zMqLZaffP+pf uW5W3KuSZlOx1sOtj1/odP478GyCjzsjw/ppJxNWyN8w25bcGMP5p1bZ+N5OtuSjX5c+13Lllpl VxAEA X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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.8 at phobos.denx.de X-Virus-Status: Clean sdl2-config is not cross compile friendly, it can only detect and config stuff from build host. Use pkg-config instead, which is a generic way to config libraries on any sane system & cross toolchain should have it ready. The output of pkg-config practically have no difference with sdl2-config. Signed-off-by: Jiaxun Yang --- Makefile | 3 ++- arch/sandbox/Kconfig | 2 +- arch/sandbox/config.mk | 5 ++--- doc/arch/sandbox/sandbox.rst | 6 ------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 596f6458e6b2..5e397e107a80 100644 --- a/Makefile +++ b/Makefile @@ -383,6 +383,7 @@ LDR = $(CROSS_COMPILE)ldr STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump +PKG_CONFIG = $(CROSS_COMPILE)pkg-config LEX = flex YACC = bison AWK = awk @@ -439,7 +440,7 @@ UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SU export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR -export CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC +export CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC PKG_CONFIG export CPP AR NM LDR STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS export MAKE LEX YACC AWK PERL PYTHON PYTHON2 PYTHON3 export HOSTCXX KBUILD_HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index c3954e33aceb..5af074e3e700 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -71,7 +71,7 @@ config HOST_ARCH_UNKNOWN !HOST_ARCH_RISCV32 && !HOST_ARCH_RISCV64 config HOST_HAS_SDL - def_bool $(success,sdl2-config --version) + def_bool $(success,$(PKG_CONFIG) sdl2) config SANDBOX_SDL bool "Enable SDL2 support in sandbox" diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 6b1da993ba4e..94c11fd78918 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -4,13 +4,12 @@ PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE PLATFORM_CPPFLAGS += -fPIC -ffunction-sections -fdata-sections PLATFORM_LIBS += -lrt -SDL_CONFIG ?= sdl2-config # Define this to avoid linking with SDL, which requires SDL libraries # This can solve 'sdl-config: Command not found' errors ifeq ($(CONFIG_SANDBOX_SDL),y) -PLATFORM_LIBS += $(shell $(SDL_CONFIG) --libs) -PLATFORM_CPPFLAGS += $(shell $(SDL_CONFIG) --cflags) +PLATFORM_LIBS += $(shell $(PKG_CONFIG) sdl2 --libs) +PLATFORM_CPPFLAGS += $(shell $(PKG_CONFIG) sdl2 --cflags) endif SANITIZERS := diff --git a/doc/arch/sandbox/sandbox.rst b/doc/arch/sandbox/sandbox.rst index 5f8db126657f..9ad1b654989c 100644 --- a/doc/arch/sandbox/sandbox.rst +++ b/doc/arch/sandbox/sandbox.rst @@ -526,12 +526,6 @@ For debugging with GDB or LLDB, it is preferable to reduce the compiler optimization level (CONFIG_CC_OPTIMIZE_FOR_DEBUG=y) and to disable Link Time Optimization (CONFIG_LTO=n). -SDL_CONFIG ----------- - -If sdl-config is on a different path from the default, set the SDL_CONFIG -environment variable to the correct pathname before building U-Boot. - Using valgrind / memcheck -------------------------