public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ld: yet another PDB build fix (or workaround)
@ 2023-01-06  9:33 Jan Beulich
  2023-01-06 10:14 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2023-01-06  9:33 UTC (permalink / raw)
  To: Binutils; +Cc: Alan Modra, Mark Harmstone

Older bash looks to improperly deal with backslashes in here-documents,
leaving them in place on the escaped double quotes inside the parameter
expansion. Convert to a model without using such a construct, by simply
splitting the here-documents into three ones.
---
In pep.em I question, btw, the checking for i?86-*-* targets.

--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -15,13 +15,6 @@ case ${target} in
     ;;
 esac
 
-case ${target} in
-  x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
-  i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
-    pdb_support=" ";;
-  *)
-esac
-
 rm -f e${EMULATION_NAME}.c
 (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 fragment <<EOF
@@ -73,7 +66,18 @@ fragment <<EOF
 #include "ldctor.h"
 #include "ldbuildid.h"
 #include "coff/internal.h"
-${pdb_support+#include \"pdb.h\"}
+EOF
+
+case ${target} in
+  x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
+  i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
+fragment <<EOF
+#include "pdb.h"
+EOF
+    ;;
+esac
+
+fragment <<EOF
 
 /* FIXME: See bfd/peXXigen.c for why we include an architecture specific
    header in generic PE code.  */
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -17,13 +17,6 @@ case ${target} in
     ;;
 esac
 
-case ${target} in
-  x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
-  i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
-    pdb_support=" ";;
-  *)
-esac
-
 rm -f e${EMULATION_NAME}.c
 (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 fragment <<EOF
@@ -82,7 +75,18 @@ fragment <<EOF
 #include "ldctor.h"
 #include "ldbuildid.h"
 #include "coff/internal.h"
-${pdb_support+#include \"pdb.h\"}
+EOF
+
+case ${target} in
+  x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
+  i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
+fragment <<EOF
+#include "pdb.h"
+EOF
+    ;;
+esac
+
+fragment <<EOF
 
 /* FIXME: See bfd/peXXigen.c for why we include an architecture specific
    header in generic PE code.  */

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

* Re: ld: yet another PDB build fix (or workaround)
  2023-01-06  9:33 ld: yet another PDB build fix (or workaround) Jan Beulich
@ 2023-01-06 10:14 ` Alan Modra
  2023-01-06 12:38   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2023-01-06 10:14 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Binutils, Mark Harmstone

On Fri, Jan 06, 2023 at 10:33:00AM +0100, Jan Beulich wrote:
> Older bash looks to improperly deal with backslashes in here-documents,
> leaving them in place on the escaped double quotes inside the parameter
> expansion. Convert to a model without using such a construct, by simply
> splitting the here-documents into three ones.

Thanks, I was about to send you a slightly different work-around, but
since you already posted I won't bother.  :-)

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: ld: yet another PDB build fix (or workaround)
  2023-01-06 10:14 ` Alan Modra
@ 2023-01-06 12:38   ` Jan Beulich
  2023-01-06 13:05     ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2023-01-06 12:38 UTC (permalink / raw)
  To: Nick Clifton, Alan Modra; +Cc: Binutils, Mark Harmstone

On 06.01.2023 11:14, Alan Modra wrote:
> On Fri, Jan 06, 2023 at 10:33:00AM +0100, Jan Beulich wrote:
>> Older bash looks to improperly deal with backslashes in here-documents,
>> leaving them in place on the escaped double quotes inside the parameter
>> expansion. Convert to a model without using such a construct, by simply
>> splitting the here-documents into three ones.
> 
> Thanks, I was about to send you a slightly different work-around, but
> since you already posted I won't bother.  :-)

Yeah, the easy solution occurred to me right after having sent the
initial problem report.

Nick - is this okay for the branch as well?

Jan

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

* Re: ld: yet another PDB build fix (or workaround)
  2023-01-06 12:38   ` Jan Beulich
@ 2023-01-06 13:05     ` Nick Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2023-01-06 13:05 UTC (permalink / raw)
  To: Jan Beulich, Alan Modra; +Cc: Binutils, Mark Harmstone

Hi Jan,

> Nick - is this okay for the branch as well?

Yes - that is fine.

Cheers
   Nick



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

end of thread, other threads:[~2023-01-06 13:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06  9:33 ld: yet another PDB build fix (or workaround) Jan Beulich
2023-01-06 10:14 ` Alan Modra
2023-01-06 12:38   ` Jan Beulich
2023-01-06 13:05     ` 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).