public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* KCFLAGS vs KCPPFLAGS for -fdebug-prefix-map
@ 2026-03-01  4:34 Alexander Coffin
  2026-03-02 22:29 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Coffin @ 2026-03-01  4:34 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc

Hello,

 From personally building the kernel a few months ago (reproducibly) one 
of the parts that was incorrect in the docs was that is says to use 
KCFLAGS when you should use KCPPFLAGS for the following. I had forgotten 
to report this until now and I'm not sure exactly what is expected to 
make a patch to the Kernel docs, so I am hoping someone else can do the 
probably one line fix (or maybe 2 if you count the other reference to 
KCFLAGS in the file).

> 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.

from `Documentation/kbuild/reproducible-builds.rst`.

Regards,
Alex Coffin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: KCFLAGS vs KCPPFLAGS for -fdebug-prefix-map
  2026-03-01  4:34 KCFLAGS vs KCPPFLAGS for -fdebug-prefix-map Alexander Coffin
@ 2026-03-02 22:29 ` Nathan Chancellor
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-03-02 22:29 UTC (permalink / raw)
  To: Alexander Coffin; +Cc: Jonathan Corbet, linux-doc, linux-kbuild

Hi Alex,

On Sat, Feb 28, 2026 at 08:34:37PM -0800, Alexander Coffin wrote:
> From personally building the kernel a few months ago (reproducibly) one of
> the parts that was incorrect in the docs was that is says to use KCFLAGS
> when you should use KCPPFLAGS for the following. I had forgotten to report
> this until now and I'm not sure exactly what is expected to make a patch to
> the Kernel docs, so I am hoping someone else can do the probably one line
> fix (or maybe 2 if you count the other reference to KCFLAGS in the file).
> 
> > 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.
> 
> from `Documentation/kbuild/reproducible-builds.rst`.

Thanks for bringing this up. I assume this is due to the debug
information generated in assembler files. While the KCPPFLAGS suggestion
works because it is included for both .c and .S compilation, I think it
would be more proper to recommend applying '-fdebug-prefix-map' to
KAFLAGS in addition to KCFLAGS to insure the flag is only added when
truly needed, just as a defensive measure against compiler and Kbuild
changes. I can send a patch for this later.

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-02 22:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01  4:34 KCFLAGS vs KCPPFLAGS for -fdebug-prefix-map Alexander Coffin
2026-03-02 22:29 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox