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 13C05C433FE for ; Mon, 28 Nov 2022 08:41:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A4269851E0; Mon, 28 Nov 2022 09:41:43 +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="ZTvlDom6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF1B9851DC; Mon, 28 Nov 2022 09:41:42 +0100 (CET) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 6980D851DC for ; Mon, 28 Nov 2022 09:41: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=max.oss.09@gmail.com Received: by mail-ed1-x529.google.com with SMTP id d20so3660574edn.0 for ; Mon, 28 Nov 2022 00:41:40 -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=TC0T9OkyLy+fI7+EhilYnNH3p+JlTMoNkHGjGbBu3P8=; b=ZTvlDom66YrwMUrzIDzS3FrQDST3QcC98O806K2xQbZewwfptMsdKLyZT6bBFKI3Ip QpX/J+aZ+OGMq7iF1fNQ3VrE9IQlFS8y2s2NhRqJsEoCxsfDH2vXzmUFJpqj9QLxnK7W BpUNWzuBakAi+1vAgyewpTagbeUivTYJZS9gaas8tb2HboK/nvVxpaUvQtDx4ZkRms3c pvoD2yrtP5oWMZg1V2BKzE0Q+UFv5uDSvJltxNnJkNkgPkLTAXsPrU5j/ukuucYVnC2u O+MZDtbb9uqUD7uRrm7nDMOykRT93qYxBlqYNaHPRKLujsO4metJQ3c0HRN/LK+YHG5e CfIw== 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=TC0T9OkyLy+fI7+EhilYnNH3p+JlTMoNkHGjGbBu3P8=; b=nihoCdAJsq3ZmMNMYrUChXcH5JCyz/ffDj/XGF/atj8YOA18FuxanxtRqnSIh6dM85 bZIAxU6PX7KjVqxB0SZcjOKb7+2QFHri88zeYIsOBMIxcqfKNFjr+6+VZ6UVxNLczjru F3Kjqa74rcuYC/tDQYrOqQ1zMaxhSAzTDlBbRrM+ZHJgXzWchpiy5B4eXLitCFsDY5G2 hXF1kDP7mbUtwa4NWtHA7HBJ+zt2LlRRNYQZEEpwTUYlQx/4wh8OAbDhNK8JNXgKlYRX KHqhsZwuQvrrHssd6eIxbvptOmvrJU1zaKLgi7qWBgs7y7PYJFL6eiIvtk4x4cWvAufS K/Yg== X-Gm-Message-State: ANoB5plkME93RTcQ3qPb4MBkM0yjkSA6g45cthsQtmKi5XxhdjyOdl6z dqyvRePaeSyxPctlsu2HlT1y0HulNGY= X-Google-Smtp-Source: AA0mqf4PRo5tD2rCOkNHi/O19JIXWPz5CnAbOuW2onPptoRordEunrIwVJbl1eCMmtYvgST5maLh5Q== X-Received: by 2002:a05:6402:5021:b0:460:5340:d522 with SMTP id p33-20020a056402502100b004605340d522mr34834518eda.87.1669624899583; Mon, 28 Nov 2022 00:41:39 -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 cd10-20020a170906b34a00b007aa239cf4d9sm4671961ejb.89.2022.11.28.00.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 00:41:39 -0800 (PST) From: Max Krummenacher To: u-boot@lists.denx.de Cc: Adam Ford , =?UTF-8?q?Pali=20Roh=C3=A1r?= , U-Boot STM32 , 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 Subject: [PATCH v5 0/1] Makefile: rework u-boot-initial-env target Date: Mon, 28 Nov 2022 09:41:21 +0100 Message-Id: <20221128084122.3456680-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 v5: - don't build the printinitialenv tool unconditionally but build it only as part of the u-boot-initial-env target. This no longer fails the 'make tools-only_defconfig tools-only' use-case which is reported by Tom Rini. Adding the $(env_h) dependencies to the tools target might give circular dependencies issues with some future tool. - add Acked-by: Pali Rohár 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 | 10 ++++++---- tools/.gitignore | 1 + tools/Makefile | 4 ++++ tools/printinitialenv.c | 44 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 tools/printinitialenv.c -- 2.35.3