From a5b4cab910b75253d54a4b0bb07324fcf16dbaa8 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 20 Jun 2017 23:26:22 +0200 Subject: gdb: make static builds work, ugly hack --- package/gdb/Makefile | 12 ++--- package/gdb/patches/patch-gdb_configure | 96 +++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 package/gdb/patches/patch-gdb_configure (limited to 'package/gdb') diff --git a/package/gdb/Makefile b/package/gdb/Makefile index 00390cbd3..f14045daf 100644 --- a/package/gdb/Makefile +++ b/package/gdb/Makefile @@ -20,32 +20,26 @@ include ${ADK_TOPDIR}/mk/package.mk $(eval $(call PKG_template,GDB,gdb,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) -TARGET_CFLAGS+= ${TARGET_CPPFLAGS} -fPIC -CONFIGURE_ARGS+= --enable-static \ - --without-uiout \ +CONFIGURE_ARGS+= --without-uiout \ --disable-tui \ --disable-gdbtk \ --disable-gdbserver \ --without-x \ --disable-sim \ + --disable-plugins \ --disable-werror \ --without-python \ --without-included-gettext \ --without-auto-load-safe-path \ --disable-install-libiberty \ --disable-install-libbfd \ + --with-system-zlib \ --with-curses \ --enable-gdbmi -XAKE_FLAGS+= LDFLAGS='${TARGET_LDFLAGS}' -# disable honour cflags stuff -XAKE_FLAGS+= GCC_HONOUR_COPTS:=s - gdb-install: ${INSTALL_DIR} ${IDIR_GDB}/usr/bin ${INSTALL_BIN} ${WRKINST}/usr/bin/gdb \ ${IDIR_GDB}/usr/bin/ - # shipped libbfd conflicts with system wide one - rm -f ${WRKINST}/usr/lib/libbfd* include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/gdb/patches/patch-gdb_configure b/package/gdb/patches/patch-gdb_configure new file mode 100644 index 000000000..251ebf297 --- /dev/null +++ b/package/gdb/patches/patch-gdb_configure @@ -0,0 +1,96 @@ +--- gdb-8.0.orig/gdb/configure 2017-06-04 17:54:54.000000000 +0200 ++++ gdb-8.0/gdb/configure 2017-06-20 22:54:16.961589341 +0200 +@@ -14547,93 +14547,6 @@ $as_echo "$gdb_cv_bigtoc" >&6; } + ;; + esac + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5 +-$as_echo_n "checking for the dynamic export flag... " >&6; } +-dynamic_list=false +-if test "${gdb_native}" = yes; then +- # The dynamically loaded libthread_db needs access to symbols in the gdb +- # executable. Older GNU ld supports --export-dynamic but --dynamic-list +- # may not be supported there. +- old_LDFLAGS="$LDFLAGS" +- # Older GNU ld supports --export-dynamic but --dynamic-list it does not. +- RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" +- LDFLAGS="$LDFLAGS $RDYNAMIC" +- if test "${have_libpython}" = no; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- dynamic_list=true +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- else +- # Workaround http://bugs.python.org/issue4434 where static +- # libpythonX.Y.a would get its symbols required for +- # pythonX.Y/lib-dynload/*.so modules hidden by -Wl,--dynamic-list. +- # Problem does not happen for the recommended libpythonX.Y.so linkage. +- +- # Note the workaround for Python +- # http://bugs.python.org/issue10112 earlier has removed +- # -export-dynamic from PYTHON_LIBS. That's exactly what we want +- # here too, as otherwise it'd make this -Wl,--dynamic-list test +- # always pass. +- old_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS $PYTHON_CFLAGS" +- old_LIBS="$LIBS" +- LIBS="$LIBS $PYTHON_LIBS" +- old_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" +- if test "$cross_compiling" = yes; then : +- true +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include "Python.h" +-int +-main () +-{ +-int err; +- Py_Initialize (); +- err = PyRun_SimpleString ("import itertools\n"); +- Py_Finalize (); +- return err == 0 ? 0 : 1; +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- dynamic_list=true +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +- LIBS="$old_LIBS" +- CFLAGS="$old_CFLAGS" +- CPPFLAGS="$old_CPPFLAGS" +- fi +- LDFLAGS="$old_LDFLAGS" +-fi +-if $dynamic_list; then +- found="-Wl,--dynamic-list" +- RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' +-else +- found="-rdynamic" +- RDYNAMIC="-rdynamic" +-fi +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 +-$as_echo "$found" >&6; } +- + + if test ${build} = ${host} -a ${host} = ${target} ; then + case ${host_os} in -- cgit v1.2.3