From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1A08C43331 for ; Wed, 1 Apr 2020 13:54:07 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E5C820776 for ; Wed, 1 Apr 2020 13:54:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E5C820776 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48snjn3VK7zDr8s for ; Thu, 2 Apr 2020 00:54:05 +1100 (AEDT) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48smN52lcqzDr22 for ; Wed, 1 Apr 2020 23:53:41 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix) id 48smN22mz1z9sTZ; Wed, 1 Apr 2020 23:53:38 +1100 (AEDT) Received: by ozlabs.org (Postfix, from userid 1034) id 48smN05XGCz9sTb; Wed, 1 Apr 2020 23:53:36 +1100 (AEDT) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 9686813f6e9d5568bc045de0be853411e44958c8 In-Reply-To: <20200327095319.2347641-1-mpe@ellerman.id.au> To: Michael Ellerman , linuxppc-dev@ozlabs.org From: Michael Ellerman Subject: Re: [PATCH] selftests/powerpc: Fix try-run when source tree is not writable Message-Id: <48smN05XGCz9sTb@ozlabs.org> Date: Wed, 1 Apr 2020 23:53:35 +1100 (AEDT) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: harish@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, 2020-03-27 at 09:53:19 UTC, Michael Ellerman wrote: > We added a usage of try-run to pmu/ebb/Makefile to detect if the > toolchain supported the -no-pie option. > > This fails if we build out-of-tree and the source tree is not > writable, as try-run tries to write its temporary files to the current > directory. That leads to the -no-pie option being silently dropped, > which leads to broken executables with some toolchains. > > If we remove the redirect to /dev/null in try-run, we see the error: > > make[3]: Entering directory '/linux/tools/testing/selftests/powerpc/pmu/ebb' > /usr/bin/ld: cannot open output file .54.tmp: Read-only file system > collect2: error: ld returned 1 exit status > make[3]: Nothing to be done for 'all'. > > And looking with strace we see it's trying to use a file that's in the > source tree: > > lstat("/linux/tools/testing/selftests/powerpc/pmu/ebb/.54.tmp", 0x7ffffc0f83c8) > > We can fix it by setting TMPOUT to point to the $(OUTPUT) directory, > and we can verify with strace it's now trying to write to the output > directory: > > lstat("/output/kselftest/powerpc/pmu/ebb/.54.tmp", 0x7fffd1bf6bf8) > > And also see that the -no-pie option is now correctly detected. > > Fixes: 0695f8bca93e ("selftests/powerpc: Handle Makefile for unrecognized option") > Cc: stable@vger.kernel.org # v5.5+ > Signed-off-by: Michael Ellerman Applied to powerpc next. https://git.kernel.org/powerpc/c/9686813f6e9d5568bc045de0be853411e44958c8 cheers