diff --git a/repos/ports/lib/mk/gdbserver_platform.inc b/repos/ports/lib/mk/gdbserver_platform.inc index 685cfe2a6..464b7110a 100644 --- a/repos/ports/lib/mk/gdbserver_platform.inc +++ b/repos/ports/lib/mk/gdbserver_platform.inc @@ -1,4 +1,4 @@ -GDB_CONTRIB_DIR = $(REP_DIR)/contrib/gdb-7.3.1 +GDB_CONTRIB_DIR = $(call select_from_ports,gdb)/src/noux-pkg/gdb INC_DIR += $(REP_DIR)/src/lib/gdbserver_libc_support \ $(REP_DIR)/src/lib/gdbserver_platform \ diff --git a/repos/ports/ports/gdb.hash b/repos/ports/ports/gdb.hash new file mode 100644 index 000000000..c93707c44 --- /dev/null +++ b/repos/ports/ports/gdb.hash @@ -0,0 +1 @@ +fc1df6347d793d4ebb8c354229413021ae74d955 diff --git a/repos/ports/ports/gdb.mk b/repos/ports/ports/gdb.mk deleted file mode 100644 index ed78f5416..000000000 --- a/repos/ports/ports/gdb.mk +++ /dev/null @@ -1,104 +0,0 @@ -GDB_VERSION = 7.3.1 -GDB = gdb-$(GDB_VERSION) -GDB_URL = ftp://ftp.fu-berlin.de/gnu/gdb -GDB_TBZ2 = gdb-$(GDB_VERSION).tar.bz2 -GDB_SIG = $(GDB_TBZ2).sig -GDB_KEY = GNU - -# these files are only needed to generate other files in the preparation process -GDB_CONTENT := gdb/regformats/regdat.sh \ - gdb/regformats/reg-arm.dat \ - gdb/regformats/i386/i386.dat \ - gdb/regformats/i386/i386-avx.dat \ - gdb/regformats/regdef.h \ - gdb/common/ax.def \ - gdb/common/i386-xstate.h \ - gdb/common/gdb_signals.h \ - gdb/common/signals.c \ - gdb/gdbserver/i386-low.c \ - gdb/gdbserver/i386-low.h \ - gdb/gdbserver/i387-fp.c \ - gdb/gdbserver/i387-fp.h \ - gdb/gdbserver/linux-arm-low.c \ - gdb/gdbserver/linux-low.c \ - gdb/gdbserver/linux-low.h \ - gdb/gdbserver/linux-x86-low.c \ - gdb/gdbserver/utils.c \ - gdb/gdbserver/regcache.c \ - gdb/gdbserver/target.h \ - gdb/gdbserver/regcache.h \ - gdb/gdbserver/server.c \ - gdb/gdbserver/remote-utils.c \ - gdb/gdbserver/mem-break.h \ - gdb/gdbserver/target.c \ - gdb/gdbserver/event-loop.c \ - gdb/gdbserver/inferiors.c \ - gdb/gdbserver/tracepoint.c \ - gdb/gdbserver/server.h \ - gdb/gdbserver/terminal.h \ - gdb/gdbserver/mem-break.c \ - include/gdb/signals.def \ - include/gdb/signals.h - -# -# Interface to top-level prepare Makefile -# -PORTS += $(GDB) - -prepare-gdb: clean-gdb $(CONTRIB_DIR)/$(GDB)/configure generated_files - -clean-gdb: - $(VERBOSE)rm -rf $(CONTRIB_DIR)/$(GDB) - -# -# Port-specific local rules -# - -$(DOWNLOAD_DIR)/$(GDB_TBZ2): - $(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(GDB_URL)/$(GDB_TBZ2) && touch $@ - -$(DOWNLOAD_DIR)/$(GDB_SIG): - $(VERBOSE)wget -c -P $(DOWNLOAD_DIR) $(GDB_URL)/$(GDB_SIG) && touch $@ - -$(DOWNLOAD_DIR)/$(GDB_TBZ2).verified: $(DOWNLOAD_DIR)/$(GDB_TBZ2) \ - $(DOWNLOAD_DIR)/$(GDB_SIG) - $(VERBOSE)$(SIGVERIFIER) $(DOWNLOAD_DIR)/$(GDB_TBZ2) $(DOWNLOAD_DIR)/$(GDB_SIG) $(GDB_KEY) - $(VERBOSE)touch $@ - -$(CONTRIB_DIR)/$(GDB): $(DOWNLOAD_DIR)/$(GDB_TBZ2).verified - $(VERBOSE)tar xfj $(<:.verified=) -C $(CONTRIB_DIR) - -# needed in 'tool_chain_gdb_patches.inc' -GENODE_DIR := $(abspath ../..) - -include $(GENODE_DIR)/tool/tool_chain_gdb_patches.inc - -$(CONTRIB_DIR)/$(GDB)/configure:: $(CONTRIB_DIR)/$(GDB) - @# - @# Genode-specific changes - @# - $(VERBOSE)patch -N -p1 -d $(CONTRIB_DIR)/$(GDB) < src/app/gdb_monitor/gdbserver_genode.patch - $(VERBOSE)patch -N -p1 -d $(CONTRIB_DIR)/$(GDB) < src/noux-pkg/gdb/build.patch - -GENERATED_DIR := src/lib/gdbserver_platform/generated - -$(GENERATED_DIR): - $(VERBOSE) mkdir $@ - -REGFORMATS_DIR := $(abspath $(CONTRIB_DIR)/$(GDB)/gdb/regformats) - -$(GENERATED_DIR)/reg-arm.c: $(GENERATED_DIR) - $(VERBOSE) cd $(GENERATED_DIR) && $(SHELL) $(REGFORMATS_DIR)/regdat.sh $(REGFORMATS_DIR)/reg-arm.dat $(notdir $@) - -$(GENERATED_DIR)/i386.c: $(GENERATED_DIR) - $(VERBOSE) cd $(GENERATED_DIR) && $(SHELL) $(REGFORMATS_DIR)/regdat.sh $(REGFORMATS_DIR)/i386/i386.dat $(notdir $@) - -$(GENERATED_DIR)/i386-avx.c: $(GENERATED_DIR) - $(VERBOSE) cd $(GENERATED_DIR) && $(SHELL) $(REGFORMATS_DIR)/regdat.sh $(REGFORMATS_DIR)/i386/i386-avx.dat $(notdir $@) - -generated_files: $(CONTRIB_DIR)/$(GDB) \ - $(GENERATED_DIR)/reg-arm.c \ - $(GENERATED_DIR)/i386.c \ - $(GENERATED_DIR)/i386-avx.c - -.PHONY: generated_files diff --git a/repos/ports/ports/gdb.port b/repos/ports/ports/gdb.port new file mode 100644 index 000000000..679dba1f1 --- /dev/null +++ b/repos/ports/ports/gdb.port @@ -0,0 +1,39 @@ +LICENSE := GPLv3 +VERSION := 7.3.1 +DOWNLOADS := gdb.archive + +URL(gdb) := ftp://ftp.fu-berlin.de/gnu/gdb/gdb-$(VERSION).tar.bz2 +SHA(gdb) := e57f2c7f93536ef54fab728eb733bf2c36550718 +SIG(gdb) := ${URL(gdb)}.sig +KEY(gdb) := GNU +DIR(gdb) := src/noux-pkg/gdb + +GENODE_DIR := $(REP_DIR)/../.. +PATCHES_DIR := $(GENODE_DIR)/tool/patches/gdb-$(VERSION) +PATCHES := $(addprefix $(PATCHES_DIR)/,$(shell cat $(PATCHES_DIR)/series)) \ + $(REP_DIR)/src/app/gdb_monitor/gdbserver_genode.patch \ + $(REP_DIR)/src/noux-pkg/gdb/build.patch +PATCH_OPT := -p1 -d ${DIR(gdb)} + +default: _patch generated_files + +GENERATED_DIR := $(REP_DIR)/src/lib/gdbserver_platform/generated + +$(GENERATED_DIR): + $(VERBOSE) mkdir $@ + +REGFORMATS_DIR := $(abspath ${DIR(gdb)}/gdb/regformats) + +$(GENERATED_DIR)/reg-arm.c: $(GENERATED_DIR) + $(VERBOSE) cd $(GENERATED_DIR) && $(SHELL) $(REGFORMATS_DIR)/regdat.sh $(REGFORMATS_DIR)/reg-arm.dat $(notdir $@) + +$(GENERATED_DIR)/i386.c: $(GENERATED_DIR) + $(VERBOSE) cd $(GENERATED_DIR) && $(SHELL) $(REGFORMATS_DIR)/regdat.sh $(REGFORMATS_DIR)/i386/i386.dat $(notdir $@) + +$(GENERATED_DIR)/i386-avx.c: $(GENERATED_DIR) + $(VERBOSE) cd $(GENERATED_DIR) && $(SHELL) $(REGFORMATS_DIR)/regdat.sh $(REGFORMATS_DIR)/i386/i386-avx.dat $(notdir $@) + +generated_files: $(GENERATED_DIR)/reg-arm.c \ + $(GENERATED_DIR)/i386.c \ + $(GENERATED_DIR)/i386-avx.c + diff --git a/repos/ports/src/app/gdb_monitor/target.mk b/repos/ports/src/app/gdb_monitor/target.mk index 90d6f43d3..a763436d9 100644 --- a/repos/ports/src/app/gdb_monitor/target.mk +++ b/repos/ports/src/app/gdb_monitor/target.mk @@ -1,6 +1,6 @@ TARGET = gdb_monitor -GDB_CONTRIB_DIR = $(REP_DIR)/contrib/gdb-7.3.1 +GDB_CONTRIB_DIR = $(call select_from_ports,gdb)/src/noux-pkg/gdb INC_DIR += $(GDB_CONTRIB_DIR)/include \ $(GDB_CONTRIB_DIR)/gdb/common \ diff --git a/repos/ports/src/noux-pkg/gdb/target.inc b/repos/ports/src/noux-pkg/gdb/target.inc index 82ff3e295..34b7417dc 100644 --- a/repos/ports/src/noux-pkg/gdb/target.inc +++ b/repos/ports/src/noux-pkg/gdb/target.inc @@ -1,3 +1,5 @@ +NOUX_PKG_DIR = $(call select_from_ports,gdb)/src/noux-pkg/gdb + NOUX_CONFIGURE_ARGS += --program-prefix=$(PROGRAM_PREFIX) \ --target=$(GDB_TARGET) @@ -7,8 +9,6 @@ NOUX_CFLAGS += -DHAVE_LIBEXPAT=1 LIBS += ncurses expat -NOUX_PKG_DIR = $(wildcard $(REP_DIR)/contrib/gdb-*) - # workaround for problems with makeinfo version 5 NOUX_MAKE_ENV += "MAKEINFO=true"