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 60E43C433FE for ; Fri, 4 Nov 2022 12:46:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E72BC851B4; Fri, 4 Nov 2022 13:46:01 +0100 (CET) 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="pP9BZZst"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 658E184374; Fri, 4 Nov 2022 13:46:00 +0100 (CET) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 7215D851B4 for ; Fri, 4 Nov 2022 13:45:57 +0100 (CET) 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-x630.google.com with SMTP id f5so12981869ejc.5 for ; Fri, 04 Nov 2022 05:45:57 -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=dauT37ooORUnE2VvxPsPLfo21emq7obUM2DgYST2wh0=; b=pP9BZZstLpvvMTX0rSwF9d5ad2VkWw8wqpaTiKRQHuhiPWOILDvLDj54AR3CYwtKpy VDnqw3+4tjKOnNG88yPGoh8rKQ9s+Gh3BFDFoDPrc/E97Y42CnGox+6VYQ7GNLNbyHx+ Cgc90OeIbZtHULHhXuMMjKi+6nYbdz9Fff8lhGJvx9YuKj8JEkSC8kxPuCr1W8DSUjjq bn/oH2W9qsJu9M+yC3ye3w0sJU2iLu9MHHSYtWWMZDd157wain47gW99H1C99AcyO/pT XsiQ5h6cqPlRU5hSGhl6uE653ISmlzGrJzDTi664fYfHD84yuohT0uT0JMLptoj3ioo3 gPdg== 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=dauT37ooORUnE2VvxPsPLfo21emq7obUM2DgYST2wh0=; b=f4SIcYW98ovgrP1MVHgWc5SlLIYgMY6V1KXxu/+sawTWtGUz9JXHrui3/tMI9IyQkF kZYIiRYreacbq7ClvTCZScznMvgNC4tertAuC1PwujSfRIUlXp9wzPZCCvSb4z5bOlMw GqgnWMfPAqI6GMrRLAorsK+EEnemLo8Mbb/xuPbcZIgoCdmVpe2+NXAQCh5KIFPik98s liT5vijDLySj8nEJntJJA2hPOIFJUqydkmMo4A6/Y/J8kmoLJKmnaMyqAiSWllzDUk93 OHApt+OeqCKpP1Ox2jnPHniSg0Fs8E9K6xUEVonxv+bSlGjZd9dAgZL2nkGz/5nzQGKD FB3g== X-Gm-Message-State: ACrzQf0xsIwXdQeiliu78O24xR9rhF5Md6IGsGO4GbE54/VqbzDbP0Et sM5GsgN0/2yqoIo2gmLcLpohLy19lH8= X-Google-Smtp-Source: AMsMyM6tJgUue+lYGvGG4sj3zmQUkUnNGl+FyKzJu9pr9M3q9DDCahIXwLRG00nh9lb0d3Tg+luWLw== X-Received: by 2002:a17:906:9bee:b0:7ad:c4a1:b8e4 with SMTP id de46-20020a1709069bee00b007adc4a1b8e4mr30384092ejc.283.1667565956611; Fri, 04 Nov 2022 05:45:56 -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 t26-20020aa7db1a000000b0045ce419ecffsm1898105eds.58.2022.11.04.05.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 05:45:56 -0700 (PDT) From: Max Krummenacher To: u-boot@lists.denx.de Cc: Adam Ford , U-Boot STM32 , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Patrick DELAUNAY , Tom Rini , Patrice CHOTARD , Max Krummenacher , AKASHI Takahiro , Du Huanpeng , Heiko Thiery , Heinrich Schuchardt , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Quentin Schulz , Samuel Holland , Simon Glass , Stefan Roese , Weijie Gao Subject: [PATCH v3 0/1] Makefile: rework u-boot-initial-env target Date: Fri, 4 Nov 2022 13:44:56 +0100 Message-Id: <20221104124458.890133-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 v3: - moved the tool from scripts/ to tools/. Suggested by Tom Rini - changed the dependencies to '$(env_h)' and 'tools'. Suggested by Tom Rini and Pali Rohár. - removed the sed rule which replaces \x00 with \x0A as this is already done by the tool. Suggested by Pali Rohár. 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 | 9 +++++---- tools/.gitignore | 1 + tools/Makefile | 3 +++ tools/printinitialenv.c | 44 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 tools/printinitialenv.c -- 2.35.3