From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346AbdJLJ5f (ORCPT ); Thu, 12 Oct 2017 05:57:35 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:26495 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750907AbdJLJ5d (ORCPT ); Thu, 12 Oct 2017 05:57:33 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v9C9uHcl005959 X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Joe Perches , Tom Rini , Geert Uytterhoeven , Masahiro Yamada , Matthias Kaehlcke , Cao jin , Arnd Bergmann , James Hogan , linux-kernel@vger.kernel.org, =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= , Michal Marek , Douglas Anderson , Josh Poimboeuf , Ingo Molnar , Mark Charlebois Subject: [PATCH 0/2] kbuild: use relative path from $(srctree) instead of __FILE__ Date: Thu, 12 Oct 2017 18:56:02 +0900 Message-Id: <1507802164-31614-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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