public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] dlltool: Use the output name as basis for deterministic temp prefixes
@ 2022-03-11 20:24 Martin Storsjö
  2022-03-16 15:02 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Storsjö @ 2022-03-11 20:24 UTC (permalink / raw)
  To: binutils

When running multiple dlltool processes in parallel, a temp prefix
based on the dll name can cause clashes, if building multiple
import libraries that have the same DLL name.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28885
---
 binutils/dlltool.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index d95bf3f5470..89871510b45 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -3992,10 +3992,11 @@ main (int ac, char **av)
   if (tmp_prefix == NULL)
     {
       /* If possible use a deterministic prefix.  */
-      if (dll_name)
+      if (imp_name || delayimp_name)
         {
-          tmp_prefix = xmalloc (strlen (dll_name) + 2);
-          sprintf (tmp_prefix, "%s_", dll_name);
+          const char *input = imp_name ? imp_name : delayimp_name;
+          tmp_prefix = xmalloc (strlen (input) + 2);
+          sprintf (tmp_prefix, "%s_", input);
           for (i = 0; tmp_prefix[i]; i++)
             if (!ISALNUM (tmp_prefix[i]))
               tmp_prefix[i] = '_';
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dlltool: Use the output name as basis for deterministic temp prefixes
  2022-03-11 20:24 [PATCH] dlltool: Use the output name as basis for deterministic temp prefixes Martin Storsjö
@ 2022-03-16 15:02 ` Nick Clifton
  2022-03-23 11:22   ` Martin Storsjö
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2022-03-16 15:02 UTC (permalink / raw)
  To: Martin Storsjö, binutils

Hi Martin,

> When running multiple dlltool processes in parallel, a temp prefix
> based on the dll name can cause clashes, if building multiple
> import libraries that have the same DLL name.

Patch approved and applied.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dlltool: Use the output name as basis for deterministic temp prefixes
  2022-03-16 15:02 ` Nick Clifton
@ 2022-03-23 11:22   ` Martin Storsjö
  2022-03-23 11:40     ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Storsjö @ 2022-03-23 11:22 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

On Wed, 16 Mar 2022, Nick Clifton wrote:

> Hi Martin,
>
>> When running multiple dlltool processes in parallel, a temp prefix
>> based on the dll name can cause clashes, if building multiple
>> import libraries that have the same DLL name.
>
> Patch approved and applied.

Thanks! Can it be applied to the 2.38 branch too, so that it's available 
for whoever builds that branch, and/or if there'd be a 2.38.1 release?

// Martin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dlltool: Use the output name as basis for deterministic temp prefixes
  2022-03-23 11:22   ` Martin Storsjö
@ 2022-03-23 11:40     ` Nick Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2022-03-23 11:40 UTC (permalink / raw)
  To: Martin Storsjö; +Cc: binutils

Hi Martin,

>> Patch approved and applied.
> 
> Thanks! Can it be applied to the 2.38 branch too, so that it's available for whoever builds that branch, and/or if there'd be a 2.38.1 release?

Done.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-23 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11 20:24 [PATCH] dlltool: Use the output name as basis for deterministic temp prefixes Martin Storsjö
2022-03-16 15:02 ` Nick Clifton
2022-03-23 11:22   ` Martin Storsjö
2022-03-23 11:40     ` Nick Clifton

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).