All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: torvalds@linux-foundation.org
Cc: dhowells@redhat.com, mmarek@suse.cz, sam@ravnborg.org,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: [PATCH] Fix compiler message generation
Date: Wed, 02 Jul 2014 11:56:46 +0100	[thread overview]
Message-ID: <20140702105645.17220.92338.stgit@warthog.procyon.org.uk> (raw)

The following commit:

	commit 9da0763bdd82572be243fcf5161734f11568960f
	Author: Michal Marek <mmarek@suse.cz>
	Date:   Fri Apr 25 23:25:18 2014 +0200
	Subject: kbuild: Use relative path when building in a subdir of the source tree

makes compiler messages relative to the *build* tree if the build tree is a
subdirectory at the root of the source tree.

This is the wrong thing to do since the make command is issued in the *source*
tree and so any editor or IDE that issues the make command will likely expect
paths in warnings and errors to be relative either to the current directory at
the time the make was issued or to the directory in which make was run.

Certainly, this is something I'm seeing with emacs.  I do:

	LANG=C nice -19 make O=build -C /data/fs/linux-2.6-fscache -j4

And then I get error messages that look like:

	../fs/namei.c: In function 'SYSC_linkat':
	../fs/namei.c:4836:57: error: expected declaration specifiers before 'x'
		int, newdfd, const char __user *, newname, int, flags)x

which emacs can't find the source for because it doesn't relate to anything
emacs knows about.

As a temporary measure, fix this by substituting the full path of the source
as make knows it.

I suspect the correct fix from make's point of view is to issue the build
command in the build tree and use VPATH to refer to the source, but that would
likely involve making a lot of Makefiles and would involve a step equivalent
to autoconf - which is probably not what we want.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Michal Marek <mmarek@suse.cz>
cc: Sam Ravnborg <sam@ravnborg.org>
---

 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/Makefile b/Makefile
index 1317563..def4a75 100644
--- a/Makefile
+++ b/Makefile
@@ -155,7 +155,7 @@ ifeq ($(KBUILD_SRC),)
 else
         ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR)))
                 # building in a subdirectory of the source tree
-                srctree := ..
+                srctree := $(realpath ..)
         else
                 srctree := $(KBUILD_SRC)
         endif


             reply	other threads:[~2014-07-02 10:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 10:56 David Howells [this message]
2014-07-02 12:40 ` [PATCH] Fix compiler message generation Michal Marek
2014-07-02 12:40   ` Michal Marek
2014-07-16 16:15   ` Boaz Harrosh
2014-07-17  9:09     ` Michal Marek
2014-07-17  9:46       ` Boaz Harrosh
2014-07-02 13:34 ` David Howells
2014-07-04 12:38   ` Michal Marek
2014-07-04 12:38     ` Michal Marek
2014-07-08  0:01     ` Doug Anderson

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=20140702105645.17220.92338.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.