summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-12 22:40:46 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-12 22:40:59 +0200
commitd0ac419702c94bf2d2eda50b008613bac8149745 (patch)
treec5c4631cd19aca23abf9b76abf1ecf4d50ee6f93
parent9dcf0c59a384703891da3a65ce3df4742b5e7b4f (diff)
gdb: decouple toolchain and package, add special package for microblaze, looks cleaner to me
-rw-r--r--package/gdb-microblaze/Makefile50
-rw-r--r--package/gdb-microblaze/patches/microblaze.patch (renamed from package/gdb/patches/7.8.2/microblaze.patch)0
-rw-r--r--package/gdb-microblaze/patches/patch-gdb_common_linux-ptrace_h (renamed from package/gdb/patches/7.8.2/patch-gdb_common_linux-ptrace_h)0
-rw-r--r--package/gdb-microblaze/patches/patch-gdb_common_signals_c (renamed from package/gdb/patches/7.8.2/patch-gdb_common_signals_c)0
-rw-r--r--package/gdb-microblaze/patches/patch-gdb_gdbserver_configure (renamed from package/gdb/patches/7.8.2/patch-gdb_gdbserver_configure)0
-rw-r--r--package/gdb-microblaze/patches/patch-gdb_linux-nat_c (renamed from package/gdb/patches/7.8.2/patch-gdb_linux-nat_c)0
-rw-r--r--package/gdb-microblaze/src/gdb/debugreg.h48
-rw-r--r--package/gdb-microblaze/src/gdb/sgidefs.h30
-rw-r--r--package/gdb/Makefile7
-rw-r--r--package/gdb/patches/7.8.2/patch-ltmain_sh11
-rw-r--r--package/gdb/patches/patch-gdb_nat_ppc-linux_h (renamed from package/gdb/patches/7.11.1/patch-gdb_nat_ppc-linux_h)0
-rw-r--r--package/gdbserver/Makefile7
-rw-r--r--package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_c10
-rw-r--r--package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_h11
-rw-r--r--package/gdbserver/patches/7.8.2/patch-gdb_gdbserver_linux-low_c22
-rw-r--r--package/gdbserver/patches/nommu.patch (renamed from package/gdbserver/patches/7.11.1/nommu.patch)0
-rw-r--r--target/config/Config.in.gdb5
-rw-r--r--toolchain/gdb/Makefile.inc7
18 files changed, 140 insertions, 68 deletions
diff --git a/package/gdb-microblaze/Makefile b/package/gdb-microblaze/Makefile
new file mode 100644
index 000000000..a25278330
--- /dev/null
+++ b/package/gdb-microblaze/Makefile
@@ -0,0 +1,50 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${ADK_TOPDIR}/rules.mk
+
+PKG_NAME:= gdb
+PKG_VERSION:= 7.8.2
+PKG_RELEASE:= 1
+PKG_DESCR:= programm debugger
+PKG_SECTION:= app/debug
+PKG_HASH:= 605954d5747d5f08ea4b7f48e958d1ebbf39265e18f7f36738deeabb83744485
+PKG_DEPENDS:= libncurses zlib libexpat libthread-db
+PKG_BUILDDEP:= ncurses readline expat zlib
+PKG_SITES:= ${MASTER_SITE_GNU:=gdb/}
+PKG_NOPARALLEL:= 1
+
+PKG_ARCH_DEPENDS:= microblaze
+
+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+= --without-uiout \
+ --disable-tui \
+ --disable-gdbtk \
+ --disable-gdbserver \
+ --without-x \
+ --disable-sim \
+ --disable-werror \
+ --without-python \
+ --without-included-gettext \
+ --without-auto-load-safe-path \
+ --disable-install-libiberty \
+ --disable-install-libbfd \
+ --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/7.8.2/microblaze.patch b/package/gdb-microblaze/patches/microblaze.patch
index 867cbf554..867cbf554 100644
--- a/package/gdb/patches/7.8.2/microblaze.patch
+++ b/package/gdb-microblaze/patches/microblaze.patch
diff --git a/package/gdb/patches/7.8.2/patch-gdb_common_linux-ptrace_h b/package/gdb-microblaze/patches/patch-gdb_common_linux-ptrace_h
index 51e2c3637..51e2c3637 100644
--- a/package/gdb/patches/7.8.2/patch-gdb_common_linux-ptrace_h
+++ b/package/gdb-microblaze/patches/patch-gdb_common_linux-ptrace_h
diff --git a/package/gdb/patches/7.8.2/patch-gdb_common_signals_c b/package/gdb-microblaze/patches/patch-gdb_common_signals_c
index 114f5b867..114f5b867 100644
--- a/package/gdb/patches/7.8.2/patch-gdb_common_signals_c
+++ b/package/gdb-microblaze/patches/patch-gdb_common_signals_c
diff --git a/package/gdb/patches/7.8.2/patch-gdb_gdbserver_configure b/package/gdb-microblaze/patches/patch-gdb_gdbserver_configure
index fb32187b2..fb32187b2 100644
--- a/package/gdb/patches/7.8.2/patch-gdb_gdbserver_configure
+++ b/package/gdb-microblaze/patches/patch-gdb_gdbserver_configure
diff --git a/package/gdb/patches/7.8.2/patch-gdb_linux-nat_c b/package/gdb-microblaze/patches/patch-gdb_linux-nat_c
index 9ba7254ca..9ba7254ca 100644
--- a/package/gdb/patches/7.8.2/patch-gdb_linux-nat_c
+++ b/package/gdb-microblaze/patches/patch-gdb_linux-nat_c
diff --git a/package/gdb-microblaze/src/gdb/debugreg.h b/package/gdb-microblaze/src/gdb/debugreg.h
new file mode 100644
index 000000000..e4883c804
--- /dev/null
+++ b/package/gdb-microblaze/src/gdb/debugreg.h
@@ -0,0 +1,48 @@
+#ifndef SYS_DEBUGREG_H
+#define SYS_DEBUGREG_H
+
+#include <stdint.h>
+
+#define DR_FIRSTADDR 0
+#define DR_LASTADDR 3
+
+#define DR_STATUS 6
+#define DR_CONTROL 7
+
+#define DR_TRAP0 (0x1)
+#define DR_TRAP1 (0x2)
+#define DR_TRAP2 (0x4)
+#define DR_TRAP3 (0x8)
+
+#define DR_STEP (0x4000)
+#define DR_SWITCH (0x8000)
+
+#define DR_CONTROL_SHIFT 16
+#define DR_CONTROL_SIZE 4
+
+#define DR_RW_EXECUTE (0x0)
+#define DR_RW_WRITE (0x1)
+#define DR_RW_READ (0x3)
+
+#define DR_LEN_1 (0x0)
+#define DR_LEN_2 (0x4)
+#define DR_LEN_4 (0xC)
+#define DR_LEN_8 (0x8)
+
+#define DR_LOCAL_ENABLE_SHIFT 0
+#define DR_GLOBAL_ENABLE_SHIFT 1
+#define DR_ENABLE_SIZE 2
+
+#define DR_LOCAL_ENABLE_MASK (0x55)
+#define DR_GLOBAL_ENABLE_MASK (0xAA)
+
+
+#if SIZE_MAX > 4294967295
+# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL)
+#else
+# define DR_CONTROL_RESERVED (0x00FC00U)
+#endif
+#define DR_LOCAL_SLOWDOWN (0x100)
+#define DR_GLOBAL_SLOWDOWN (0x200)
+
+#endif
diff --git a/package/gdb-microblaze/src/gdb/sgidefs.h b/package/gdb-microblaze/src/gdb/sgidefs.h
new file mode 100644
index 000000000..a6d250ab7
--- /dev/null
+++ b/package/gdb-microblaze/src/gdb/sgidefs.h
@@ -0,0 +1,30 @@
+#ifndef _SGIDEFS_H
+#define _SGIDEFS_H
+
+/* MIPS ABI crap that GLIBC puts into /include
+by default, and GDB depends on it happily. */
+
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#define _MIPS_ISA_MIPS5 5
+#define _MIPS_ISA_MIPS32 6
+#define _MIPS_ISA_MIPS64 7
+
+#ifndef _ABIO32
+#define _ABIO32 1
+#endif
+#define _MIPS_SIM_ABI32 _ABIO32
+
+#ifndef _ABIN32
+#define _ABIN32 2
+#endif
+#define _MIPS_SIM_NABI32 _ABIN32
+
+#ifndef _ABI64
+#define _ABI64 3
+#endif
+#define _MIPS_SIM_ABI64 _ABI64
+
+#endif
diff --git a/package/gdb/Makefile b/package/gdb/Makefile
index 76f5fba22..df1504e89 100644
--- a/package/gdb/Makefile
+++ b/package/gdb/Makefile
@@ -2,16 +2,19 @@
# material, please see the LICENCE file in the top-level directory.
include ${ADK_TOPDIR}/rules.mk
-include ${ADK_TOPDIR}/toolchain/gdb/Makefile.inc
PKG_NAME:= gdb
+PKG_VERSION:= 7.11.1
+PKG_RELEASE:= 1
+PKG_HASH:= e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70
PKG_DESCR:= programm debugger
PKG_SECTION:= app/debug
+PKG_SITES:= ${MASTER_SITE_GNU:=gdb/}
PKG_DEPENDS:= libncurses zlib libexpat libthread-db
PKG_BUILDDEP:= ncurses readline expat zlib
PKG_NOPARALLEL:= 1
-PKG_ARCH_DEPENDS:= !m68k !avr32 !nios2
+PKG_ARCH_DEPENDS:= !m68k !avr32 !nios2 !microblaze
include ${ADK_TOPDIR}/mk/package.mk
diff --git a/package/gdb/patches/7.8.2/patch-ltmain_sh b/package/gdb/patches/7.8.2/patch-ltmain_sh
deleted file mode 100644
index 98afcfbc0..000000000
--- a/package/gdb/patches/7.8.2/patch-ltmain_sh
+++ /dev/null
@@ -1,11 +0,0 @@
---- gdb-7.1.orig/ltmain.sh 2010-01-09 22:11:32.000000000 +0100
-+++ gdb-7.1/ltmain.sh 2011-01-15 18:15:38.000000000 +0100
-@@ -4980,7 +4980,7 @@ func_mode_link ()
- # @file GCC response files
- # -tp=* Portland pgcc target processor selection
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
-+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|-fstack-protector*|-flto)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- func_append compile_command " $arg"
diff --git a/package/gdb/patches/7.11.1/patch-gdb_nat_ppc-linux_h b/package/gdb/patches/patch-gdb_nat_ppc-linux_h
index 20929b4cf..20929b4cf 100644
--- a/package/gdb/patches/7.11.1/patch-gdb_nat_ppc-linux_h
+++ b/package/gdb/patches/patch-gdb_nat_ppc-linux_h
diff --git a/package/gdbserver/Makefile b/package/gdbserver/Makefile
index d2bfad2a9..d2b7ace8d 100644
--- a/package/gdbserver/Makefile
+++ b/package/gdbserver/Makefile
@@ -2,13 +2,18 @@
# material, please see the LICENCE file in the top-level directory.
include ${ADK_TOPDIR}/rules.mk
-include ${ADK_TOPDIR}/toolchain/gdb/Makefile.inc
PKG_NAME:= gdbserver
+PKG_VERSION:= 7.11.1
+PKG_RELEASE:= 1
+PKG_HASH:= e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70
PKG_DESCR:= remote programm debugger utility
PKG_SECTION:= app/debug
+PKG_SITES:= ${MASTER_SITE_GNU:=gdb/}
PKG_DEPENDS:= libthread-db
+
PKG_LIBC_DEPENDS:= !musl
+PKG_ARCH_DEPENDS:= !microblaze
ifeq ($(ADK_TOOLCHAIN_GDB_6_7_1),y)
DISTFILES:= gdb-6.7.1-avr32-2.1.5.tar.bz2
diff --git a/package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_c b/package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_c
deleted file mode 100644
index aec39df40..000000000
--- a/package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_c
+++ /dev/null
@@ -1,10 +0,0 @@
---- gdb-7.8.orig/gdb/common/linux-ptrace.c 2014-07-29 14:37:42.000000000 +0200
-+++ gdb-7.8/gdb/common/linux-ptrace.c 2014-09-05 00:52:41.353409084 +0200
-@@ -23,6 +23,7 @@
- #include <string.h>
- #endif
-
-+#include <sched.h>
- #include "linux-ptrace.h"
- #include "linux-procfs.h"
- #include "nat/linux-waitpid.h"
diff --git a/package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_h b/package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_h
deleted file mode 100644
index 1f8e5b9b4..000000000
--- a/package/gdbserver/patches/7.8.2/patch-gdb_common_linux-ptrace_h
+++ /dev/null
@@ -1,11 +0,0 @@
---- gdb-7.8.orig/gdb/common/linux-ptrace.h 2014-07-29 14:37:42.000000000 +0200
-+++ gdb-7.8/gdb/common/linux-ptrace.h 2014-10-04 08:25:08.000000000 +0200
-@@ -23,7 +23,7 @@ struct buffer;
- #include <sys/ptrace.h>
-
- #ifdef __UCLIBC__
--#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
-+#if !defined(__UCLIBC_HAS_MMU__)
- /* PTRACE_TEXT_ADDR and friends. */
- #include <asm/ptrace.h>
- #define HAS_NOMMU
diff --git a/package/gdbserver/patches/7.8.2/patch-gdb_gdbserver_linux-low_c b/package/gdbserver/patches/7.8.2/patch-gdb_gdbserver_linux-low_c
deleted file mode 100644
index ccb61c3a0..000000000
--- a/package/gdbserver/patches/7.8.2/patch-gdb_gdbserver_linux-low_c
+++ /dev/null
@@ -1,22 +0,0 @@
---- gdb-7.8.orig/gdb/gdbserver/linux-low.c 2014-07-29 14:37:42.000000000 +0200
-+++ gdb-7.8/gdb/gdbserver/linux-low.c 2014-09-05 00:47:25.427321525 +0200
-@@ -4933,15 +4933,15 @@ static int
- linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p)
- {
- unsigned long text, text_end, data;
-- int pid = lwpid_of (get_thread_lwp (current_inferior));
-+ int pid = lwpid_of (current_inferior);
-
- errno = 0;
-
-- text = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) PT_TEXT_ADDR,
-+ text = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) (PT_TEXT_ADDR),
- (PTRACE_TYPE_ARG4) 0);
-- text_end = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) PT_TEXT_END_ADDR,
-+ text_end = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) (PT_TEXT_END_ADDR),
- (PTRACE_TYPE_ARG4) 0);
-- data = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) PT_DATA_ADDR,
-+ data = ptrace (PTRACE_PEEKUSER, pid, (PTRACE_TYPE_ARG3) (PT_DATA_ADDR),
- (PTRACE_TYPE_ARG4) 0);
-
- if (errno == 0)
diff --git a/package/gdbserver/patches/7.11.1/nommu.patch b/package/gdbserver/patches/nommu.patch
index 9db54501f..9db54501f 100644
--- a/package/gdbserver/patches/7.11.1/nommu.patch
+++ b/package/gdbserver/patches/nommu.patch
diff --git a/target/config/Config.in.gdb b/target/config/Config.in.gdb
index 0e5062bb2..21cd3564b 100644
--- a/target/config/Config.in.gdb
+++ b/target/config/Config.in.gdb
@@ -19,6 +19,7 @@ endchoice
choice
prompt "GNU debugger version"
+depends on ADK_TOOLCHAIN_WITH_GDB
default ADK_TOOLCHAIN_GDB_H8300_GIT if ADK_TARGET_ARCH_H8300
default ADK_TOOLCHAIN_GDB_NDS32 if ADK_TARGET_ARCH_NDS32
default ADK_TOOLCHAIN_GDB_7_11_1
@@ -51,10 +52,6 @@ config ADK_TOOLCHAIN_GDB_7_9_1
depends on !ADK_TARGET_ARCH_H8300
depends on !ADK_TARGET_ARCH_NDS32
-config ADK_TOOLCHAIN_GDB_7_8_2
- bool "7.8.2"
- depends on ADK_TARGET_ARCH_MICROBLAZE
-
config ADK_TOOLCHAIN_GDB_6_7_1
bool "6.7.1"
depends on ADK_TARGET_ARCH_AVR32
diff --git a/toolchain/gdb/Makefile.inc b/toolchain/gdb/Makefile.inc
index 56083767c..cb28ec70c 100644
--- a/toolchain/gdb/Makefile.inc
+++ b/toolchain/gdb/Makefile.inc
@@ -23,13 +23,6 @@ PKG_HASH:= cd9c543a411a05b2b647dd38936034b68c2b5d6f10e0d51dc168c166c973ba40
PKG_SITES:= ${MASTER_SITE_GNU:=gdb/}
DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz
endif
-ifeq ($(ADK_TOOLCHAIN_GDB_7_8_2),y)
-PKG_VERSION:= 7.8.2
-PKG_RELEASE:= 1
-PKG_HASH:= 605954d5747d5f08ea4b7f48e958d1ebbf39265e18f7f36738deeabb83744485
-PKG_SITES:= ${MASTER_SITE_GNU:=gdb/}
-DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz
-endif
ifeq ($(ADK_TOOLCHAIN_GDB_6_7_1),y)
PKG_VERSION:= 6.7.1
PKG_RELEASE:= 1