Skip to content

Commit 47bb5b3

Browse files
committed
ld: yet another PDB build fix (or workaround)
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.
1 parent 59e1f50 commit 47bb5b3

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

ld/emultempl/pe.em

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ case ${target} in
1515
;;
1616
esac
1717

18-
case ${target} in
19-
x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
20-
i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
21-
pdb_support=" ";;
22-
*)
23-
esac
24-
2518
rm -f e${EMULATION_NAME}.c
2619
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
2720
fragment <<EOF
@@ -73,7 +66,18 @@ fragment <<EOF
7366
#include "ldctor.h"
7467
#include "ldbuildid.h"
7568
#include "coff/internal.h"
76-
${pdb_support+#include \"pdb.h\"}
69+
EOF
70+
71+
case ${target} in
72+
x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
73+
i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
74+
fragment <<EOF
75+
#include "pdb.h"
76+
EOF
77+
;;
78+
esac
79+
80+
fragment <<EOF
7781

7882
/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
7983
header in generic PE code. */

ld/emultempl/pep.em

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ case ${target} in
1717
;;
1818
esac
1919

20-
case ${target} in
21-
x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
22-
i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
23-
pdb_support=" ";;
24-
*)
25-
esac
26-
2720
rm -f e${EMULATION_NAME}.c
2821
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
2922
fragment <<EOF
@@ -82,7 +75,18 @@ fragment <<EOF
8275
#include "ldctor.h"
8376
#include "ldbuildid.h"
8477
#include "coff/internal.h"
85-
${pdb_support+#include \"pdb.h\"}
78+
EOF
79+
80+
case ${target} in
81+
x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin | \
82+
i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe)
83+
fragment <<EOF
84+
#include "pdb.h"
85+
EOF
86+
;;
87+
esac
88+
89+
fragment <<EOF
8690

8791
/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
8892
header in generic PE code. */

0 commit comments

Comments
 (0)