public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: [PATCH v4] elf: Fix DFS sorting algorithm for LD_TRACE_LOADED_OBJECTS with missing libraries (BZ #28868)
Date: Fri, 04 Mar 2022 13:43:25 +0100	[thread overview]
Message-ID: <877d99lwgi.fsf@igel.home> (raw)
In-Reply-To: <20220304120201.363600-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Fri, 4 Mar 2022 09:02:01 -0300")

On Mär 04 2022, Adhemerval Zanella via Libc-alpha wrote:

> @@ -2725,3 +2735,50 @@ $(objpfx)tst-p_align3: $(objpfx)tst-p_alignmod3.so
>  $(objpfx)tst-p_align3.out: tst-p_align3.sh $(objpfx)tst-p_align3
>  	$(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
>  	$(evaluate-test)
> +
> +
> +# Move the library to a folder so it can be selected by --library-path
> +define libtracemod-mv
> +  test -d $(objpfx)libtracemod$(1) || mkdir $(objpfx)libtracemod$(1)

You can use mkdir -p, which avoids any races.

> +  test -f $(objpfx)libtracemod$(1).so \
> +	  && mv $(objpfx)libtracemod$(1).so $(objpfx)libtracemod$(1)

This will result in a non-zero status if $(objpfx)libtracemod$(1).so
doesn't exist, causing the command to fail.  It's also not race-free.

> +define tst-trace-skeleton
> +$(objpfx)tst-trace$(1).out: $(..)scripts/tst-ld-trace.py \
> +			    $(objpfx)libtracemod1.so \
> +			    libtracemod-mv \
> +			    tst-trace$(1).exp

The dependency on the phony libtracemod-mv will cause the command to
always be rerun.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2022-03-04 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 12:02 Adhemerval Zanella
2022-03-04 12:43 ` Andreas Schwab [this message]
2022-03-04 14:01   ` Adhemerval Zanella
2022-03-04 15:24     ` Andreas Schwab

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=877d99lwgi.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).