Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2651144pxj; Mon, 31 May 2021 07:24:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfx8NONAO5Wm6eTTvVy7D9NIhgOHT0M+KxMV6hcjzqa8K8Usdm6VMhqO+4IaQoaNObg94Y X-Received: by 2002:a02:b897:: with SMTP id p23mr8828481jam.71.1622471096359; Mon, 31 May 2021 07:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471096; cv=none; d=google.com; s=arc-20160816; b=isZ0lTYW3k1jz6Xyo2W8E7RsKkJ89JiBdg3OhYBf9wIoqmrmP07+UVlVmsaCpvO+Yi 8jAUr3kD9Ksb+SdMt6N0UWKoccseO0NITWJwb5TdsCOI21YumAS8Kud3iN8bGhbyxCh0 sxYtlX5DNkI16H0vteTLgDzytbP2bpgFK9/xfM5Yj1XHGODsbSj/HGcWqLZfQF0YM8ZK oIAZRowrk6LF8nf5cdB7hQpw0izUlVPSxHequi4YniORrUVqM+qW7CAoN74Bu/1s/boW FTccrpbp+GNRjKPrN9wQF0U2M86bZSQt40pew6I3hhWBCvimdoQIntE2Dz/cwEdJ9VqP 3Hdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nsYkh4r4yy/j4fDpg+CCFmFCtAJXnUPXBn8ic7M65vY=; b=tXTlIqIBVT1THUPFOH5ufKWYmBlqek/O3DIAx1hMSVwxEaCsJQtwb7FQ/7O6HSPPCU hPQPdweuNh+djOQV27D2b+rEf+ZLMEwU/sHZfDnQuDQSXYzOfMPDajCnT3BO1Buyp2Jc PIO5OrU1v2pw48uy5S5nIeMIrL4ruoSiFU+H1vCMbZOMcWp4MlQ8vOPLIjmu2HOwRjqb PCOP0f533p+O4LGGd+NUO9IIqH+ldJBcZ044zBIpLBq0BBhZXXB1zTx7K+ViNpmdXkYh VOF7Y3zq1wqZqQWNVISqIdbXI7nFqQtxuoocGw+mEl4UWtRaLC5RF8gtQJwLJmToBO0E gUBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GO0JJyi4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s6si607313iln.106.2021.05.31.07.24.43; Mon, 31 May 2021 07:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GO0JJyi4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbhEaOX5 (ORCPT + 99 others); Mon, 31 May 2021 10:23:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233247AbhEaNu1 (ORCPT ); Mon, 31 May 2021 09:50:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D591C6142A; Mon, 31 May 2021 13:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467917; bh=ghFzGTVOE/F8V/pJ6ebnAk16SWRHvbVtge8asoKoCoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GO0JJyi4n+zoEX58EpfhdVPVw6uEZ8VkLC/5wILKyz+XAA1w/JECfr5f+8J26iNcZ n8tJM4tDmP4b8D2qQPQgtLLrgLrQgaATX1KIUu8uD+cH2CQFZcp6mjkjEk7Ag7toxO XijQRUSLQ3+4+qpepPEZYSN/Jfpz4bk33FZYs1rk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 049/252] selftests/gpio: Fix build when source tree is read only Date: Mon, 31 May 2021 15:11:54 +0200 Message-Id: <20210531130659.647165760@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ Upstream commit b68c1c65dec5fb5186ebd33ce52059b4c6db8500 ] Currently the gpio selftests fail to build if the source tree is read only: make -j 160 -C tools/testing/selftests TARGETS=gpio make[1]: Entering directory '/linux/tools/testing/selftests/gpio' make OUTPUT=/linux/tools/gpio/ -C /linux/tools/gpio make[2]: Entering directory '/linux/tools/gpio' mkdir -p /linux/tools/gpio/include/linux 2>&1 || true ln -sf /linux/tools/gpio/../../include/uapi/linux/gpio.h /linux/tools/gpio/include/linux/gpio.h ln: failed to create symbolic link '/linux/tools/gpio/include/linux/gpio.h': Read-only file system This happens because we ask make to build ../../../gpio (tools/gpio) without pointing OUTPUT away from the source directory. To fix it we create a subdirectory of the existing OUTPUT directory, called tools-gpio, and tell tools/gpio to build in there. Signed-off-by: Michael Ellerman Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/gpio/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile index 615c8a953ade..acf4088a9891 100644 --- a/tools/testing/selftests/gpio/Makefile +++ b/tools/testing/selftests/gpio/Makefile @@ -17,14 +17,18 @@ KSFT_KHDR_INSTALL := 1 include ../lib.mk GPIODIR := $(realpath ../../../gpio) -GPIOOBJ := gpio-utils.o +GPIOOUT := $(OUTPUT)/tools-gpio/ +GPIOOBJ := $(GPIOOUT)/gpio-utils.o override define CLEAN $(RM) $(TEST_GEN_PROGS_EXTENDED) - $(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean + $(RM) -rf $(GPIOOUT) endef -$(TEST_GEN_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ) +$(TEST_GEN_PROGS_EXTENDED): $(GPIOOBJ) -$(GPIODIR)/$(GPIOOBJ): - $(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR) +$(GPIOOUT): + mkdir -p $@ + +$(GPIOOBJ): $(GPIOOUT) + $(MAKE) OUTPUT=$(GPIOOUT) -C $(GPIODIR) -- 2.30.2