biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / misc / binutils / 2.38 / deterministic-temp-prefixes.patch
blob3c27340b9c0422529eefdadaf966ab3ce44e7b3e
1 From 99852365513266afdd793289813e8e565186c9e6 Mon Sep 17 00:00:00 2001
2 From: Nick Clifton <nickc@redhat.com>
3 Date: Wed, 23 Mar 2022 11:39:49 +0000
4 Subject: [PATCH] dlltool: Use the output name as basis for deterministic temp
5 prefixes
7 PR 28885
8 * dlltool.c (main): use imp_name rather than dll_name when
9 generating a temporary file name.
10 ---
11 binutils/ChangeLog | 9 +++++++++
12 binutils/dlltool.c | 7 ++++---
13 2 files changed, 13 insertions(+), 3 deletions(-)
15 diff --git a/binutils/dlltool.c b/binutils/dlltool.c
16 index d95bf3f5470..89871510b45 100644
17 --- a/binutils/dlltool.c
18 +++ b/binutils/dlltool.c
19 @@ -3992,10 +3992,11 @@ main (int ac, char **av)
20 if (tmp_prefix == NULL)
22 /* If possible use a deterministic prefix. */
23 - if (dll_name)
24 + if (imp_name || delayimp_name)
26 - tmp_prefix = xmalloc (strlen (dll_name) + 2);
27 - sprintf (tmp_prefix, "%s_", dll_name);
28 + const char *input = imp_name ? imp_name : delayimp_name;
29 + tmp_prefix = xmalloc (strlen (input) + 2);
30 + sprintf (tmp_prefix, "%s_", input);
31 for (i = 0; tmp_prefix[i]; i++)
32 if (!ISALNUM (tmp_prefix[i]))
33 tmp_prefix[i] = '_';
34 --
35 2.31.1