From: Nathan Chancellor Date: Fri, 13 Mar 2026 23:37:29 +0000 (-0700) Subject: Documentation: kbuild: Update the debug information notes in reproducible-builds.rst X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fb62d915476e3c2253f009ed0f45b82f5f46124;p=thirdparty%2Flinux.git Documentation: kbuild: Update the debug information notes in reproducible-builds.rst The debug information part of the "Absolute filenames" section in the reproducible builds document only mentions providing '-fdebug-prefix-map' to KCFLAGS but it needs to be provided to KAFLAGS as well since debug information has been generated for assembly files for a long time. Additionally, mention that the build directory may also appear as an absolute path in the debug information (via DW_AT_comp_dir), so it needs to be overridden via '-fdebug-prefix-map' as well. Reported-by: Alexander Coffin Closes: https://lore.kernel.org/b8dfe7035d19fd611b9be55ee3145fdb@purelymail.com/ Signed-off-by: Nathan Chancellor Link: https://patch.msgid.link/20260313-kbuild-docs-repro-builds-fdebug-prefix-map-updates-v1-1-3aeeef7fa710@kernel.org Signed-off-by: Nicolas Schier --- diff --git a/Documentation/kbuild/reproducible-builds.rst b/Documentation/kbuild/reproducible-builds.rst index 96d208e578cd5..bc1eb82211df2 100644 --- a/Documentation/kbuild/reproducible-builds.rst +++ b/Documentation/kbuild/reproducible-builds.rst @@ -50,8 +50,10 @@ 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. +absolute filenames for the source files and build directory. These must +be overridden by including a ``-fdebug-prefix-map`` option for each in +the `KCFLAGS`_ and `KAFLAGS`_ variables to cover both ``.c`` and ``.S`` +files. Depending on the compiler used, the ``__FILE__`` macro may also expand to an absolute filename in an out-of-tree build. Kbuild automatically @@ -135,6 +137,7 @@ See ``scripts/setlocalversion`` for details. .. _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 +.. _KAFLAGS: kbuild.html#kaflags .. _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-epoch/