From nobody Wed Dec 17 08:53:09 2025 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 018193C6BA; Sun, 11 May 2025 06:02:42 +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=1746943369; cv=none; b=HrDHqPmOx9Mk8MKrs5wp17OX+Md0+5RvcNajftiG+wW0vdIT14c3ZfEGtacANv3T4b9xgcxTzINt39gSVFNhVEQjj94mCrkzMm+WhBsWEQxsNWfZw2FOEezFH+YjhLowuB86tE+0HnvgAeKErGRwNWr0wb7sJ4AHboUiQC9rKYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746943369; c=relaxed/simple; bh=MlbVqfUS1V/DgVbp/3vxmDMvCve29oEvoJ01SbaXDGE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YWSO8MG5pi0e9xCDnTDdSXDBufZtHqUAToA/AGSeGAheNPn70MNeKo2Pvql0fovBIewCGmHTBgJEnHWUQyWZg7xJh5W3devV4En+YhGm8DAtO6QbpczDBaQmSN1FoYKgKjFSbEk95Z0dJ9Rk7Aj2praHHFS2cq+lUusFcLCRhPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=kuk8uc2a; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="kuk8uc2a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1746943360; bh=MlbVqfUS1V/DgVbp/3vxmDMvCve29oEvoJ01SbaXDGE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kuk8uc2aihRCipAYZMqFQPw0m5pHj+HlL/AaKWG78nKSWJ9l0UI8fjUbfTS+xgR35 FUOD49MLYCppml78dVKA/rm3tFQEvFr0k3deajsO0efdWG9mPAInoyEJuD8miUG9le o7HyjHBb4cb/oo3Y/QXmmtK+aRzxo0OtulvUQnsA= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 11 May 2025 08:02:27 +0200 Subject: [PATCH 1/2] Revert "kbuild: make all file references relative to source root" 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: quoted-printable Message-Id: <20250511-kbuild-revert-file-prefix-map-v1-1-9ba640c8411e@weissschuh.net> References: <20250511-kbuild-revert-file-prefix-map-v1-0-9ba640c8411e@weissschuh.net> In-Reply-To: <20250511-kbuild-revert-file-prefix-map-v1-0-9ba640c8411e@weissschuh.net> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich Cc: linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Matthieu Baerts , =?utf-8?q?Ville_Syrj=C3=A4l=C3=A4?= , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1746943359; l=3152; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=MlbVqfUS1V/DgVbp/3vxmDMvCve29oEvoJ01SbaXDGE=; b=ItBpoWkK4typeysucQIK/bxX9N+G0KR+f0JRfnaPBe3JkpYnFTm5uvURXyW1y76iGtqUCqciE ZSLG45vzT8sDJ7XnXVnI0wQJXpcfjMkIpT4bMKbFI/N6tg0WPd0VwGD X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This reverts commit cacd22ce69585a91c386243cd662ada962431e63. -ffile-prefix-map breaks the ability of debuggers to find the source file corresponding to object files. As there is no simple or uniform way to specify the source directory explicitly, this breaks developers workflows. Revert the unconditional usage of -ffile-prefix-map. Reported-by: Matthieu Baerts Closes: https://lore.kernel.org/lkml/edc50aa7-0740-4942-8c15-96f12f2acc7e@k= ernel.org/ Reported-by: Ville Syrj=C3=A4l=C3=A4 Closes: https://lore.kernel.org/lkml/aBEttQH4kimHFScx@intel.com/ Fixes: cacd22ce6958 ("kbuild: make all file references relative to source r= oot") Signed-off-by: Thomas Wei=C3=9Fschuh --- Documentation/kbuild/reproducible-builds.rst | 17 +++++++++++++++++ Makefile | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Documentation/kbuild/reproducible-builds.rst b/Documentation/k= build/reproducible-builds.rst index a7762486c93fcd3eba08b836bed622a41e829e41..f2dcc39044e66ddd165646e0b51= ccb0209aca7dd 100644 --- a/Documentation/kbuild/reproducible-builds.rst +++ b/Documentation/kbuild/reproducible-builds.rst @@ -46,6 +46,21 @@ The kernel embeds the building user and host names in `KBUILD_BUILD_USER and KBUILD_BUILD_HOST`_ variables. If you are building from a git commit, you could use its committer address. =20 +Absolute filenames +------------------ + +When the kernel is built out-of-tree, debug information may include +absolute filenames for the source files. This must be overridden by +including the ``-fdebug-prefix-map`` option in the `KCFLAGS`_ variable. + +Depending on the compiler used, the ``__FILE__`` macro may also expand +to an absolute filename in an out-of-tree build. Kbuild automatically +uses the ``-fmacro-prefix-map`` option to prevent this, if it is +supported. + +The Reproducible Builds web site has more information about these +`prefix-map options`_. + Generated files in source packages ---------------------------------- =20 @@ -116,5 +131,7 @@ See ``scripts/setlocalversion`` for details. =20 .. _KBUILD_BUILD_TIMESTAMP: kbuild.html#kbuild-build-timestamp .. _KBUILD_BUILD_USER and KBUILD_BUILD_HOST: kbuild.html#kbuild-build-user= -kbuild-build-host +.. _KCFLAGS: kbuild.html#kcflags +.. _prefix-map options: https://reproducible-builds.org/docs/build-path/ .. _Reproducible Builds project: https://reproducible-builds.org/ .. _SOURCE_DATE_EPOCH: https://reproducible-builds.org/docs/source-date-ep= och/ diff --git a/Makefile b/Makefile index b29cc321ffd9c6a5a201d110bd8a88092c380f65..f3f7dbf8ca284fbbab6bf245998= 2447471234f5f 100644 --- a/Makefile +++ b/Makefile @@ -1068,7 +1068,7 @@ KBUILD_CFLAGS +=3D -fno-builtin-wcslen =20 # change __FILE__ to the relative path to the source directory ifdef building_out_of_srctree -KBUILD_CPPFLAGS +=3D $(call cc-option,-ffile-prefix-map=3D$(srcroot)/=3D) +KBUILD_CPPFLAGS +=3D $(call cc-option,-fmacro-prefix-map=3D$(srcroot)/=3D) KBUILD_RUSTFLAGS +=3D --remap-path-prefix=3D$(srcroot)/=3D endif =20 --=20 2.49.0 From nobody Wed Dec 17 08:53:09 2025 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 0185613AA2D; Sun, 11 May 2025 06:02:42 +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=1746943366; cv=none; b=srDwGL4vv0B8jv1t55XMA08+V9nlAa7kocBEwAF6v0gP6ArHRB8lcNl1KyEO2Mie6E5Sb15U6fEX74fu1CKzLs5SpV4xSwUzi1S0agzWMgXgh01VK6vJhEhClYJxEFe3KQekLQ39Jd35BiNBolnFwOMrLrqbFhYEdE6fFGmG/R8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746943366; c=relaxed/simple; bh=E6dUnp8Z6EAVfOCyWJCzyJ22T2+/T258DUngWl+nQOU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dmBFydYbNhcf70d0z5krbfz76md09iSQlyToRuI9j1TDFsFYgxi+7dJt7cVsF///RImTX6DSVCeDFyGliJ9IFvVWUFsTecptM30o7WQRKzuZwKJgoPuKyLhsGBsOKtJ1rXVboMWZwwafUGJyp2Y52fmC0bWtSoq/JiYpXLNR/ik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=Fp1zJ/gn; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Fp1zJ/gn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1746943360; bh=E6dUnp8Z6EAVfOCyWJCzyJ22T2+/T258DUngWl+nQOU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Fp1zJ/gneFkfyekYadOxb001jSiM6cThzi0nni5n5m570C0MtsesxqFWpClprI7Lp 1m/nXjFIPODKQ4pCk6/Dqs/SirmaJri0p/6e3C9C1Zu3/KFq17Ps3V1BMJGx7MbUCC 37bMvmVj4meen+4DWgpfRHXTD8d3gXpbahS8MzcQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 11 May 2025 08:02:28 +0200 Subject: [PATCH 2/2] Revert "kbuild, rust: use -fremap-path-prefix to make paths relative" 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: quoted-printable Message-Id: <20250511-kbuild-revert-file-prefix-map-v1-2-9ba640c8411e@weissschuh.net> References: <20250511-kbuild-revert-file-prefix-map-v1-0-9ba640c8411e@weissschuh.net> In-Reply-To: <20250511-kbuild-revert-file-prefix-map-v1-0-9ba640c8411e@weissschuh.net> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Jonathan Corbet , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich Cc: linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Matthieu Baerts , =?utf-8?q?Ville_Syrj=C3=A4l=C3=A4?= , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1746943359; l=1147; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=E6dUnp8Z6EAVfOCyWJCzyJ22T2+/T258DUngWl+nQOU=; b=l5ameOO3HpZgwnNbg5UmRetT/LOsJjp058woQn3eN9NfCXt7GOsTnHrJ1+Gbwc9LE8X2yVGaQ NxynrvRy39rDJ0uLtQNxKYqa48GwVfTxWzw7KMVOApk84x6VLi2DL9+ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= This reverts commit dbdffaf50ff9cee3259a7cef8a7bd9e0f0ba9f13. --remap-path-prefix breaks the ability of debuggers to find the source file corresponding to object files. As there is no simple or uniform way to specify the source directory explicitly, this breaks developers workflows. Revert the unconditional usage of --remap-path-prefix, equivalent to the same change for -ffile-prefix-map in KBUILD_CPPFLAGS. Fixes: Fixes: dbdffaf50ff9 ("kbuild, rust: use -fremap-path-prefix to make = paths relative") Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Miguel Ojeda --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index f3f7dbf8ca284fbbab6bf2459982447471234f5f..1e1d28d50bf373afb9de787afd7= f4148191cc463 100644 --- a/Makefile +++ b/Makefile @@ -1069,7 +1069,6 @@ KBUILD_CFLAGS +=3D -fno-builtin-wcslen # change __FILE__ to the relative path to the source directory ifdef building_out_of_srctree KBUILD_CPPFLAGS +=3D $(call cc-option,-fmacro-prefix-map=3D$(srcroot)/=3D) -KBUILD_RUSTFLAGS +=3D --remap-path-prefix=3D$(srcroot)/=3D endif =20 # include additional Makefiles when needed --=20 2.49.0