add-missing-ldflags.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. When running the configure check "checking for ELF support in BFD", LDFLAGS
  2. were not being passed in to libtool. In OE/YP, we need these flags when using
  3. uninative due to the games we play with the dynamic loader.
  4. If a version of libzstd was built against a newer glibc, it would need
  5. newer pthread symbols which it wouldn't find with the system linker. At
  6. runtime this isn't an issue as it would be switched to use uninative but we
  7. pass flags in LDFLAGS to allow this.
  8. The comments say LDFLAGS are used but it was dropped in this commit:
  9. https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5218fa9e8937b007d554f1e01c2e4ecdb9b7e271
  10. and probably needs to be put back upstream.
  11. The bug is rare to reproduce as it depends on the host libzstd was built
  12. against.
  13. Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=5fc6b6d44cd63651c2902cbfc5b9734a55aaa617]
  14. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  15. Index: gdb-13.1/gdb/acinclude.m4
  16. ===================================================================
  17. --- gdb-13.1.orig/gdb/acinclude.m4
  18. +++ gdb-13.1/gdb/acinclude.m4
  19. @@ -234,7 +234,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
  20. # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We
  21. # always want our bfd.
  22. CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
  23. - LDFLAGS="-L../bfd -L../libiberty"
  24. + LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
  25. intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
  26. LIBS="-lbfd -liberty $intl $LIBS"
  27. CC="./libtool --quiet --mode=link $CC"
  28. Index: gdb-13.1/gdb/configure
  29. ===================================================================
  30. --- gdb-13.1.orig/gdb/configure
  31. +++ gdb-13.1/gdb/configure
  32. @@ -28561,7 +28561,7 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
  33. # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We
  34. # always want our bfd.
  35. CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
  36. - LDFLAGS="-L../bfd -L../libiberty"
  37. + LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
  38. intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
  39. LIBS="-lbfd -liberty $intl $LIBS"
  40. CC="./libtool --quiet --mode=link $CC"