summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gdb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-06 15:14:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-07 10:45:25 +0000
commite4fb136b7d809f98edf0ee0bf72529c18ab7785b (patch)
tree2e7ff00a6f41dec43036cfd928303534b4052856 /meta/recipes-devtools/gdb
parent6066600e809fdcce0b937de9c1d7b603848007a5 (diff)
downloadpoky-e4fb136b7d809f98edf0ee0bf72529c18ab7785b.tar.gz
gdb: Fix occasional build failure
When running the configure check "checking for ELF support in BFD", LDFLAGS were not being passed in to libtool. In OE/YP, we need these flags when using uninative due to the games we play with the dynamic loader. If a version of libzstd was built against a newer glibc, it would need newer pthread symbols which it wouldn't find with the system linker. At runtime this isn't an issue as it would be switched to use uninative but we pass flags in LDFLAGS to allow this. The bug is rare to reproduce as it depends on the host libzstd was built against. (From OE-Core rev: 74077e10e2212349493ecfa8e7d9ca844366331f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gdb')
-rw-r--r--meta/recipes-devtools/gdb/gdb.inc1
-rw-r--r--meta/recipes-devtools/gdb/gdb/add-missing-ldflags.patch47
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb.inc b/meta/recipes-devtools/gdb/gdb.inc
index 18603cc7d4..9457c27f8b 100644
--- a/meta/recipes-devtools/gdb/gdb.inc
+++ b/meta/recipes-devtools/gdb/gdb.inc
@@ -14,6 +14,7 @@ SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \
14 file://0007-Fix-invalid-sigprocmask-call.patch \ 14 file://0007-Fix-invalid-sigprocmask-call.patch \
15 file://0008-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \ 15 file://0008-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \
16 file://0009-gdbserver-linux-low.cc-Fix-a-typo-in-ternary-operato.patch \ 16 file://0009-gdbserver-linux-low.cc-Fix-a-typo-in-ternary-operato.patch \
17 file://add-missing-ldflags.patch \
17 " 18 "
18SRC_URI[sha256sum] = "115ad5c18d69a6be2ab15882d365dda2a2211c14f480b3502c6eba576e2e95a0" 19SRC_URI[sha256sum] = "115ad5c18d69a6be2ab15882d365dda2a2211c14f480b3502c6eba576e2e95a0"
19 20
diff --git a/meta/recipes-devtools/gdb/gdb/add-missing-ldflags.patch b/meta/recipes-devtools/gdb/gdb/add-missing-ldflags.patch
new file mode 100644
index 0000000000..9385aa99c6
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/add-missing-ldflags.patch
@@ -0,0 +1,47 @@
1When running the configure check "checking for ELF support in BFD", LDFLAGS
2were not being passed in to libtool. In OE/YP, we need these flags when using
3uninative due to the games we play with the dynamic loader.
4
5If a version of libzstd was built against a newer glibc, it would need
6newer pthread symbols which it wouldn't find with the system linker. At
7runtime this isn't an issue as it would be switched to use uninative but we
8pass flags in LDFLAGS to allow this.
9
10The comments say LDFLAGS are used but it was dropped in this commit:
11
12https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5218fa9e8937b007d554f1e01c2e4ecdb9b7e271
13
14and probably needs to be put back upstream.
15
16The bug is rare to reproduce as it depends on the host libzstd was built
17against.
18
19Upstream-Status: Pending
20Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
21
22Index: gdb-13.1/gdb/acinclude.m4
23===================================================================
24--- gdb-13.1.orig/gdb/acinclude.m4
25+++ gdb-13.1/gdb/acinclude.m4
26@@ -234,7 +234,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
27 # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We
28 # always want our bfd.
29 CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
30- LDFLAGS="-L../bfd -L../libiberty"
31+ LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
32 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
33 LIBS="-lbfd -liberty $intl $LIBS"
34 CC="./libtool --quiet --mode=link $CC"
35Index: gdb-13.1/gdb/configure
36===================================================================
37--- gdb-13.1.orig/gdb/configure
38+++ gdb-13.1/gdb/configure
39@@ -28561,7 +28561,7 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
40 # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We
41 # always want our bfd.
42 CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
43- LDFLAGS="-L../bfd -L../libiberty"
44+ LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
45 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
46 LIBS="-lbfd -liberty $intl $LIBS"
47 CC="./libtool --quiet --mode=link $CC"