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 1C09AC433EF for ; Sat, 12 Mar 2022 05:37:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FF6883AF5; Sat, 12 Mar 2022 06:37:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="WDr3cRzr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 83F9A83AF0; Sat, 12 Mar 2022 06:37:52 +0100 (CET) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 7410583AE6 for ; Sat, 12 Mar 2022 06:37:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x1036.google.com with SMTP id m22so10005246pja.0 for ; Fri, 11 Mar 2022 21:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dwQ/xPrNzGSjTDyCGnJcSAGOIg2KpEpCr6yHfO1TBAs=; b=WDr3cRzrDgawgDdUS1c+x/IMVh0Mc9Ps2eMZNZisXl8GrIgpdtQNBjFBVBK+gz2ekE mSaZTPMVtLivGhAxY41eA7iyXs4sMYJteWcNrF3kgA6PGxvyNZQihJw+7LMxxAB2P7uw NcUu15UTNIIrwkDzqLx8h3Q2hYMSEhOIQCcJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dwQ/xPrNzGSjTDyCGnJcSAGOIg2KpEpCr6yHfO1TBAs=; b=xisaxmIjZ7XGaclgU51UR+GgY2YyCYjF2Jh/v9ckwSZxZIoyXhbkxLRAue8eUQtPbZ 8k5XQvIt3M32rEdSQMM19de3R/AtM60QiDRoB3DUuXvo8YHDUxrhqBWTXuvwrccJisC5 wNKbaziB0TfRDphNdA6O7E5GWWWgxfKXw95d2RWxEUNJpqf+DbXvAawKxPsQl3LLirwV DkhJENV+VTvZt0EJs8aASQwGYuINo2QbOzccxRCsS2u9/zhgWslBDwPQdlLb6OteYKPq ap89uj3hQpbZZ2zNbnKjuoOlWQVct6bz5K/AIEP4iZlSySwWMXXy0VhIB9XMhOGsGc5d hkIg== X-Gm-Message-State: AOAM530ldmTVsrmklg5md9OtNBFk8KD3WJ0VA+T48E6q+GYVVNL/ekt3 F+DJyWo/n40NdrHXw1jOPtZptshaF/YVZvT1vWQ= X-Google-Smtp-Source: ABdhPJwNTR42sRZTpNaaC0/UqhHidfWz2+ybCO6fdw+a1GP9J336FS+4Y1PEEvXOc/vbbT1elmVNVg== X-Received: by 2002:a17:902:bd88:b0:14f:8ddf:e373 with SMTP id q8-20020a170902bd8800b0014f8ddfe373mr13514226pls.89.1647063466558; Fri, 11 Mar 2022 21:37:46 -0800 (PST) Received: from sjg1.wifi.onboard.airnewzealand.com ([161.30.203.8]) by smtp.gmail.com with ESMTPSA id t8-20020a056a00138800b004f724e9fb3esm12682828pfg.89.2022.03.11.21.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 21:37:46 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Sean Anderson , Joe Hershberger , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH] env: Avoid using a leftover text-environment file Date: Fri, 11 Mar 2022 22:37:23 -0700 Message-Id: <20220312053723.517229-1-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.723.g4982287a31-goog MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean If include/generated/environment.h exists (perhaps leftover from a build of another board) it is used, even if the board currently being built does not have a text environment. This causes a build error. Fix it by emptying the file if it should not be there. Fixes: https://source.denx.de/u-boot/u-boot/-/issues/9 Signed-off-by: Simon Glass Reported-by: Sean Anderson --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ef34ca4b7f..2351d6dacd2 100644 --- a/Makefile +++ b/Makefile @@ -1834,7 +1834,9 @@ ENV_FILE := $(if $(ENV_SOURCE_FILE),$(ENV_FILE_CFG),$(wildcard $(ENV_FILE_BOARD) # Run the environment text file through the preprocessor, but only if it is # non-empty, to save time and possible build errors if something is wonky with -# the board +# the board. +# If there is no ENV_FILE, produce an empty output file, to prevent a previous +# build's file being used in the case of in-tree builds. quiet_cmd_gen_envp = ENVP $@ cmd_gen_envp = \ if [ -s "$(ENV_FILE)" ]; then \ @@ -1845,6 +1847,7 @@ quiet_cmd_gen_envp = ENVP $@ -I$(srctree)/arch/$(ARCH)/include \ $< -o $@; \ else \ + rm $@; \ touch $@ ; \ fi include/generated/env.in: include/generated/env.txt FORCE -- 2.35.1.723.g4982287a31-goog