From 326e6a873bc8153b5c8031a2b7a16a4e023e9712 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 7 Apr 2009 11:22:59 +0200 Subject: [PATCH] adding gdb for debug --- config/options | 27 +++++-- packages/devel/gdb/build | 26 +++++++ packages/devel/gdb/install | 5 ++ .../devel/gdb/patches/10_uclibc-conf.diff | 78 +++++++++++++++++++ packages/devel/gdb/url | 1 + packages/virtual/image/install | 2 +- 6 files changed, 132 insertions(+), 7 deletions(-) create mode 100755 packages/devel/gdb/build create mode 100755 packages/devel/gdb/install create mode 100644 packages/devel/gdb/patches/10_uclibc-conf.diff create mode 100644 packages/devel/gdb/url diff --git a/config/options b/config/options index 5c44c2302c..4f7487aacb 100644 --- a/config/options +++ b/config/options @@ -135,14 +135,29 @@ LCD_MODEL=HD44780-winamp LCD_WIDTH=16 LCD_HEIGHT=2 -# enable debuging (debugging flags and enables gdb) -DEBUG=no +if [ "$OPENELEC_VERSION" = devel ]; then -# enable gdb (yes/no) -GDB=yes + # enable debuging (debugging flags and enables gdb) + DEBUG=no -# enable devel tools (yes/no) -DEVTOOLS=yes + # enable gdb (yes/no) + GDB=yes + + # enable devel tools (yes/no) + DEVTOOLS=yes + +else + + # enable debuging (debugging flags and enables gdb) + DEBUG=no + + # enable gdb (yes/no) + GDB=no + + # enable devel tools (yes/no) + DEVTOOLS=no + +fi # verbose compilation mode (yes/no) VERBOSE=yes diff --git a/packages/devel/gdb/build b/packages/devel/gdb/build new file mode 100755 index 0000000000..6eebf38e31 --- /dev/null +++ b/packages/devel/gdb/build @@ -0,0 +1,26 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain +$SCRIPTS/build ncurses + +export bash_cv_have_mbstate_t=set +export ac_cv_libexpat=no + +export CC_FOR_BUILD="$HOST_CC" +export CFLAGS_FOR_BUILD="$HOST_CFLAGS" + +cd $BUILD/$1* +mkdir -p objdir +cd objdir +../configure --host=$TARGET_NAME \ + --build=$HOST_NAME \ + --with-sysroot=$SYSROOT_PREFIX \ + --disable-nls \ + --disable-sim \ + --without-x \ + --disable-tui \ + --disable-libada \ + +make diff --git a/packages/devel/gdb/install b/packages/devel/gdb/install new file mode 100755 index 0000000000..6a9310b116 --- /dev/null +++ b/packages/devel/gdb/install @@ -0,0 +1,5 @@ +#!/bin/sh + +. config/options + +cp $BUILD/$1*/objdir/$1/$1 $INSTALL/usr/bin diff --git a/packages/devel/gdb/patches/10_uclibc-conf.diff b/packages/devel/gdb/patches/10_uclibc-conf.diff new file mode 100644 index 0000000000..9d8fd4e69c --- /dev/null +++ b/packages/devel/gdb/patches/10_uclibc-conf.diff @@ -0,0 +1,78 @@ +--- gdb-6.3/bfd/configure.orig Fri Oct 8 16:53:56 2004 ++++ gdb-6.3/bfd/configure Sun Feb 27 18:32:58 2005 +@@ -3583,6 +3583,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd* | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +--- gdb-6.3/libtool.m4.orig Wed Jul 21 21:21:41 2004 ++++ gdb-6.3/libtool.m4 Mon Feb 28 00:08:11 2005 +@@ -653,6 +653,11 @@ + fi + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + newsos6) + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] + lt_cv_file_magic_cmd=/usr/bin/file +--- gdb-6.3/ltconfig.orig Tue Oct 5 15:34:42 2004 ++++ gdb-6.3/ltconfig Sun Feb 27 18:14:41 2005 +@@ -602,7 +602,7 @@ + + # Transform linux* to *-*-linux-gnu*, to support old configure scripts. + case $host_os in +-linux-gnu*) ;; ++linux-gnu*|linux-uclibc*) ;; + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` + esac + +@@ -1270,6 +1270,24 @@ + dynamic_linker='GNU/Linux ld.so' + ;; + ++linux-uclibc*) ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' ++ soname_spec='${libname}${release}.so$major' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ # Note: copied from linux-gnu, and may not be appropriate. ++ hardcode_into_libs=yes ++ # Assume using the uClibc dynamic linker. ++ dynamic_linker="uClibc ld.so" ++ ;; ++ + netbsd*) + need_lib_prefix=no + need_version=no +--- gdb-6.3/opcodes/configure.orig Fri Sep 17 08:13:38 2004 ++++ gdb-6.3/opcodes/configure Mon Feb 28 00:09:42 2005 +@@ -3595,6 +3595,11 @@ + fi + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + newsos6) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file diff --git a/packages/devel/gdb/url b/packages/devel/gdb/url new file mode 100644 index 0000000000..05c793d175 --- /dev/null +++ b/packages/devel/gdb/url @@ -0,0 +1 @@ +http://ftp.gnu.org/gnu/gdb/gdb-6.6.tar.bz2 diff --git a/packages/virtual/image/install b/packages/virtual/image/install index bbc46c2256..3a0ca4be44 100755 --- a/packages/virtual/image/install +++ b/packages/virtual/image/install @@ -71,7 +71,7 @@ case "$2" in #[ "$LCD4LINUX" = yes ] && $SCRIPTS/install lcd4linux $1 # Devtools... (not for Release) -# [ "$DEVTOOLS" = yes ] && $SCRIPTS/install gdb + [ "$DEVTOOLS" = yes ] && $SCRIPTS/install gdb [ "$DEVTOOLS" = yes ] && $SCRIPTS/install mrxvt #[ "$EXTRACODECS" = yes ] && $SCRIPTS/install extra-codecs-nonfree $1