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 AD963C43217 for ; Tue, 8 Nov 2022 08:53:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 177AA84DF9; Tue, 8 Nov 2022 09:53:40 +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="DMXtESO0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1EFC384F79; Tue, 8 Nov 2022 09:53:32 +0100 (CET) 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 30ABB84DEB for ; Tue, 8 Nov 2022 09:53:09 +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-x62a.google.com with SMTP id k2so36788348ejr.2 for ; Tue, 08 Nov 2022 00:53:09 -0800 (PST) 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=5u1OpYaPZrxJtzaWHIFrzbbgvj5Zti7pd/jv4Fk6JxQ=; b=DMXtESO0lY5McovsPr1Dj+R/IZmTf9uRf+Mdzcx+SHuL7Y1akEpvdG1iaNFWNOL5i2 7jfv7Nyhgd7EEUmN3b+CjVqjgekAig9qCJNZlCRDD1L6zhtarNt3oYgBzXC2XMGbosS/ x/h1k2QsR1QnfSRu5hak8RRoNFpLCfjTz5nIrvPRocpdzQlwgvMSpOl+rNMWdUfEAMOr Xr3jM0c7l6B1vJPofXWuzw1UusvA6xw4jdmvV+tvzXx8a0bUndniALWjs8M4x8ni2p3B NalJdpxVBd37V3qzSt3sIh3Ldntal1QsJM0WHkPGzTKo4Op2Dr+KVfu4pVoF+qCZCd/W yfEA== 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=5u1OpYaPZrxJtzaWHIFrzbbgvj5Zti7pd/jv4Fk6JxQ=; b=1iep+v8sKlEx3y/Usi2b0cFlooPl9fHEmQf9tuS5WYWqONZGBFoFAW5F/xbI2vM7aX vKSitP5TUzIJQsZnc0MdzEpK5/Q4obFAwxaeOqkwpkCo0MaaWBKqxNK5zb4wf4kT3Uja CWyorpIYH962F0iPhl6L9OkOOFu+YPnfo5Sl6kzXux2fy+D2CaxzhEbnXEV6CWgqUHuR 6ouVsmk6RjpXmn7ytskbDlg/CpRiOx+LghBgwsvtKUdLyexZ5MiROF7RVXzkKo4/OyaN knhF+BwtBe0rPwWQ8pL3jM5uDp7pLn8YjWrmMS0BDFyCZrhlCX2p6O+u89ElM6E0Ik3x O21Q== X-Gm-Message-State: ACrzQf2MueEGJ41ZvOzRXanOIBBnhfda5kuYUl80xuRoWruGrunNTY2v RPN4blRoLFIh+iX+xZQ61wFKe0HHgrE= X-Google-Smtp-Source: AMsMyM61qSazAODzPYCHDrtBvoNG56p00OzqMNS3lpxwN2IqC8F2yK3Gd4bf7cj7bOsJ7T2fpYfFKw== X-Received: by 2002:a17:906:8a47:b0:7a5:8160:19a6 with SMTP id gx7-20020a1709068a4700b007a5816019a6mr53202150ejc.477.1667897588421; Tue, 08 Nov 2022 00:53:08 -0800 (PST) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id s18-20020aa7c552000000b00461c1804cdasm5303628edr.3.2022.11.08.00.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 00:53:08 -0800 (PST) From: Max Krummenacher To: u-boot@lists.denx.de Cc: Patrick DELAUNAY , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Patrice CHOTARD , Tom Rini , U-Boot STM32 , Adam Ford , 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 Subject: [PATCH v4 0/1] Makefile: rework u-boot-initial-env target Date: Tue, 8 Nov 2022 09:52:21 +0100 Message-Id: <20221108085222.1378781-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 v4: - add '(objtree)/' when calling the tool. Suggested by Pali Rohár. - renamed patch, as more than just the Makefile has changes 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): u-boot-initial-env: rework make 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