mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] kbuild: use relative path from $(srctree) instead of __FILE__
@ 2017-10-12  9:56 Masahiro Yamada
  2017-10-12  9:56 ` [PATCH 1/2] kbuild: add stringify helper to quote a string passed to C files Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Masahiro Yamada @ 2017-10-12  9:56 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Joe Perches, Tom Rini, Geert Uytterhoeven, Masahiro Yamada,
	Matthias Kaehlcke, Cao jin, Arnd Bergmann, James Hogan,
	linux-kernel, Jan-Simon Möller, Michal Marek,
	Douglas Anderson, Josh Poimboeuf, Ingo Molnar, Mark Charlebois


Kbuild works in objtree, not in srctree.  So, __FILE__ is prefixed
with $(srctree)/ for out-of-tree build.

For example, WARN_ON() will look as follows if you built your kernel
out of source tree:

WARNING: CPU: 1 PID: 1 at /path/to/build/directory/arch/arm64/kernel/foo.c:...

With this series, it will always look like follows regardless of O= option.

WARNING: CPU: 1 PID: 1 at arch/arm64/kernel/foo.c:...

If GCC does not support -Wno-builtin-macro-redefined (i.e. gcc version < 4.4),
the output is prefixed with absolute path.



Masahiro Yamada (2):
  kbuild: add stringify helper to quote a string passed to C files
  kbuild: redefine __FILE__ as relative path from $(srctree) if possible

 Makefile               | 9 +++++++++
 scripts/Kbuild.include | 4 ++++
 scripts/Makefile.lib   | 2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

-- 
2.7.4

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

end of thread, other threads:[~2017-10-14 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12  9:56 [PATCH 0/2] kbuild: use relative path from $(srctree) instead of __FILE__ Masahiro Yamada
2017-10-12  9:56 ` [PATCH 1/2] kbuild: add stringify helper to quote a string passed to C files Masahiro Yamada
2017-10-12  9:56 ` [PATCH 2/2] kbuild: redefine __FILE__ as relative path from $(srctree) if possible Masahiro Yamada
2017-10-14 20:15   ` kbuild test robot
2017-10-14  3:17 ` [PATCH 0/2] kbuild: use relative path from $(srctree) instead of __FILE__ Masahiro Yamada

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

all inboxes | Powered by JetHome®