Browse Source

Split the binutils and GDB builds

Binutils and GDB are kept in the same repository but follow seperate
relaese streams.  We've been release GDB versions based on binutils
tags, but this is the wrong thing to do and has caused multiple
headaches related to our out-of-tree GDB port.

This patch splits the binutils and GDB submodules, but doesn't actually
change the versions.
pull/342/head
Palmer Dabbelt 8 years ago
committed by Palmer Dabbelt
parent
commit
57f529d416
No known key found for this signature in database GPG Key ID: EF4CA1502CCBAB41
  1. 7
      .gitmodules
  2. 97
      Makefile.in
  3. 0
      riscv-binutils
  4. 1
      riscv-gdb

7
.gitmodules

@ -1,5 +1,5 @@
[submodule "riscv-binutils-gdb"]
path = riscv-binutils-gdb
[submodule "riscv-binutils"]
path = riscv-binutils
url = ../riscv-binutils-gdb.git
[submodule "riscv-gcc"]
path = riscv-gcc
@ -16,3 +16,6 @@
[submodule "riscv-qemu"]
path = riscv-qemu
url = git://github.com/riscv/riscv-qemu.git
[submodule "riscv-gdb"]
path = riscv-gdb
url = ../riscv-binutils-gdb.git

97
Makefile.in

@ -57,8 +57,10 @@ NEWLIB_TUPLE ?= $(call make_tuple,$(XLEN),elf)
CFLAGS_FOR_TARGET := $(CFLAGS_FOR_TARGET_EXTRA) @cmodel@
ASFLAGS_FOR_TARGET := $(ASFLAGS_FOR_TARGET_EXTRA) @cmodel@
# --with-expat is required to enable XML support used by OpenOCD.
BINUTILS_GDB_TARGET_FLAGS := --with-expat=yes $(BINUTILS_GDB_TARGET_FLAGS_EXTRA)
BINUTILS_GDB_NATIVE_FLAGS := $(BINUTILS_GDB_NATIVE_FLAGS_EXTRA)
BINUTILS_TARGET_FLAGS := --with-expat=yes $(BINUTILS_TARGET_FLAGS_EXTRA)
BINUTILS_NATIVE_FLAGS := $(BINUTILS_NATIVE_FLAGS_EXTRA)
GDB_TARGET_FLAGS := --with-expat=yes $(GDB_TARGET_FLAGS_EXTRA)
GDB_NATIVE_FLAGS := $(GDB_NATIVE_FLAGS_EXTRA)
GLIBC_TARGET_FLAGS := $(GLIBC_TARGET_FLAGS_EXTRA)
GLIBC_CC_FOR_TARGET ?= $(LINUX_TUPLE)-gcc
GLIBC_CXX_FOR_TARGET ?= $(LINUX_TUPLE)-g++
@ -73,10 +75,15 @@ CONFIGURE_HOST = @configure_host@
all: @default_target@
newlib: stamps/build-gcc-newlib-stage2
linux: stamps/build-gcc-linux-stage2
ifeq (@enable_gdb@,--enable-gdb)
newlib: stamps/build-gdb-newlib
linux: stamps/build-gdb-linux
endif
linux-native: stamps/build-gcc-linux-native
.PHONY: build-binutils build-gcc1 build-libc build-gcc2 build-qemu
.PHONY: build-binutils build-gdb build-gcc1 build-libc build-gcc2 build-qemu
build-binutils: stamps/build-binutils-@default_target@
build-gdb: stamps/build-gdb-@default_target@
build-gcc%: stamps/build-gcc-@default_target@-stage%
ifeq (@default_target@,linux)
build-libc: $(patsubst %,stamps/build-glibc-linux-%,$(MULTLIB_NAMES))
@ -149,7 +156,29 @@ $(addprefix $(srcdir)/patches/,$(PACKAGES)): $(srcdir)/patches/%: src/%
patches: $(addprefix $(srcdir)/patches/,$(PACKAGES))
stamps/build-binutils-linux: $(srcdir)/riscv-binutils-gdb
stamps/build-binutils-linux: $(srcdir)/riscv-binutils
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
# CC_FOR_TARGET is required for the ld testsuite.
cd $(notdir $@) && CC_FOR_TARGET=$(GLIBC_CC_FOR_TARGET) $</configure \
--target=$(LINUX_TUPLE) \
$(CONFIGURE_HOST) \
--prefix=$(INSTALL_DIR) \
--with-sysroot=$(SYSROOT) \
$(MULTILIB_FLAGS) \
@with_guile@ \
--disable-werror \
--disable-nls \
$(BINUTILS_TARGET_FLAGS) \
--disable-gdb \
--disable-sim \
--disable-libdecnumber \
--disable-libreadline
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
stamps/build-gdb-linux: $(srcdir)/riscv-gdb
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
# CC_FOR_TARGET is required for the ld testsuite.
@ -162,8 +191,13 @@ stamps/build-binutils-linux: $(srcdir)/riscv-binutils-gdb
@with_guile@ \
--disable-werror \
--disable-nls \
$(BINUTILS_GDB_TARGET_FLAGS) \
@enable_gdb@
$(GDB_TARGET_FLAGS) \
--enable-gdb \
--disable-gas \
--disable-binutils \
--disable-ld \
--disable-gold \
--disable-gprof
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
@ -282,7 +316,7 @@ stamps/build-gcc-linux-stage2: $(srcdir)/riscv-gcc $(addprefix stamps/build-glib
cp -a $(INSTALL_DIR)/$(LINUX_TUPLE)/lib* $(SYSROOT)
mkdir -p $(dir $@) && touch $@
stamps/build-binutils-linux-native: $(srcdir)/riscv-binutils-gdb stamps/build-gcc-linux-stage2
stamps/build-binutils-linux-native: $(srcdir)/riscv-binutils stamps/build-gcc-linux-stage2
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
@ -294,8 +328,11 @@ stamps/build-binutils-linux-native: $(srcdir)/riscv-binutils-gdb stamps/build-gc
@with_guile@ \
--disable-werror \
--disable-nls \
$(BINUTILS_GDB_NATIVE_FLAGS) \
@enable_gdb@
$(BINUTILS_NATIVE_FLAGS) \
--disable-gdb \
--disable-sim \
--disable-libdecnumber \
--disable-libreadline
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
@ -328,7 +365,26 @@ stamps/build-gcc-linux-native: $(srcdir)/riscv-gcc stamps/build-gcc-linux-stage2
cp -a $(INSTALL_DIR)/$(LINUX_TUPLE)/lib* $(SYSROOT)
mkdir -p $(dir $@) && touch $@
stamps/build-binutils-newlib: $(srcdir)/riscv-binutils-gdb
stamps/build-binutils-newlib: $(srcdir)/riscv-binutils
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
# CC_FOR_TARGET is required for the ld testsuite.
cd $(notdir $@) && CC_FOR_TARGET=$(NEWLIB_CC_FOR_TARGET) $</configure \
--target=$(NEWLIB_TUPLE) \
$(CONFIGURE_HOST) \
--prefix=$(INSTALL_DIR) \
@with_guile@ \
--disable-werror \
$(BINUTILS_TARGET_FLAGS) \
--disable-gdb \
--disable-sim \
--disable-libdecnumber \
--disable-libreadline
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
stamps/build-gdb-newlib: $(srcdir)/riscv-gdb
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
# CC_FOR_TARGET is required for the ld testsuite.
@ -338,8 +394,13 @@ stamps/build-binutils-newlib: $(srcdir)/riscv-binutils-gdb
--prefix=$(INSTALL_DIR) \
@with_guile@ \
--disable-werror \
$(BINUTILS_GDB_TARGET_FLAGS) \
@enable_gdb@
$(GDB_TARGET_FLAGS) \
--enable-gdb \
--disable-gas \
--disable-binutils \
--disable-ld \
--disable-gold \
--disable-gprof
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
@ -547,15 +608,15 @@ stamps/check-binutils-linux: stamps/build-gcc-linux-stage2 stamps/build-qemu
PATH="$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH)" RISC_V_SYSROOT="$(SYSROOT)" $(MAKE) -C build-binutils-linux check-{binutils,gas,ld} -k "RUNTESTFLAGS=--target_board='$(GLIBC_TARGET_BOARDS)'" || true
date > $@
stamps/check-gdb-newlib: stamps/build-gcc-newlib-stage2 stamps/build-qemu
stamps/check-gdb-newlib: stamps/build-gcc-newlib-stage2 stamps/build-gdb-newlib stamps/build-qemu
PATH="$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH)" RISC_V_SYSROOT="$(SYSROOT)" $(MAKE) -C build-binutils-newlib check-gdb -k "RUNTESTFLAGS=--target_board='$(NEWLIB_TARGET_BOARDS)'" || true
date > $@
stamps/check-gdb-newlib-nano: stamps/build-gcc-newlib-stage2 stamps/build-qemu
stamps/check-gdb-newlib-nano: stamps/build-gcc-newlib-stage2 stamps/build-gdb-newlib stamps/build-qemu
PATH="$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH)" RISC_V_SYSROOT="$(SYSROOT)" $(MAKE) -C build-binutils-newlib check-gdb -k "RUNTESTFLAGS=--target_board='$(NEWLIB_NANO_TARGET_BOARDS)'" || true
date > $@
stamps/check-gdb-linux: stamps/build-gcc-linux-stage2 stamps/build-qemu
stamps/check-gdb-linux: stamps/build-gcc-linux-stage2 stamps/build-gdb-linux stamps/build-qemu
PATH="$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH)" RISC_V_SYSROOT="$(SYSROOT)" $(MAKE) -C build-binutils-linux check-gdb -k "RUNTESTFLAGS=--target_board='$(GLIBC_TARGET_BOARDS)'" || true
date > $@
@ -606,16 +667,16 @@ clean:
.PHONY: report-gdb-newlib report-gdb-newlib-nano
report-gdb-newlib: stamps/check-gdb-newlib
stat $(patsubst %,$(srcdir)/test/gdb-newlib/%.log,$(NEWLIB_MULTILIB_NAMES)) || exit 1
if find build-binutils-newlib -iname '*.sum' | xargs grep ^FAIL | sort | grep -F -v $(patsubst %,--file=$(srcdir)/test/gdb-newlib/%.log,$(NEWLIB_MULTILIB_NAMES)); then false; else true; fi
if find build-gdb-newlib -iname '*.sum' | xargs grep ^FAIL | sort | grep -F -v $(patsubst %,--file=$(srcdir)/test/gdb-newlib/%.log,$(NEWLIB_MULTILIB_NAMES)); then false; else true; fi
report-gdb-newlib-nano: stamps/check-gdb-newlib-nano
stat $(patsubst %,$(srcdir)/test/gdb-newlib/%.log,$(NEWLIB_MULTILIB_NAMES)) || exit 1
if find build-binutils-newlib -iname '*.sum' | xargs grep ^FAIL | sort | grep -F -v $(patsubst %,--file=$(srcdir)/test/gdb-newlib/%.log,$(NEWLIB_MULTILIB_NAMES)); then false; else true; fi
if find build-gdb-newlib -iname '*.sum' | xargs grep ^FAIL | sort | grep -F -v $(patsubst %,--file=$(srcdir)/test/gdb-newlib/%.log,$(NEWLIB_MULTILIB_NAMES)); then false; else true; fi
.PHONY: report-gdb-linux
report-gdb-linux: stamps/check-gdb-linux
stat $(patsubst %,$(srcdir)/test/gdb-linux/%.log,$(GLIBC_MULTILIB_NAMES)) || exit 1
if find build-binutils-linux -iname '*.sum' | xargs grep ^FAIL | sort | grep -F -v $(patsubst %,--file=$(srcdir)/test/gdb-linux/%.log,$(GLIBC_MULTILIB_NAMES)); then false; else true; fi
if find build-gdb-linux -iname '*.sum' | xargs grep ^FAIL | sort | grep -F -v $(patsubst %,--file=$(srcdir)/test/gdb-linux/%.log,$(GLIBC_MULTILIB_NAMES)); then false; else true; fi
distclean: clean
rm -rf src

0
riscv-binutils-gdb → riscv-binutils

1
riscv-gdb

@ -0,0 +1 @@
Subproject commit 635c14ec58512380f28fc80447a427de9341293d
Loading…
Cancel
Save