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 427E9ECAAA1 for ; Fri, 28 Oct 2022 16:20:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DCFB185087; Fri, 28 Oct 2022 18:20:23 +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="nw4/RiwP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C43508504E; Fri, 28 Oct 2022 18:20:22 +0200 (CEST) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (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 6A74E84F17 for ; Fri, 28 Oct 2022 18:20:20 +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=max.oss.09@gmail.com Received: by mail-ej1-x62a.google.com with SMTP id ud5so14132341ejc.4 for ; Fri, 28 Oct 2022 09:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7xB0H1DwRgEkn3/xDPq05dYiQ9GZouPw98phwKVDGus=; b=nw4/RiwPbhqNM0BX4/TxN1WMYE7oDc61iRfhDO+/8Td54nTCpEsj1hMHBPwqgSsbZZ FuvyNAFcg1VwEVbwLh/ZOjaOPveO5eo2gyqnSJL9T21CXc8ltSSgahShBfpyWliQj/v7 F/pMgWiwD8Ep8TFXDcF6PQULW2HxSBs7cas8pYxZX4SAyki26f3cfZlOciIBQClFQGHz mrEfAYjnQ4yE7nf/psJL5yvFj6LAlYjlaUZ7gdyAn59ohUDobrpaMOiPbuhr6kbxIB0p 3MBcjNdMZ752oISLwem3BUyw5WIrmMNQB4FS2F6b6TmZldtOf8zPPQR1OV7jd6YKYr+V EUGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7xB0H1DwRgEkn3/xDPq05dYiQ9GZouPw98phwKVDGus=; b=mMTkYC9KXhTdM78gLlyJ3TStj0kyUnMiFPqGk0egBK7mHAde97T8gJcK6VRThp3+Rn xHNZ0KFFauRDnKXNJZM3yAGCY9ddOYrCfIm5KyXPEBcQNTvLnBHdzQtF5XbfNKbVpa7M Uz7N7hlE3VS5KGglM9ueK21opMhBPpFna7Em0cidnKr0BeSQCsLwbC+0lJWorzply2Kv XuPYhT3WDBfHNkvFHbgXH7wwd+c7nqig1uMMjz7qA6cNHcRkSzHJRGHv1eZ2YD20Pk2G 2dXEKy4j6A+ZHYDH02NDrPeVpVFUEG5LN9eDuwH6R+I7rqmurf9yRrGcoAZGhjlb3wuN 0uqA== X-Gm-Message-State: ACrzQf3Wee8KKDHxlhPF8eDyKxIJUKgbYpzVZDxg+15KND3q0SMivLaT lHigteQXOibU0aZ+Om5oC3rgWdKx5LU= X-Google-Smtp-Source: AMsMyM4Z18SI2db0e7lb+oJ25eoJ8rsbsKKKlJsaGst7jFwfZ5yK7zek4ZFHTued7c7ng4/sKYq6nw== X-Received: by 2002:a17:907:743:b0:740:ef93:2ffc with SMTP id xc3-20020a170907074300b00740ef932ffcmr126671ejb.514.1666974019560; Fri, 28 Oct 2022 09:20:19 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id le5-20020a170907170500b00781e7d364ebsm2458478ejc.144.2022.10.28.09.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 09:20:19 -0700 (PDT) From: Max Krummenacher To: u-boot@lists.denx.de Cc: Tom Rini , U-Boot STM32 , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Adam Ford , Patrick DELAUNAY , Patrice CHOTARD , Max Krummenacher , Heinrich Schuchardt , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Philippe Reynes , Quentin Schulz , Simon Glass Subject: [PATCH v2 0/1] Makefile: rework u-boot-initial-env target Date: Fri, 28 Oct 2022 18:18:48 +0200 Message-Id: <20221028161850.565610-1-max.oss.09@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Max Krummenacher With CONFIG_LTO enabled the current way of extracting the configured environment no longer works, i.e. the object file content changes due to LTO. Build a host tool which prints the configured environment instead of using objcopy and friends to achive the same. The code and Makefile changes were mostly stolen from tools/env/ i.e. the target userspace tools to access the environment. Changes in v2: - reworked to build a host tool which prints the configured environment as proposed by Pali Rohár https://lore.kernel.org/u-boot/20221018174827.1393211-1-max.oss.09@gmail.com/ - renamed patch, v1 used "Makefile: fix u-boot-initial-env target if lto is enabled" Max Krummenacher (1): Makefile: rework u-boot-initial-env target Makefile | 7 ++++--- scripts/.gitignore | 1 + scripts/Makefile | 5 +++++ scripts/printinitialenv.c | 44 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 scripts/printinitialenv.c -- 2.35.3