From nobody Wed Dec 17 15:34:58 2025 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EE8013C807 for ; Mon, 15 Jul 2024 20:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721075632; cv=none; b=f8F/R23GCLJuD1X9mfZgCJRxwHoMMsIKC4gR53ICpSXbJhzdu1Q8hid4JJ5RMNgo01BbM9eNynu45oyJhxPJxMqcm3q5d78ppEg0i/kStAtQ1tbI3Q2H5GPIFy/g0fRllc035q5QMSIXHC7UQfma0UOi6FACqSv1W7hwf0WnnZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721075632; c=relaxed/simple; bh=zJomEKpkKYNnqzHoHfBCm5/jn6FvVrqd1kCQ8VySfoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I1Mq9RR2AXi7by4P1BtbxygzISO0UMACvui7wLmfXoNTDlS03QsCFkiv8rtMmdrkSOnbQyYPgRMSEGUYKSQJmM87Xr/z0voflgi4B/WIJt7QwRDI6+yVBcmafnNjqtofQ0pzInd0PlvDeUAPrWwMfADVIaU6WeDd6iIY1m4O6wE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ECa9htMZ; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ECa9htMZ" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-70b2a0542c2so4480705b3a.3 for ; Mon, 15 Jul 2024 13:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1721075629; x=1721680429; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BmXJ/q72ZyRMCe7zWQfBgo3XyY9yIuyVP7WwwEY/t1k=; b=ECa9htMZTvPPFj4L7apDKo76OcnP6ZM6CeYeRnvvTZ7GuaGvb5/QWEddzyAPtITw3N K7QQpFX42SW3d+jphKeTdh2j24mTzsvokGrFK2/y6DblFOUOC2BCdXhODN9C1262OB70 zHGIBHciaJT0a9NJHWlXRkDFT/uq2UTllvN/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721075629; x=1721680429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BmXJ/q72ZyRMCe7zWQfBgo3XyY9yIuyVP7WwwEY/t1k=; b=maClUpg9UJzXV895+nIkrasW3LYBi8PwcHfcd1l5IpHVe5JdcaH3Jp4lvuqYlr5ziS lLNJBqaUBuZiQCwgvmYLh1f7v0G4ITrKf13Y3cqEw5TgicPsdj1nLwvsv1gtgFJtiALn yBafi1TqZFIspDybeRPBKCvKUth22gXMickugMRDzx/e08YwsWJ9P+Zynuhxz8GUvTg6 YdlmENVZXLZ/s+IWqDaYuXk8iHoUbkbhgpbhynJjoCc15vmuvcdMq2EH7BtkWr2N8GNG jh3zIFcQmFmKqoHiPOb+PQk+5JdnGxMzzfBdRXJ4sSDI5Ze1ug+ft33I4TR5/sDI7Y8N f8Dg== X-Gm-Message-State: AOJu0Yz8C7Cne7S3yD+2bx9RLqacupqzpDaShN+NR1YBtqQUqQHWj2+n SddSjRtheeLOsAKJVnJRVSxTGhwqMk8EuKb5OOpa7rznVcPqWKYtQ76yHh1uYQ== X-Google-Smtp-Source: AGHT+IFnk6iBYgvYmylTEhHv/VyQX05gg9m3qIAc6Mgy9YKCKSrAY/jDDld7K1BC1I2BGqTw6voHaQ== X-Received: by 2002:a05:6a21:9985:b0:1c0:dd3d:ef3a with SMTP id adf61e73a8af0-1c3f123ea4amr109721637.29.1721075629670; Mon, 15 Jul 2024 13:33:49 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:9b77:1ea5:9de2:19a3]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1fc0bc4ff41sm44921725ad.272.2024.07.15.13.33.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jul 2024 13:33:49 -0700 (PDT) From: Brian Norris To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Thomas Richter , Josh Poimboeuf , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , bpf@vger.kernel.org, linux-kbuild@vger.kernel.org, Brian Norris Subject: [PATCH v4 2/3] tools build: Avoid circular .fixdep-in.o.cmd issues Date: Mon, 15 Jul 2024 13:32:43 -0700 Message-ID: <20240715203325.3832977-3-briannorris@chromium.org> X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog In-Reply-To: <20240715203325.3832977-1-briannorris@chromium.org> References: <20240715203325.3832977-1-briannorris@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The 'fixdep' tool is used to post-process dependency files for various reasons, and it runs after every object file generation command. This even includes 'fixdep' itself. In Kbuild, this isn't actually a problem, because it uses a single command to generate fixdep (a compile-and-link command on fixdep.c), and afterward runs the fixdep command on the accompanying .fixdep.cmd file. In tools/ builds (which notably is maintained separately from Kbuild), fixdep is generated in several phases: 1. fixdep.c -> fixdep-in.o 2. fixdep-in.o -> fixdep Thus, fixdep is not available in the post-processing for step 1, and instead, we generate .cmd files that look like: ## from tools/objtool/libsubcmd/.fixdep.o.cmd # cannot find fixdep (/path/to/linux/tools/objtool/libsubcmd//fixdep) [...] These invalid .cmd files are benign in some respects, but cause problems in others (such as the linked reports). Because the tools/ build system is rather complicated in its own right (and pointedly different than Kbuild), I choose to simply open-code the rule for building fixdep, and avoid the recursive-make indirection that produces the problem in the first place. Link: https://lore.kernel.org/all/Zk-C5Eg84yt6_nml@google.com/ Signed-off-by: Brian Norris Acked-by: Jiri Olsa Tested-by: Thorsten Leemhuis --- (no changes since v3) Changes in v3: - Drop unnecessary tools/build/Build tools/build/Build | 3 --- tools/build/Makefile | 11 ++--------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 tools/build/Build diff --git a/tools/build/Build b/tools/build/Build deleted file mode 100644 index 76d1a4960973..000000000000 --- a/tools/build/Build +++ /dev/null @@ -1,3 +0,0 @@ -hostprogs :=3D fixdep - -fixdep-y :=3D fixdep.o diff --git a/tools/build/Makefile b/tools/build/Makefile index 17cdf01e29a0..fea3cf647f5b 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -43,12 +43,5 @@ ifneq ($(wildcard $(TMP_O)),) $(Q)$(MAKE) -C feature OUTPUT=3D$(TMP_O) clean >/dev/null endif =20 -$(OUTPUT)fixdep-in.o: FORCE - $(Q)$(MAKE) $(build)=3Dfixdep - -$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o - $(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $< - -FORCE: - -.PHONY: FORCE +$(OUTPUT)fixdep: $(srctree)/tools/build/fixdep.c + $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $< --=20 2.45.2.993.g49e7a77208-goog