From patchwork Wed Jul 2 10:56:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 4464761 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E4A1C9F26C for ; Wed, 2 Jul 2014 10:57:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D10B2037F for ; Wed, 2 Jul 2014 10:57:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFF67202F0 for ; Wed, 2 Jul 2014 10:57:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbaGBK5B (ORCPT ); Wed, 2 Jul 2014 06:57:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38431 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630AbaGBK5B (ORCPT ); Wed, 2 Jul 2014 06:57:01 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s62AuooR025598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Jul 2014 06:56:50 -0400 Received: from warthog.procyon.org.uk (ovpn-112-46.phx2.redhat.com [10.3.112.46]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s62Aukc1028157; Wed, 2 Jul 2014 06:56:47 -0400 Subject: [PATCH] Fix compiler message generation From: David Howells 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 Date: Wed, 02 Jul 2014 11:56:46 +0100 Message-ID: <20140702105645.17220.92338.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The following commit: commit 9da0763bdd82572be243fcf5161734f11568960f Author: Michal Marek 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 cc: Michal Marek cc: Sam Ravnborg --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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