Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp981309lqp; Fri, 22 Mar 2024 01:42:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWA/QhkfvXFLj1A/wQKSfGuh4RMJoOOFlZcvqWLoSavXErTHdVnm7ejh/SpUIK4gpOYVUyl7U8u767RWQBQxfKnufFgoDJv7G2peiTCdQ== X-Google-Smtp-Source: AGHT+IEELlAM4qv6yKtW4gHqp6o/KnheO5kzSO8nvGIFFwZrDeN/+WkxTfS9h6zm4ngoNL7VUsYc X-Received: by 2002:a05:6a21:7883:b0:1a3:5299:1641 with SMTP id bf3-20020a056a21788300b001a352991641mr2493273pzc.0.1711096969791; Fri, 22 Mar 2024 01:42:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711096969; cv=pass; d=google.com; s=arc-20160816; b=RPQYjn6otTHpIhRvee0cUIrck4YCP3vANm+dpucrZowtAvPyYQBh/+ZnOeoI1r2IQA /MzTfhIsxgu8j+5FgYg0kZZJx6q9SXXr1N0dP/0jUnM9SE3fqH6NqVZYbqj8/XQ65axW h3kTf+7hNvoyEg0nqJjwzXU7a1fDcszgRw+pR24Y/sGpmO+LWTWbeTb6EiHCbnI2qIW3 DUpA9qY9tdYe0AtDCCHCaCimudFIYAGgQ1SPkSsGUKA9y8N9G9qJIWeXr5ay9MUW5mlY kR4CdQEZ3r3UwuDbItWnEAMxvfr7iah+sWvdmBlMekCKkDdlYn4JNkO3BBJ8q5fReN1E ZuMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=RfVRqU70Y72Rv1wIQ+6X1hYX0+RSobeFwg5P5ASbHzM=; fh=JFVT1Vvgcbj8U0djnJ84gtaGbGmiFR95yvUoDvH+RUM=; b=tvVlEYWpMqqoN3AcG4ouOhyeJTyBWTH7PWSRNc5i4DJK7xNFHw01zN1ltRkhGMeMHb bEZMgFG0k6my0Qk2lzkyEmtFI4JxTDN2gUNJvCbIsOt/NdodSuCJQ4JESMgBpzmNlpRN kjUGcXBFgQ/z34MvngmdQDNJw+/sONKaLev631/8TkiGPSLAhzZmZePnCutSNxJcGMo8 KHzMvBLIrCrdILHEte6/BSHFKL2nijpwj0rElS0QFaccoW7A6TORKt6D8tHaJQWgR26s GIZWoLMGaTB06M36mMdKaFXZpFCdBgRQzKaHF1qjtKSY8OeFwBGTmZN4AZD4j8ZrCjIL /rPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=HbD1IvwZ; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-111148-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111148-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i18-20020a63d452000000b005dc8bf6237bsi1572899pgj.689.2024.03.22.01.42.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 01:42:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111148-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=HbD1IvwZ; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-111148-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111148-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 50E9FB21AAF for ; Fri, 22 Mar 2024 08:40:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F15501CAA9; Fri, 22 Mar 2024 08:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="HbD1IvwZ" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E79411BDD9; Fri, 22 Mar 2024 08:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711096779; cv=none; b=ZJD+CQaEERVZMwnyFqMwcnhrTgXwIPCKbXOrhtncqX98lCASCqSkg12dkRXpeLFbUut2jNnegfLLNiA3J0HDX4CuSpl01DcaPeKWqvhXg3CIaNKunecpWNTab5YpC2P88oHMoGQpNKjsVTank4MLyOBKNn34t/zQvxcd1fr5s+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711096779; c=relaxed/simple; bh=8qz9C1oFZqtOS8DKNo2scRc67XzoLfuI7Z79A8V/CMs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=DHok/06blzm4XFyFhYaVugFmrOgA3XI+NS/jkuWsMOSFzdalfbhE/PexyinIkjcW0qGCS72cQsV9UqNrvgIgiT5wxSi1YjxA+RMttbhIacaXtllDZ7snGSnJw566tmeK8cd6DUlfx8/x5RcujQ/0YfJqZZfz1jNgTSYuLyOdfXI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=HbD1IvwZ; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1711096379; bh=8qz9C1oFZqtOS8DKNo2scRc67XzoLfuI7Z79A8V/CMs=; h=From:Date:Subject:To:Cc:From; b=HbD1IvwZU+Fa0R5+dXd4Z5PtorJ9kamLlngsQfK0DXHSSogIt7EswCusDU8mv0oyu gqqDARm5PcYZcx9Z9domjyy5fu4OkBPYPRXMiQGYGkAH09iF5Zmt2r4575I3D75+1k CXlr7MqC0963vTRwAT9PxZIv7q23tpRMGhGycHOg= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Fri, 22 Mar 2024 09:31:19 +0100 Subject: [PATCH] kbuild: disable pahole multithreading for reproducible builds Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240322-pahole-reprodicible-v1-1-3eaafb1842da@weissschuh.net> X-B4-Tracking: v=1; b=H4sIANZB/WUC/x3MSwqAMAxF0a1IxhZqrKJuRRz4eWpAbElBBHHvF odncO9DESqI1GUPKS6J4s+EIs9o3sdzg5ElmdiysyWzCePuDxhFUL/ILFOCZbTWwVV1U1Mqg2K V+7/2w/t+PO3FuGUAAAA= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Masahiro Yamada , Nathan Chancellor , Nicolas Schier Cc: bpf@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711096377; l=1459; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=8qz9C1oFZqtOS8DKNo2scRc67XzoLfuI7Z79A8V/CMs=; b=+1w57nbzBpgRD+AXa4yunHz9+Ji2wjrUngukytktGDUCX3+WZfibC3N9MyodM4RVgH+F813g6 SR22gH31hmICRM3DTrBN3/7Gg8xNO/qXW16Ne5R8f5pg+i+KcKkCtIy X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= A BTF type_id is a numeric identifier allocated by pahole through libbpfd. Ids are incremented for each allocation. Running pahole multithreaded makes the sequence of allocations non-deterministic which also makes the type_id itself non-deterministic. As the type_id end up in the binary this breaks reproducibility. Therefore, if the kernel is built reproducibly as indicated by KBUILD_BUILD_TIMESTAMP, disable threading in pahole. Fixes: b4f72786429c ("scripts/pahole-flags.sh: Parse DWARF and generate BTF with multithreading.") Fixes: 72d091846de9 ("kbuild: avoid too many execution of scripts/pahole-flags.sh") Signed-off-by: Thomas Weißschuh --- scripts/Makefile.btf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf index 82377e470aed..2356929e62e4 100644 --- a/scripts/Makefile.btf +++ b/scripts/Makefile.btf @@ -10,7 +10,10 @@ endif pahole-flags-$(call test-ge, $(pahole-ver), 121) += --btf_gen_floats +# threaded execution randomizes BTF type_id allocation, breaking reproducibility +ifeq ($(KBUILD_BUILD_TIMESTAMP),) pahole-flags-$(call test-ge, $(pahole-ver), 122) += -j +endif pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust --- base-commit: 8e938e39866920ddc266898e6ae1fffc5c8f51aa change-id: 20240322-pahole-reprodicible-02e904e45686 Best regards, -- Thomas Weißschuh