LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@ozlabs.org
Cc: harish@linux.ibm.com
Subject: Re: [PATCH] selftests/powerpc: Fix try-run when source tree is not writable
Date: Wed,  1 Apr 2020 23:53:35 +1100 (AEDT)	[thread overview]
Message-ID: <48smN05XGCz9sTb@ozlabs.org> (raw)
In-Reply-To: <20200327095319.2347641-1-mpe@ellerman.id.au>

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 <mpe@ellerman.id.au>

Applied to powerpc next.

https://git.kernel.org/powerpc/c/9686813f6e9d5568bc045de0be853411e44958c8

cheers

      reply	other threads:[~2020-04-01 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27  9:53 [PATCH] selftests/powerpc: Fix try-run when source tree is not writable Michael Ellerman
2020-04-01 12:53 ` Michael Ellerman [this message]

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=48smN05XGCz9sTb@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=harish@linux.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox