mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: "Joe Perches" <joe@perches.com>, "Tom Rini" <trini@konsulko.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Matthias Kaehlcke" <mka@chromium.org>,
	"Cao jin" <caoj.fnst@cn.fujitsu.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"James Hogan" <jhogan@kernel.org>,
	linux-kernel@vger.kernel.org, "Jan-Simon Möller" <dl9pf@gmx.de>,
	"Michal Marek" <michal.lkml@markovi.net>,
	"Douglas Anderson" <dianders@chromium.org>,
	"Josh Poimboeuf" <jpoimboe@redhat.com>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Mark Charlebois" <charlebm@gmail.com>
Subject: [PATCH 0/2] kbuild: use relative path from $(srctree) instead of __FILE__
Date: Thu, 12 Oct 2017 18:56:02 +0900	[thread overview]
Message-ID: <1507802164-31614-1-git-send-email-yamada.masahiro@socionext.com> (raw)


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

             reply	other threads:[~2017-10-12  9:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  9:56 Masahiro Yamada [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507802164-31614-1-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=arnd@arndb.de \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=charlebm@gmail.com \
    --cc=dianders@chromium.org \
    --cc=dl9pf@gmx.de \
    --cc=geert+renesas@glider.be \
    --cc=jhogan@kernel.org \
    --cc=joe@perches.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mingo@kernel.org \
    --cc=mka@chromium.org \
    --cc=trini@konsulko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®