Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3286167ybb; Tue, 31 Mar 2020 02:07:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtRo9T3gk4bVS8Ycj9x96ErelnPeSFmSsHxcMrr5HDOYoeZHnq61PICLyrPpRIgMtywEIR+ X-Received: by 2002:a9d:23a6:: with SMTP id t35mr13246982otb.154.1585645631037; Tue, 31 Mar 2020 02:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645631; cv=none; d=google.com; s=arc-20160816; b=bwdpNBCaU+AzQ+A1NWJUV2yCl9VcTQVfBSkBKLnKesLarKEMscgdBz4z7M6+GVpTR6 wRaLwMelBNCYi2ZMM/5fJOkhRUOv3wST4TSAAgIxrB2tu8YWbQXi9GewRNrRAFNl/oXw P7MkiHbWjeNqMr21mHVI0VdSZ1YM2TuYSiirX1MZimFNLlFB3BIVMGqUz7+z/rreBRXW Ts7dMK4j2ZlDG6s1ZfQ+q4C9nOzys+JF7lB6f2OiDTbZosGdECErxCFELGrxgvixE5aV m/YD/6pxAjTtfpGLSD75Aqn9egekGOz0kiDdXeD2YnfTdRgyAtWfTRDRQewI54EeGNvH HhRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YvAAYhAh5yDnkFC91zrLCUq7/s8UMgau9YVw/8vVGQk=; b=r4jLiZnd1W+5ewDQJwn8gND4goRf954FLaOBO5tBM9l0ET7lpuRYoOLATHKwVGiH3D 3VWLgHgtvgmFqTLADjTFd87lmdNva1Ai5thJTNQwrTBJzVAFId/Qq72umltnDy/3xt6E 57Ej+1YIZNKTTpmjS8uwOg5Tlmw7PMsfye7Jl4niUlVTQQo/atNU7qdf5j7hxMOy5ZYC kviUfCj3zteaZU02s6z5tmA6Mloom/keq9sv0R3YzLaTv6cWlgiBkXhzArrIq3W/J/X0 sHjSQtPQ4TJ34mxPnpWCgqhoW6fDOA0ZZjueGyOr/8W3k1BlEDkoolTNjpYaqmv2Dl6H UsuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ym3Kn20k; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i184si6865032oia.14.2020.03.31.02.06.59; Tue, 31 Mar 2020 02:07:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ym3Kn20k; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731176AbgCaJGn (ORCPT + 99 others); Tue, 31 Mar 2020 05:06:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:48068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730763AbgCaJGh (ORCPT ); Tue, 31 Mar 2020 05:06:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA3BA212CC; Tue, 31 Mar 2020 09:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645596; bh=njbwwtwH2gQSrWyiV6cvvDdtJ368sq8JCDsnpEetON0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ym3Kn20k6DckPT3GLgAYNyl48ujOLrrz7FdDiVvebfXs7umbBtPW1/Ei+STIzJcRq zkzTxgaKm8x/1S0wiuU32F/rcZTXNv2X3wjECnrsiMkuRXF9KAH6WMfSjzEFj7v3qC Pg7oxCcOpdpSbOYzCRILDP7bD+/H1Y+ktlYnab1M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Masami Hiramatsu , Andrew Morton , Borislav Petkov , Geert Uytterhoeven , Jiri Olsa , Masahiro Yamada , Michal Marek , Peter Zijlstra , Sasha Levin , "Steven Rostedt (VMware)" , Arnaldo Carvalho de Melo Subject: [PATCH 5.5 101/170] tools: Let O= makes handle a relative path with -C option Date: Tue, 31 Mar 2020 10:58:35 +0200 Message-Id: <20200331085434.946923893@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu commit be40920fbf1003c38ccdc02b571e01a75d890c82 upstream. When I tried to compile tools/perf from the top directory with the -C option, the O= option didn't work correctly if I passed a relative path: $ make O=BUILD -C tools/perf/ make: Entering directory '/home/mhiramat/ksrc/linux/tools/perf' BUILD: Doing 'make -j8' parallel build ../scripts/Makefile.include:4: *** O=/home/mhiramat/ksrc/linux/tools/perf/BUILD does not exist. Stop. make: *** [Makefile:70: all] Error 2 make: Leaving directory '/home/mhiramat/ksrc/linux/tools/perf' The O= directory existence check failed because the check script ran in the build target directory instead of the directory where I ran the make command. To fix that, once change directory to $(PWD) and check O= directory, since the PWD is set to where the make command runs. Fixes: c883122acc0d ("perf tools: Let O= makes handle relative paths") Reported-by: Randy Dunlap Signed-off-by: Masami Hiramatsu Cc: Andrew Morton Cc: Borislav Petkov Cc: Geert Uytterhoeven Cc: Jiri Olsa Cc: Masahiro Yamada Cc: Michal Marek Cc: Peter Zijlstra Cc: Sasha Levin Cc: Steven Rostedt (VMware) Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/158351957799.3363.15269768530697526765.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/Makefile | 2 +- tools/scripts/Makefile.include | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -35,7 +35,7 @@ endif # Only pass canonical directory names as the output directory: # ifneq ($(O),) - FULL_O := $(shell readlink -f $(O) || echo $(O)) + FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O)) endif # --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 ifneq ($(O),) ifeq ($(origin O), command line) - dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) - ABSOLUTE_O := $(shell cd $(O) ; pwd) + dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd) OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/) COMMAND_O := O=$(ABSOLUTE_O) ifeq ($(objtree),)