From 5be7e7bb8eedb40cd17c1b60cdbbfc8d516b7ba9 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 2 Jul 2020 13:31:08 -0700 Subject: [PATCH 01/16] Adding gdb-only target with python enablement --- Makefile | 159 ++++++++++++++++++++++++++++++++++-- scripts/pyconfig-mingw32.sh | 18 ++++ 2 files changed, 169 insertions(+), 8 deletions(-) create mode 100755 scripts/pyconfig-mingw32.sh diff --git a/Makefile b/Makefile index 08274a9..7c3f0fc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ # The default target -.PHONY: all toolchain openocd qemu xc3sprog trace-decoder sdk-utilities +.PHONY: all toolchain gdb-only openocd qemu xc3sprog trace-decoder sdk-utilities all: +non-toolchain: toolchain: +gdb-only: openocd: qemu: xc3sprog: @@ -33,6 +35,7 @@ ifneq ($(wildcard /etc/redhat-release),) NATIVE ?= $(REDHAT) all: redhat toolchain: redhat-toolchain +gdb-only: redhat-gdb-only openocd: redhat-openocd qemu: redhat-qemu xc3sprog: redhat-xc3sprog @@ -43,6 +46,7 @@ ifeq ($(shell uname -m),x86_64) NATIVE ?= $(UBUNTU64) all: ubuntu64 toolchain: ubuntu64-toolchain +gdb-only: ubuntu64-gdb-only openocd: ubuntu64-openocd qemu: ubuntu64-qemu xc3sprog: ubuntu64-xc3sprog @@ -56,6 +60,7 @@ openocd: ubuntu32-openocd endif all: win64 toolchain: win64-toolchain +gdb-only: win64-gdb-only openocd: win64-openocd qemu: win64-qemu xc3sprog: win64-xc3sprog @@ -69,6 +74,7 @@ SED ?= gsed AWK ?= gawk all: darwin toolchain: darwin-toolchain +gdb-only: darwin-gdb-only openocd: darwin-openocd qemu: darwin-qemu xc3sprog: darwin-xc3sprog @@ -120,12 +126,16 @@ PATH := $(abspath $(OBJ_NATIVE)/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$ export PATH # The actual output of this repository is a set of tarballs. -.PHONY: win64 win64-openocd win64-toolchain win64-qemu win64-xc3sprog win64-trace-decoder win64-sdk-utilities -win64: win64-openocd win64-toolchain win64-qemu win64-xc3sprog win64-trace-decoder win64-sdk-utilities +.PHONY: win64 win64-toolchain win64-gdb-only win64-openocd win64-qemu win64-xc3sprog win64-trace-decoder win64-sdk-utilities +win64: win64-toolchain win64-openocd win64-qemu win64-xc3sprog win64-trace-decoder win64-sdk-utilities win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).zip win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).src.zip win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).tar.gz win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).src.tar.gz +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).zip +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).src.zip +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).tar.gz +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).src.tar.gz win64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN64).zip win64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN64).src.zip win64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN64).tar.gz @@ -156,10 +166,12 @@ win32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN32).zip win32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN32).src.zip win32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN32).tar.gz win32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN32).src.tar.gz -.PHONY: ubuntu64 ubuntu64-toolchain ubuntu64-openocd ubuntu64-qemu ubuntu64-xc3sprog ubuntu64-trace-decoder ubuntu64-sdk-utilities +.PHONY: ubuntu64 ubuntu64-toolchain ubuntu64-gdb-only ubuntu64-openocd ubuntu64-qemu ubuntu64-xc3sprog ubuntu64-trace-decoder ubuntu64-sdk-utilities ubuntu64: ubuntu64-toolchain ubuntu64-openocd ubuntu64-qemu ubuntu64-xc3sprog ubuntu64-trace-decoder ubuntu64-sdk-utilities ubuntu64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU64).tar.gz ubuntu64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU64).src.tar.gz +ubuntu64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(UBUNTU64).tar.gz +ubuntu64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(UBUNTU64).src.tar.gz ubuntu64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64).tar.gz ubuntu64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64).src.tar.gz ubuntu64-qemu: $(BINDIR)/riscv-qemu-$(RQEMU_VERSION)-$(UBUNTU64).tar.gz @@ -176,10 +188,12 @@ ubuntu32-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU32) ubuntu32-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU32).src.tar.gz ubuntu32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU32).tar.gz ubuntu32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU32).src.tar.gz -.PHONY: redhat redhat-toolchain redhat-openocd redhat-qemu redhat-xc3sprog redhat-trace-decoder redhat-sdk-utilities +.PHONY: redhat redhat-toolchain redhat-gdb-only redhat-openocd redhat-qemu redhat-xc3sprog redhat-trace-decoder redhat-sdk-utilities redhat: redhat-toolchain redhat-openocd redhat-qemu redhat-xc3sprog redhat-trace-decoder redhat-sdk-utilities redhat-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(REDHAT).tar.gz redhat-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(REDHAT).src.tar.gz +redhat-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(REDHAT).tar.gz +redhat-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(REDHAT).src.tar.gz redhat-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(REDHAT).tar.gz redhat-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(REDHAT).src.tar.gz redhat-qemu: $(BINDIR)/riscv-qemu-$(RQEMU_VERSION)-$(REDHAT).tar.gz @@ -190,10 +204,12 @@ redhat-trace-decoder: $(BINDIR)/trace-decoder-$(TDC_VERSION)-$(REDHAT).tar.gz redhat-trace-decoder: $(BINDIR)/trace-decoder-$(TDC_VERSION)-$(REDHAT).src.tar.gz redhat-sdk-utilities: $(BINDIR)/sdk-utilities-$(SDKU_VERSION)-$(REDHAT).tar.gz redhat-sdk-utilities: $(BINDIR)/sdk-utilities-$(SDKU_VERSION)-$(REDHAT).src.tar.gz -.PHONY: darwin darwin-toolchain darwin-openocd darwin-qemu darwin-xc3sprog darwin-trace-decoder darwin-sdk-utilities +.PHONY: darwin darwin-toolchain darwin-gdb-only darwin-openocd darwin-qemu darwin-xc3sprog darwin-trace-decoder darwin-sdk-utilities darwin: darwin-toolchain darwin-openocd darwin-qemu darwin-xc3sprog darwin-trace-decoder darwin-sdk-utilities darwin-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(DARWIN).tar.gz darwin-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(DARWIN).src.tar.gz +darwin-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(DARWIN).tar.gz +darwin-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(DARWIN).src.tar.gz darwin-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(DARWIN).tar.gz darwin-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(DARWIN).src.tar.gz darwin-qemu: $(BINDIR)/riscv-qemu-$(RQEMU_VERSION)-$(DARWIN).tar.gz @@ -213,6 +229,8 @@ $(WIN32)-expat-configure := --host=$(WIN32) $(WIN32)-xc3sp-host := --host=$(WIN32) $(WIN64)-rgt-host := --host=$(WIN64) $(WIN64)-rgcc-configure := --without-system-zlib +#$(WIN64)-rgdb-configure := --with-python="$(abspath scripts/pyconfig-mingw32.sh)" +$(WIN64)-rgdb-configure := --with-python=no $(WIN64)-rocd-host := --host=$(WIN64) $(WIN64)-oftdi-configure := -DCMAKE_TOOLCHAIN_FILE="$(abspath $(OBJ_WIN64)/build/riscv-openocd/libftdi/cmake/Toolchain-x86_64-w64-mingw32.cmake)" -DLIBUSB_LIBRARIES="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/bin/libusb-1.0.dll)" -DLIBUSB_INCLUDE_DIR="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/include/libusb-1.0)" $(WIN64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib/pkgconfig" CFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" CPPFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" @@ -241,6 +259,7 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib +$(UBUNTU64)-rgdb-configure := --with-python=python3 $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -253,6 +272,7 @@ $(UBUNTU64)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib +$(DARWIN)-rgdb-configure := --with-python=python3 $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -265,6 +285,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib +$(REDHAT)-rgdb-configure := --with-python=python3 $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" @@ -325,8 +346,8 @@ MULTILIBS_GEN := \ CFLAGS_FOR_TARGET := $(CFLAGS_FOR_TARGET_EXTRA) -mcmodel=$(WITH_CMODEL) CXXFLAGS_FOR_TARGET := $(CXXFLAGS_FOR_TARGET_EXTRA) -mcmodel=$(WITH_CMODEL) # --with-expat is required to enable XML support used by OpenOCD. -BINUTILS_TARGET_FLAGS := --with-expat=yes $(BINUTILS_TARGET_FLAGS_EXTRA) --with-mpc=no --with-mpfr=no --with-gmp=no --with-python=no -GDB_TARGET_FLAGS := --with-expat=yes $(GDB_TARGET_FLAGS_EXTRA) --with-mpc=no --with-mpfr=no --with-gmp=no --with-python=no +BINUTILS_TARGET_FLAGS := --with-expat=yes $(BINUTILS_TARGET_FLAGS_EXTRA) --with-mpc=no --with-mpfr=no --with-gmp=no +GDB_TARGET_FLAGS := --with-expat=yes $(GDB_TARGET_FLAGS_EXTRA) --with-mpc=no --with-mpfr=no --with-gmp=no NEWLIB_CC_FOR_TARGET ?= $(NEWLIB_TUPLE)-gcc NEWLIB_CXX_FOR_TARGET ?= $(NEWLIB_TUPLE)-g++ @@ -389,6 +410,7 @@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-binutils-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(BINUTILS_TARGET_FLAGS) \ + --with-python=no \ --disable-gdb \ --disable-sim \ --disable-libdecnumber \ @@ -416,6 +438,7 @@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ + --with-python=no \ --enable-gdb \ --disable-gas \ --disable-binutils \ @@ -620,6 +643,126 @@ $(OBJDIR)/%/stamps/expat/install.stamp: \ date > $@ $(OBJDIR)/%/build/expat/configure: + rm -rf $(dir $@) + mkdir -p $(dir $@) + cp -a $(SRC_EXPAT)/* $(dir $@) + mkdir -p $(dir $@)/m4 + cd $(dir $@); ./buildconf.sh &>make-buildconf.log + touch -c $@ + +# Builds riscv-gdb-only for various targets. +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.zip: \ + $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.zip,%,$@)) + mkdir -p $(dir $@) + cd $(OBJDIR)/$($@_TARGET)/install; zip -rq $(abspath $@) riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET) + +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.zip: \ + $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.zip,%,$@)) + mkdir -p $(dir $@) + cd $(OBJDIR)/$($@_TARGET)/build; zip -rq $(abspath $@) riscv-gnu-gdb-only expat-gdb + +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.tar.gz: \ + $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.tar.gz,%,$@)) + mkdir -p $(dir $@) + $(TAR) --dereference --hard-dereference -C $(OBJDIR)/$($@_TARGET)/install -c riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET) | gzip > $(abspath $@) + +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.tar.gz: \ + $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.tar.gz,%,$@)) + mkdir -p $(dir $@) + $(TAR) --dereference --hard-dereference -C $(OBJDIR)/$($@_TARGET)/build -c riscv-gnu-gdb-only expat-gdb | gzip > $(abspath $@) + +$(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp: \ + $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp + mkdir -p $(dir $@) + date > $@ + +$(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp: + $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp,%,$@)) + rm -rf $(dir $@) + mkdir -p $(dir $@) + cp -a $(SRC_RGDB) $(dir $@) + date > $@ + +$(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ + $(OBJDIR)/%/stamps/expat-gdb/install.stamp \ + $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp + $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%,$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET),$@)) + $(eval $@_BUILD := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%/build/riscv-gnu-gdb-only,$@)) + rm -rf $(dir $@) + mkdir -p $(dir $@) +# CC_FOR_TARGET is required for the ld testsuite. + cd $(dir $@) && CC_FOR_TARGET=$(NEWLIB_CC_FOR_TARGET) $(abspath $($@_BUILD))/riscv-gdb/configure \ + --target=$(NEWLIB_TUPLE) \ + $($($@_TARGET)-rgt-host) \ + --prefix=$(abspath $($@_INSTALL)) \ + --with-pkgversion="SiFive GDB $(RGDB_VERSION)" \ + --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ + --disable-werror \ + $(GDB_TARGET_FLAGS) \ + --with-python=no \ + --enable-gdb \ + --disable-gas \ + --disable-binutils \ + --disable-ld \ + --disable-gold \ + --disable-gprof \ + CFLAGS="-O2" \ + CXXFLAGS="-O2" &>make-configure.log + $(MAKE) -C $(dir $@) &>$(dir $@)/make-build.log + $(MAKE) -C $(dir $@) -j1 install install-pdf install-html &>$(dir $@)/make-install.log + date > $@ + +$(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp: \ + $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp + $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%,$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET),$@)) + $(eval $@_BUILD := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%/build/riscv-gnu-gdb-only,$@)) + rm -rf $(dir $@) + mkdir -p $(dir $@) +# CC_FOR_TARGET is required for the ld testsuite. + cd $(dir $@) && CC_FOR_TARGET=$(NEWLIB_CC_FOR_TARGET) $(abspath $($@_BUILD))/riscv-gdb/configure \ + --target=$(NEWLIB_TUPLE) \ + $($($@_TARGET)-rgt-host) \ + --prefix=$(abspath $($@_INSTALL)) \ + --with-pkgversion="SiFive GDB $(RGDB_VERSION)" \ + --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ + --disable-werror \ + $(GDB_TARGET_FLAGS) \ + $($($@_TARGET)-rgdb-configure) \ + --program-prefix="$(NEWLIB_TUPLE)-" \ + --program-suffix="-py" \ + --enable-gdb \ + --disable-gas \ + --disable-binutils \ + --disable-ld \ + --disable-gold \ + --disable-gprof \ + CFLAGS="-O2" \ + CXXFLAGS="-O2" &>make-configure.log + $(MAKE) -C $(dir $@) &>$(dir $@)/make-build.log + $(MAKE) -C $(dir $@) -j1 install install-pdf install-html &>$(dir $@)/make-install.log + date > $@ + +# OpenOCD requires a GDB that's been build with expat support so it can read +# the target XML files. +$(OBJDIR)/%/stamps/expat-gdb/install.stamp: \ + $(OBJDIR)/%/build/expat-gdb/configure + $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/stamps/expat-gdb/install.stamp,%,$@)) + $(eval $@_BUILD := $(patsubst %/stamps/expat-gdb/install.stamp,%/build/expat-gdb,$@)) + $(eval $@_INSTALL := $(patsubst %/stamps/expat-gdb/install.stamp,%/install/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET),$@)) + mkdir -p $($@_BUILD) + cd $($@_BUILD); ./configure --prefix=$(abspath $($@_INSTALL)) $($($@_TARGET)-expat-configure) &>make-configure.log + $(MAKE) -C $($@_BUILD) buildlib &>$($@_BUILD)/make-buildlib.log + $(MAKE) -C $($@_BUILD) -j1 installlib &>$($@_BUILD)/make-installlib.log + mkdir -p $(dir $@) + date > $@ + +$(OBJDIR)/%/build/expat-gdb/configure: rm -rf $(dir $@) mkdir -p $(dir $@) cp -a $(SRC_EXPAT)/* $(dir $@) diff --git a/scripts/pyconfig-mingw32.sh b/scripts/pyconfig-mingw32.sh new file mode 100755 index 0000000..453ed42 --- /dev/null +++ b/scripts/pyconfig-mingw32.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Ignore first argument +pydir=$(dirname $1) +shift +for arg in $@; do + case $arg in + --prefix|--exec-prefix) + echo "${pydir}/../../../python" + ;; + --includes) + echo "-I${pydir}/../../../python/include" + ;; + --ldflags) + echo "-L${pydir}/../../../python/libs -lpython27" + ;; + esac + shift +done From ebd503af4ce696532eeb2cc62bb905ed6b7cfd7b Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 6 Jul 2020 09:48:43 -0700 Subject: [PATCH 02/16] Trying with custom built pythons --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c3f0fc..eeabcb4 100644 --- a/Makefile +++ b/Makefile @@ -259,7 +259,7 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib -$(UBUNTU64)-rgdb-configure := --with-python=python3 +$(UBUNTU64)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3-config $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -272,7 +272,7 @@ $(UBUNTU64)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib -$(DARWIN)-rgdb-configure := --with-python=python3 +$(DARWIN)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3-config $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -285,7 +285,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-configure := --with-python=python3 +$(REDHAT)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3-config $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" From 872f486281154be9669fee8303bd3c0307179962 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 6 Jul 2020 10:49:17 -0700 Subject: [PATCH 03/16] Trying with python executable instead of python-config --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index eeabcb4..e7e00cd 100644 --- a/Makefile +++ b/Makefile @@ -259,7 +259,7 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib -$(UBUNTU64)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3-config +$(UBUNTU64)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3 $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -272,7 +272,7 @@ $(UBUNTU64)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib -$(DARWIN)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3-config +$(DARWIN)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3 $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -285,7 +285,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3-config +$(REDHAT)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3 $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" From 69bbb0919dc097462214156a412e07d18f1e03bc Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 6 Jul 2020 11:55:34 -0700 Subject: [PATCH 04/16] Trying to get linux builds using static expat lib --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index e7e00cd..d7f0785 100644 --- a/Makefile +++ b/Makefile @@ -759,6 +759,9 @@ $(OBJDIR)/%/stamps/expat-gdb/install.stamp: \ cd $($@_BUILD); ./configure --prefix=$(abspath $($@_INSTALL)) $($($@_TARGET)-expat-configure) &>make-configure.log $(MAKE) -C $($@_BUILD) buildlib &>$($@_BUILD)/make-buildlib.log $(MAKE) -C $($@_BUILD) -j1 installlib &>$($@_BUILD)/make-installlib.log + rm -f $(abspath $($@_INSTALL))/lib/lib*.dylib* + rm -f $(abspath $($@_INSTALL))/lib/lib*.so* + rm -f $(abspath $($@_INSTALL))/lib64/lib*.so* mkdir -p $(dir $@) date > $@ From 72eb95ad4015f770119447030b5cf1ca06b5621d Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 6 Jul 2020 15:35:58 -0700 Subject: [PATCH 05/16] Fixing lzma and gettext for mac build --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d7f0785..52ce0b7 100644 --- a/Makefile +++ b/Makefile @@ -229,8 +229,8 @@ $(WIN32)-expat-configure := --host=$(WIN32) $(WIN32)-xc3sp-host := --host=$(WIN32) $(WIN64)-rgt-host := --host=$(WIN64) $(WIN64)-rgcc-configure := --without-system-zlib -#$(WIN64)-rgdb-configure := --with-python="$(abspath scripts/pyconfig-mingw32.sh)" -$(WIN64)-rgdb-configure := --with-python=no +#$(WIN64)-rgdb-python := --with-python="$(abspath scripts/pyconfig-mingw32.sh)" +$(WIN64)-rgdb-python := --with-python=no $(WIN64)-rocd-host := --host=$(WIN64) $(WIN64)-oftdi-configure := -DCMAKE_TOOLCHAIN_FILE="$(abspath $(OBJ_WIN64)/build/riscv-openocd/libftdi/cmake/Toolchain-x86_64-w64-mingw32.cmake)" -DLIBUSB_LIBRARIES="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/bin/libusb-1.0.dll)" -DLIBUSB_INCLUDE_DIR="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/include/libusb-1.0)" $(WIN64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib/pkgconfig" CFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" CPPFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" @@ -259,7 +259,7 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib -$(UBUNTU64)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3 +$(UBUNTU64)-rgdb-python := --with-python=/scratch/carsteng/git/py3/install/bin/python3 $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -272,7 +272,8 @@ $(UBUNTU64)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib -$(DARWIN)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3 +$(DARWIN)-rgdb-configure := --with-included-gettext +$(DARWIN)-rgdb-python := --with-python=/scratch/carsteng/git/py3/install/bin/python3 $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -285,7 +286,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-configure := --with-python=/scratch/carsteng/git/py3/install/bin/python3 +$(REDHAT)-rgdb-python := --with-python=/scratch/carsteng/git/py3/install/bin/python3 $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" @@ -704,7 +705,9 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ + $($($@_TARGET)-rgdb-configure) \ --with-python=no \ + --with-lzma=no \ --enable-gdb \ --disable-gas \ --disable-binutils \ @@ -734,8 +737,10 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp: \ --disable-werror \ $(GDB_TARGET_FLAGS) \ $($($@_TARGET)-rgdb-configure) \ + $($($@_TARGET)-rgdb-python) \ --program-prefix="$(NEWLIB_TUPLE)-" \ --program-suffix="-py" \ + --with-lzma=no \ --enable-gdb \ --disable-gas \ --disable-binutils \ From 6b0b10f0b2382c9f0a2700a99aa4cbb2f912f706 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 9 Jul 2020 11:35:47 -0700 Subject: [PATCH 06/16] Using new python 3.7.7 packages from github ft-resources --- Makefile | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 52ce0b7..c48b6a6 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,7 @@ SRC_LIBFTDI := $(SRCDIR)/libftdi # The version that will be appended to the various tool builds. RGT_VERSION := 8.3.0-2020.04.0 RGDB_VERSION := 8.3.0-2020.04.0 +RGDBP_VERSION := 8.3.0-2020.04.1 RGBU_VERSION := 2.32.0-2020.04.0 ROCD_VERSION := 0.10.0-2019.08.2 RQEMU_VERSION := 4.1.0-2019.08.0 @@ -259,7 +260,7 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib -$(UBUNTU64)-rgdb-python := --with-python=/scratch/carsteng/git/py3/install/bin/python3 +$(UBUNTU64)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64))/python" $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -273,7 +274,7 @@ $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/insta $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib $(DARWIN)-rgdb-configure := --with-included-gettext -$(DARWIN)-rgdb-python := --with-python=/scratch/carsteng/git/py3/install/bin/python3 +$(DARWIN)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN))/python" $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -286,7 +287,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-python := --with-python=/scratch/carsteng/git/py3/install/bin/python3 +$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python" $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" @@ -652,27 +653,27 @@ $(OBJDIR)/%/build/expat/configure: touch -c $@ # Builds riscv-gdb-only for various targets. -$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.zip: \ +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.zip: \ $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp - $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.zip,%,$@)) + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.zip,%,$@)) mkdir -p $(dir $@) - cd $(OBJDIR)/$($@_TARGET)/install; zip -rq $(abspath $@) riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET) + cd $(OBJDIR)/$($@_TARGET)/install; zip -rq $(abspath $@) riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$($@_TARGET) -$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.zip: \ +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.src.zip: \ $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp - $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.zip,%,$@)) + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.src.zip,%,$@)) mkdir -p $(dir $@) cd $(OBJDIR)/$($@_TARGET)/build; zip -rq $(abspath $@) riscv-gnu-gdb-only expat-gdb -$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.tar.gz: \ +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.tar.gz: \ $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp - $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.tar.gz,%,$@)) + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.tar.gz,%,$@)) mkdir -p $(dir $@) - $(TAR) --dereference --hard-dereference -C $(OBJDIR)/$($@_TARGET)/install -c riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET) | gzip > $(abspath $@) + $(TAR) --dereference --hard-dereference -C $(OBJDIR)/$($@_TARGET)/install -c riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$($@_TARGET) | gzip > $(abspath $@) -$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.tar.gz: \ +$(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.src.tar.gz: \ $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp - $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-%.src.tar.gz,%,$@)) + $(eval $@_TARGET := $(patsubst $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-%.src.tar.gz,%,$@)) mkdir -p $(dir $@) $(TAR) --dereference --hard-dereference -C $(OBJDIR)/$($@_TARGET)/build -c riscv-gnu-gdb-only expat-gdb | gzip > $(abspath $@) @@ -683,8 +684,13 @@ $(OBJDIR)/%/stamps/riscv-gnu-gdb-only/install.stamp: \ $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp: $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp,%,$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$($@_TARGET),$@)) rm -rf $(dir $@) mkdir -p $(dir $@) + mkdir -p $($@_INSTALL)/python + cd $(dir $@); curl -L -f -s -o python-3.7.7-$($@_TARGET).tar.gz https://github.com/sifive/freedom-tools-resources/releases/download/v0-test1/python-3.7.7-$($@_TARGET).tar.gz + $($@_INSTALL)/python; $(TAR) -xf $(abspath $(dir $@))/python-3.7.7-$($@_TARGET).tar.gz + cd $(dir $@); rm python-3.7.7-$($@_TARGET).tar.gz cp -a $(SRC_RGDB) $(dir $@) date > $@ @@ -692,7 +698,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ $(OBJDIR)/%/stamps/expat-gdb/install.stamp \ $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%,$@)) - $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET),$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$($@_TARGET),$@)) $(eval $@_BUILD := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp,%/build/riscv-gnu-gdb-only,$@)) rm -rf $(dir $@) mkdir -p $(dir $@) @@ -701,7 +707,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ --target=$(NEWLIB_TUPLE) \ $($($@_TARGET)-rgt-host) \ --prefix=$(abspath $($@_INSTALL)) \ - --with-pkgversion="SiFive GDB $(RGDB_VERSION)" \ + --with-pkgversion="SiFive GDB Solo $(RGDBP_VERSION)" \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ @@ -723,7 +729,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp: \ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%,$@)) - $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET),$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$($@_TARGET),$@)) $(eval $@_BUILD := $(patsubst %/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp,%/build/riscv-gnu-gdb-only,$@)) rm -rf $(dir $@) mkdir -p $(dir $@) @@ -732,7 +738,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp: \ --target=$(NEWLIB_TUPLE) \ $($($@_TARGET)-rgt-host) \ --prefix=$(abspath $($@_INSTALL)) \ - --with-pkgversion="SiFive GDB $(RGDB_VERSION)" \ + --with-pkgversion="SiFive GDB Solo $(RGDBP_VERSION)" \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ @@ -759,7 +765,7 @@ $(OBJDIR)/%/stamps/expat-gdb/install.stamp: \ $(OBJDIR)/%/build/expat-gdb/configure $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/stamps/expat-gdb/install.stamp,%,$@)) $(eval $@_BUILD := $(patsubst %/stamps/expat-gdb/install.stamp,%/build/expat-gdb,$@)) - $(eval $@_INSTALL := $(patsubst %/stamps/expat-gdb/install.stamp,%/install/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$($@_TARGET),$@)) + $(eval $@_INSTALL := $(patsubst %/stamps/expat-gdb/install.stamp,%/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$($@_TARGET),$@)) mkdir -p $($@_BUILD) cd $($@_BUILD); ./configure --prefix=$(abspath $($@_INSTALL)) $($($@_TARGET)-expat-configure) &>make-configure.log $(MAKE) -C $($@_BUILD) buildlib &>$($@_BUILD)/make-buildlib.log From eefe21a3d6d1b755d9bbcce07e20382859dc09d2 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 9 Jul 2020 11:38:46 -0700 Subject: [PATCH 07/16] Missed some search and replace --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index c48b6a6..39c7092 100644 --- a/Makefile +++ b/Makefile @@ -133,10 +133,10 @@ win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).zip win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).src.zip win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).tar.gz win64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64).src.tar.gz -win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).zip -win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).src.zip -win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).tar.gz -win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(WIN64).src.tar.gz +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64).zip +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64).src.zip +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64).tar.gz +win64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64).src.tar.gz win64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN64).zip win64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN64).src.zip win64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN64).tar.gz @@ -171,8 +171,8 @@ win32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(WIN32).src.tar.gz ubuntu64: ubuntu64-toolchain ubuntu64-openocd ubuntu64-qemu ubuntu64-xc3sprog ubuntu64-trace-decoder ubuntu64-sdk-utilities ubuntu64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU64).tar.gz ubuntu64-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU64).src.tar.gz -ubuntu64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(UBUNTU64).tar.gz -ubuntu64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(UBUNTU64).src.tar.gz +ubuntu64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64).tar.gz +ubuntu64-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64).src.tar.gz ubuntu64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64).tar.gz ubuntu64-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64).src.tar.gz ubuntu64-qemu: $(BINDIR)/riscv-qemu-$(RQEMU_VERSION)-$(UBUNTU64).tar.gz @@ -193,8 +193,8 @@ ubuntu32-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU32).src.tar.gz redhat: redhat-toolchain redhat-openocd redhat-qemu redhat-xc3sprog redhat-trace-decoder redhat-sdk-utilities redhat-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(REDHAT).tar.gz redhat-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(REDHAT).src.tar.gz -redhat-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(REDHAT).tar.gz -redhat-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(REDHAT).src.tar.gz +redhat-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT).tar.gz +redhat-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT).src.tar.gz redhat-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(REDHAT).tar.gz redhat-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(REDHAT).src.tar.gz redhat-qemu: $(BINDIR)/riscv-qemu-$(RQEMU_VERSION)-$(REDHAT).tar.gz @@ -209,8 +209,8 @@ redhat-sdk-utilities: $(BINDIR)/sdk-utilities-$(SDKU_VERSION)-$(REDHAT).src.tar. darwin: darwin-toolchain darwin-openocd darwin-qemu darwin-xc3sprog darwin-trace-decoder darwin-sdk-utilities darwin-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(DARWIN).tar.gz darwin-toolchain: $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(DARWIN).src.tar.gz -darwin-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(DARWIN).tar.gz -darwin-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDB_VERSION)-$(DARWIN).src.tar.gz +darwin-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN).tar.gz +darwin-gdb-only: $(BINDIR)/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN).src.tar.gz darwin-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(DARWIN).tar.gz darwin-openocd: $(BINDIR)/riscv-openocd-$(ROCD_VERSION)-$(DARWIN).src.tar.gz darwin-qemu: $(BINDIR)/riscv-qemu-$(RQEMU_VERSION)-$(DARWIN).tar.gz From 3251c826d952708a2639363dbcde0688e5f39c32 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 9 Jul 2020 11:44:02 -0700 Subject: [PATCH 08/16] Readding cd command --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 39c7092..998e73a 100644 --- a/Makefile +++ b/Makefile @@ -689,7 +689,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp: mkdir -p $(dir $@) mkdir -p $($@_INSTALL)/python cd $(dir $@); curl -L -f -s -o python-3.7.7-$($@_TARGET).tar.gz https://github.com/sifive/freedom-tools-resources/releases/download/v0-test1/python-3.7.7-$($@_TARGET).tar.gz - $($@_INSTALL)/python; $(TAR) -xf $(abspath $(dir $@))/python-3.7.7-$($@_TARGET).tar.gz + cd $($@_INSTALL)/python; $(TAR) -xf $(abspath $(dir $@))/python-3.7.7-$($@_TARGET).tar.gz cd $(dir $@); rm python-3.7.7-$($@_TARGET).tar.gz cp -a $(SRC_RGDB) $(dir $@) date > $@ From 9639e19a2260375d3cc8791fd5c0eef42ab73202 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 9 Jul 2020 12:00:09 -0700 Subject: [PATCH 09/16] Fixing more copy paste errors --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 998e73a..53c9682 100644 --- a/Makefile +++ b/Makefile @@ -260,7 +260,7 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib -$(UBUNTU64)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64))/python" +$(UBUNTU64)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64))/python/bin/python3" $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -274,7 +274,7 @@ $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/insta $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib $(DARWIN)-rgdb-configure := --with-included-gettext -$(DARWIN)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN))/python" +$(DARWIN)-rgdb-python := --with-python="$(abspath $(OBJ_DARWIN)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN))/python/bin/python3" $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -287,7 +287,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python" +$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_REDHAT)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python/bin/python3" $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" From e892020d5ca06f3849900f9fc953b446d7004bbd Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 9 Jul 2020 20:55:09 -0700 Subject: [PATCH 10/16] Updating windows build script --- Makefile | 5 +++-- scripts/pyconfig-mingw32.sh | 8 ++++---- scripts/python-c-gdb.sed | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 scripts/python-c-gdb.sed diff --git a/Makefile b/Makefile index 53c9682..4e6c053 100644 --- a/Makefile +++ b/Makefile @@ -230,8 +230,7 @@ $(WIN32)-expat-configure := --host=$(WIN32) $(WIN32)-xc3sp-host := --host=$(WIN32) $(WIN64)-rgt-host := --host=$(WIN64) $(WIN64)-rgcc-configure := --without-system-zlib -#$(WIN64)-rgdb-python := --with-python="$(abspath scripts/pyconfig-mingw32.sh)" -$(WIN64)-rgdb-python := --with-python=no +$(WIN64)-rgdb-python := --with-python="$(abspath $(OBJ_WIN64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64))/python/pyconfig-mingw32.sh" $(WIN64)-rocd-host := --host=$(WIN64) $(WIN64)-oftdi-configure := -DCMAKE_TOOLCHAIN_FILE="$(abspath $(OBJ_WIN64)/build/riscv-openocd/libftdi/cmake/Toolchain-x86_64-w64-mingw32.cmake)" -DLIBUSB_LIBRARIES="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/bin/libusb-1.0.dll)" -DLIBUSB_INCLUDE_DIR="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/include/libusb-1.0)" $(WIN64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib/pkgconfig" CFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" CPPFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" @@ -691,7 +690,9 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp: cd $(dir $@); curl -L -f -s -o python-3.7.7-$($@_TARGET).tar.gz https://github.com/sifive/freedom-tools-resources/releases/download/v0-test1/python-3.7.7-$($@_TARGET).tar.gz cd $($@_INSTALL)/python; $(TAR) -xf $(abspath $(dir $@))/python-3.7.7-$($@_TARGET).tar.gz cd $(dir $@); rm python-3.7.7-$($@_TARGET).tar.gz + cp scripts/pyconfig-mingw32.sh $($@_INSTALL)/python cp -a $(SRC_RGDB) $(dir $@) + $(SED) -E -i -f $(SCRIPTSDIR)/python-c-gdb.sed $(dir $@)/riscv-gdb/gdb/python/python.c date > $@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ diff --git a/scripts/pyconfig-mingw32.sh b/scripts/pyconfig-mingw32.sh index 453ed42..45f217d 100755 --- a/scripts/pyconfig-mingw32.sh +++ b/scripts/pyconfig-mingw32.sh @@ -1,17 +1,17 @@ #!/bin/sh # Ignore first argument -pydir=$(dirname $1) +pydir=$(dirname $0) shift for arg in $@; do case $arg in --prefix|--exec-prefix) - echo "${pydir}/../../../python" + echo "${pydir}" ;; --includes) - echo "-I${pydir}/../../../python/include" + echo "-I${pydir}/include" ;; --ldflags) - echo "-L${pydir}/../../../python/libs -lpython27" + echo "-L${pydir}/libs -lpython37" ;; esac shift diff --git a/scripts/python-c-gdb.sed b/scripts/python-c-gdb.sed new file mode 100644 index 0000000..d95d7e5 --- /dev/null +++ b/scripts/python-c-gdb.sed @@ -0,0 +1 @@ +:a;N;$!ba;s/#ifndef _WIN32.*#endif \/\* _WIN32 \*\//PyRun_SimpleFile \(file, filename\)\;/ From be33e491904075fcbf3382b97b845f09d3aff712 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Thu, 9 Jul 2020 20:57:50 -0700 Subject: [PATCH 11/16] Copy paste error --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4e6c053..7f2f3d7 100644 --- a/Makefile +++ b/Makefile @@ -692,7 +692,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp: cd $(dir $@); rm python-3.7.7-$($@_TARGET).tar.gz cp scripts/pyconfig-mingw32.sh $($@_INSTALL)/python cp -a $(SRC_RGDB) $(dir $@) - $(SED) -E -i -f $(SCRIPTSDIR)/python-c-gdb.sed $(dir $@)/riscv-gdb/gdb/python/python.c + $(SED) -E -i -f scripts/python-c-gdb.sed $(dir $@)/riscv-gdb/gdb/python/python.c date > $@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ From c505cbcd5373a9f73b40152c9eda5cec514c5f3d Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 13 Jul 2020 09:27:36 -0700 Subject: [PATCH 12/16] Changing centos build to also use a config script --- Makefile | 3 ++- scripts/pyconfig-centos6.sh | 18 ++++++++++++++++++ scripts/pyconfig-mingw32.sh | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 scripts/pyconfig-centos6.sh diff --git a/Makefile b/Makefile index 7f2f3d7..1c4db8f 100644 --- a/Makefile +++ b/Makefile @@ -286,7 +286,7 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_REDHAT)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python/bin/python3" +$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_REDHAT)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python/pyconfig-centos6.sh" $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" @@ -690,6 +690,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/stamp: cd $(dir $@); curl -L -f -s -o python-3.7.7-$($@_TARGET).tar.gz https://github.com/sifive/freedom-tools-resources/releases/download/v0-test1/python-3.7.7-$($@_TARGET).tar.gz cd $($@_INSTALL)/python; $(TAR) -xf $(abspath $(dir $@))/python-3.7.7-$($@_TARGET).tar.gz cd $(dir $@); rm python-3.7.7-$($@_TARGET).tar.gz + cp scripts/pyconfig-centos6.sh $($@_INSTALL)/python cp scripts/pyconfig-mingw32.sh $($@_INSTALL)/python cp -a $(SRC_RGDB) $(dir $@) $(SED) -E -i -f scripts/python-c-gdb.sed $(dir $@)/riscv-gdb/gdb/python/python.c diff --git a/scripts/pyconfig-centos6.sh b/scripts/pyconfig-centos6.sh new file mode 100755 index 0000000..965d9a4 --- /dev/null +++ b/scripts/pyconfig-centos6.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Ignore first argument +pydir=$(dirname $0) +shift +for arg in $@; do + case $arg in + --prefix|--exec-prefix) + echo "${pydir}" + ;; + --includes) + echo "-I${pydir}/include/python3.7m" + ;; + --libs|--ldflags) + echo "-L${pydir}/lib/python3.7/config-3.7m-x86_64-linux-gnu -L${pydir}/lib -lpython3.7m -lcrypt -lpthread -ldl -lutil -lrt -lm" + ;; + esac + shift +done diff --git a/scripts/pyconfig-mingw32.sh b/scripts/pyconfig-mingw32.sh index 45f217d..3c7dc29 100755 --- a/scripts/pyconfig-mingw32.sh +++ b/scripts/pyconfig-mingw32.sh @@ -10,7 +10,7 @@ for arg in $@; do --includes) echo "-I${pydir}/include" ;; - --ldflags) + --libs|--ldflags) echo "-L${pydir}/libs -lpython37" ;; esac From 1223626dad56f08642e54cd8d7eb18f0960003c3 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 13 Jul 2020 11:01:12 -0700 Subject: [PATCH 13/16] Adding gdb with python support to toolchain build --- Makefile | 59 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1c4db8f..78d1639 100644 --- a/Makefile +++ b/Makefile @@ -112,10 +112,10 @@ SRC_LIBUSB := $(SRCDIR)/libusb SRC_LIBFTDI := $(SRCDIR)/libftdi # The version that will be appended to the various tool builds. -RGT_VERSION := 8.3.0-2020.04.0 -RGDB_VERSION := 8.3.0-2020.04.0 +RGT_VERSION := 8.3.0-2020.04.1 +RGDB_VERSION := 8.3.0-2020.04.1 RGDBP_VERSION := 8.3.0-2020.04.1 -RGBU_VERSION := 2.32.0-2020.04.0 +RGBU_VERSION := 2.32.0-2020.04.1 ROCD_VERSION := 0.10.0-2019.08.2 RQEMU_VERSION := 4.1.0-2019.08.0 XC3SP_VERSION := 0.1.2-2019.08.0 @@ -382,16 +382,23 @@ $(BINDIR)/riscv64-unknown-elf-gcc-$(RGT_VERSION)-%.src.tar.gz: \ $(OBJDIR)/%/stamps/riscv-gnu-toolchain/install.stamp: \ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gcc-newlib-stage2/stamp \ - $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-newlib/stamp + $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-py-newlib/stamp mkdir -p $(dir $@) date > $@ $(OBJDIR)/%/build/riscv-gnu-toolchain/stamp: rm -rf $(dir $@) mkdir -p $(dir $@) + mkdir -p $($@_INSTALL)/python + cd $(dir $@); curl -L -f -s -o python-3.7.7-$($@_TARGET).tar.gz https://github.com/sifive/freedom-tools-resources/releases/download/v0-test1/python-3.7.7-$($@_TARGET).tar.gz + cd $($@_INSTALL)/python; $(TAR) -xf $(abspath $(dir $@))/python-3.7.7-$($@_TARGET).tar.gz + cd $(dir $@); rm python-3.7.7-$($@_TARGET).tar.gz + cp scripts/pyconfig-centos6.sh $($@_INSTALL)/python + cp scripts/pyconfig-mingw32.sh $($@_INSTALL)/python cp -a $(SRC_RBU) $(SRC_RGCC) $(SRC_RGDB) $(SRC_RNL) $(dir $@) cd $(dir $@)/riscv-gcc; ./contrib/download_prerequisites cd $(dir $@)/riscv-gcc/gcc/config/riscv; rm t-elf-multilib; ./multilib-generator $(MULTILIBS_GEN) > t-elf-multilib + $(SED) -E -i -f scripts/python-c-gdb.sed $(dir $@)/riscv-gdb/gdb/python/python.c date > $@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-binutils-newlib/stamp: \ @@ -439,7 +446,42 @@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ + $($($@_TARGET)-rgdb-configure) \ --with-python=no \ + --with-lzma=no \ + --enable-gdb \ + --disable-gas \ + --disable-binutils \ + --disable-ld \ + --disable-gold \ + --disable-gprof \ + CFLAGS="-O2" \ + CXXFLAGS="-O2" &>make-configure.log + $(MAKE) -C $(dir $@) &>$(dir $@)/make-build.log + $(MAKE) -C $(dir $@) install install-pdf install-html &>$(dir $@)/make-install.log + date > $@ + +$(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-py-newlib/stamp: \ + $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-newlib/stamp + $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-py-newlib/stamp,%,$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-toolchain/build-gdb-py-newlib/stamp,%/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$($@_TARGET),$@)) + $(eval $@_BUILD := $(patsubst %/build/riscv-gnu-toolchain/build-gdb-py-newlib/stamp,%/build/riscv-gnu-toolchain,$@)) + rm -rf $(dir $@) + mkdir -p $(dir $@) +# CC_FOR_TARGET is required for the ld testsuite. + cd $(dir $@) && CC_FOR_TARGET=$(NEWLIB_CC_FOR_TARGET) $(abspath $($@_BUILD))/riscv-gdb/configure \ + --target=$(NEWLIB_TUPLE) \ + $($($@_TARGET)-rgt-host) \ + --prefix=$(abspath $($@_INSTALL)) \ + --with-pkgversion="SiFive GDB $(RGDB_VERSION)" \ + --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ + --disable-werror \ + $(GDB_TARGET_FLAGS) \ + $($($@_TARGET)-rgdb-configure) \ + $($($@_TARGET)-rgdb-python) \ + --program-prefix="$(NEWLIB_TUPLE)-" \ + --program-suffix="-py" \ + --with-lzma=no \ --enable-gdb \ --disable-gas \ --disable-binutils \ @@ -640,6 +682,9 @@ $(OBJDIR)/%/stamps/expat/install.stamp: \ cd $($@_BUILD); ./configure --prefix=$(abspath $($@_INSTALL)) $($($@_TARGET)-expat-configure) &>make-configure.log $(MAKE) -C $($@_BUILD) buildlib &>$($@_BUILD)/make-buildlib.log $(MAKE) -C $($@_BUILD) installlib &>$($@_BUILD)/make-installlib.log + rm -f $(abspath $($@_INSTALL))/lib/libexpat*.dylib* + rm -f $(abspath $($@_INSTALL))/lib/libexpat*.so* + rm -f $(abspath $($@_INSTALL))/lib64/libexpat*.so* mkdir -p $(dir $@) date > $@ @@ -772,9 +817,9 @@ $(OBJDIR)/%/stamps/expat-gdb/install.stamp: \ cd $($@_BUILD); ./configure --prefix=$(abspath $($@_INSTALL)) $($($@_TARGET)-expat-configure) &>make-configure.log $(MAKE) -C $($@_BUILD) buildlib &>$($@_BUILD)/make-buildlib.log $(MAKE) -C $($@_BUILD) -j1 installlib &>$($@_BUILD)/make-installlib.log - rm -f $(abspath $($@_INSTALL))/lib/lib*.dylib* - rm -f $(abspath $($@_INSTALL))/lib/lib*.so* - rm -f $(abspath $($@_INSTALL))/lib64/lib*.so* + rm -f $(abspath $($@_INSTALL))/lib/libexpat*.dylib* + rm -f $(abspath $($@_INSTALL))/lib/libexpat*.so* + rm -f $(abspath $($@_INSTALL))/lib64/libexpat*.so* mkdir -p $(dir $@) date > $@ From f45f55a86248ad50382ef51d07871ed86a4d1ace Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 13 Jul 2020 11:07:17 -0700 Subject: [PATCH 14/16] Copy paste miss --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 78d1639..37353af 100644 --- a/Makefile +++ b/Makefile @@ -387,6 +387,8 @@ $(OBJDIR)/%/stamps/riscv-gnu-toolchain/install.stamp: \ date > $@ $(OBJDIR)/%/build/riscv-gnu-toolchain/stamp: + $(eval $@_TARGET := $(patsubst $(OBJDIR)/%/build/riscv-gnu-toolchain/stamp,%,$@)) + $(eval $@_INSTALL := $(patsubst %/build/riscv-gnu-toolchain/stamp,%/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$($@_TARGET),$@)) rm -rf $(dir $@) mkdir -p $(dir $@) mkdir -p $($@_INSTALL)/python From 404740145cd0252e9bbe28d47df9c9fcbf7d01ce Mon Sep 17 00:00:00 2001 From: cgsfv Date: Mon, 13 Jul 2020 17:28:31 -0700 Subject: [PATCH 15/16] Splitting python spec for gcc and gdb packages --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 37353af..3378bde 100644 --- a/Makefile +++ b/Makefile @@ -230,7 +230,8 @@ $(WIN32)-expat-configure := --host=$(WIN32) $(WIN32)-xc3sp-host := --host=$(WIN32) $(WIN64)-rgt-host := --host=$(WIN64) $(WIN64)-rgcc-configure := --without-system-zlib -$(WIN64)-rgdb-python := --with-python="$(abspath $(OBJ_WIN64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64))/python/pyconfig-mingw32.sh" +$(WIN64)-rgdb-python := --with-python="$(abspath $(OBJ_WIN64)/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(WIN64))/python/pyconfig-mingw32.sh" +$(WIN64)-rgdb-only-python := --with-python="$(abspath $(OBJ_WIN64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(WIN64))/python/pyconfig-mingw32.sh" $(WIN64)-rocd-host := --host=$(WIN64) $(WIN64)-oftdi-configure := -DCMAKE_TOOLCHAIN_FILE="$(abspath $(OBJ_WIN64)/build/riscv-openocd/libftdi/cmake/Toolchain-x86_64-w64-mingw32.cmake)" -DLIBUSB_LIBRARIES="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/bin/libusb-1.0.dll)" -DLIBUSB_INCLUDE_DIR="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64)/include/libusb-1.0)" $(WIN64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib/pkgconfig" CFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" CPPFLAGS="-L$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/lib -I$(abspath $(OBJ_WIN64)/install/riscv-openocd-$(ROCD_VERSION)-$(WIN64))/include" @@ -259,7 +260,8 @@ $(UBUNTU32)-expat-configure := --host=i686-linux-gnu $(UBUNTU32)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgt-host := --host=x86_64-linux-gnu $(UBUNTU64)-rgcc-configure := --with-system-zlib -$(UBUNTU64)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64))/python/bin/python3" +$(UBUNTU64)-rgdb-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(UBUNTU64))/python/bin/python3" +$(UBUNTU64)-rgdb-only-python := --with-python="$(abspath $(OBJ_UBUNTU64)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(UBUNTU64))/python/bin/python3" $(UBUNTU64)-ousb-configure := --disable-shared $(UBUNTU64)-rocd-host := --host=x86_64-linux-gnu $(UBUNTU64)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/riscv-openocd-$(ROCD_VERSION)-$(UBUNTU64))/lib -pthread" @@ -273,7 +275,8 @@ $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/insta $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib $(DARWIN)-rgdb-configure := --with-included-gettext -$(DARWIN)-rgdb-python := --with-python="$(abspath $(OBJ_DARWIN)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN))/python/bin/python3" +$(DARWIN)-rgdb-python := --with-python="$(abspath $(OBJ_DARWIN)/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(DARWIN))/python/bin/python3" +$(DARWIN)-rgdb-only-python := --with-python="$(abspath $(OBJ_DARWIN)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN))/python/bin/python3" $(DARWIN)-ousb-configure := --disable-shared $(DARWIN)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" $(DARWIN)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/riscv-openocd-$(ROCD_VERSION)-$(DARWIN))/lib -framework CoreFoundation -framework IOKit" @@ -286,7 +289,8 @@ $(DARWIN)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install $(DARWIN)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" CPPFLAGS="-I$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/include" LDFLAGS="-L$(abspath $(OBJ_DARWIN)/install/xc3sprog-$(XC3SP_VERSION)-$(DARWIN))/lib -liconv -framework CoreFoundation -framework IOKit" $(DARWIN)-xc3sp-framework := -framework CoreFoundation -framework IOKit $(REDHAT)-rgcc-configure := --with-system-zlib -$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_REDHAT)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python/pyconfig-centos6.sh" +$(REDHAT)-rgdb-python := --with-python="$(abspath $(OBJ_REDHAT)/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(REDHAT))/python/pyconfig-centos6.sh" +$(REDHAT)-rgdb-only-python := --with-python="$(abspath $(OBJ_REDHAT)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(REDHAT))/python/pyconfig-centos6.sh" $(REDHAT)-ousb-configure := --disable-shared $(REDHAT)-odeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -fPIC" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" $(REDHAT)-rocd-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib/pkgconfig:$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64/pkgconfig" CFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include -O2" CPPFLAGS="-I$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/include" LDFLAGS="-L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib -L$(abspath $(OBJ_REDHAT)/install/riscv-openocd-$(ROCD_VERSION)-$(REDHAT))/lib64 -lrt" @@ -792,7 +796,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp: \ --disable-werror \ $(GDB_TARGET_FLAGS) \ $($($@_TARGET)-rgdb-configure) \ - $($($@_TARGET)-rgdb-python) \ + $($($@_TARGET)-rgdb-only-python) \ --program-prefix="$(NEWLIB_TUPLE)-" \ --program-suffix="-py" \ --with-lzma=no \ From 7ef7018b3ff9a10880455c3f6b75c48d113515f2 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Tue, 14 Jul 2020 10:32:46 -0700 Subject: [PATCH 16/16] Missed the mac specific flag for binutils --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3378bde..c76ab2d 100644 --- a/Makefile +++ b/Makefile @@ -274,7 +274,7 @@ $(UBUNTU64)-xc3sp-host := --host=x86_64-linux-gnu $(UBUNTU64)-xdeps-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(UBUNTU64)-xc3sp-vars := PKG_CONFIG_PATH="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib/pkgconfig" CFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" CPPFLAGS="-I$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LIBUSB_INCLUDE_DIRS="$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/include" LDFLAGS="-L$(abspath $(OBJ_UBUNTU64)/install/xc3sprog-$(XC3SP_VERSION)-$(UBUNTU64))/lib" $(DARWIN)-rgcc-configure := --with-system-zlib -$(DARWIN)-rgdb-configure := --with-included-gettext +$(DARWIN)-rgbu-configure := --with-included-gettext $(DARWIN)-rgdb-python := --with-python="$(abspath $(OBJ_DARWIN)/install/riscv64-unknown-elf-gcc-$(RGT_VERSION)-$(DARWIN))/python/bin/python3" $(DARWIN)-rgdb-only-python := --with-python="$(abspath $(OBJ_DARWIN)/install/riscv64-unknown-elf-gdb-$(RGDBP_VERSION)-$(DARWIN))/python/bin/python3" $(DARWIN)-ousb-configure := --disable-shared @@ -424,6 +424,7 @@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-binutils-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(BINUTILS_TARGET_FLAGS) \ + $($($@_TARGET)-rgbu-configure) \ --with-python=no \ --disable-gdb \ --disable-sim \ @@ -452,7 +453,7 @@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ - $($($@_TARGET)-rgdb-configure) \ + $($($@_TARGET)-rgbu-configure) \ --with-python=no \ --with-lzma=no \ --enable-gdb \ @@ -483,7 +484,7 @@ $(OBJDIR)/%/build/riscv-gnu-toolchain/build-gdb-py-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ - $($($@_TARGET)-rgdb-configure) \ + $($($@_TARGET)-rgbu-configure) \ $($($@_TARGET)-rgdb-python) \ --program-prefix="$(NEWLIB_TUPLE)-" \ --program-suffix="-py" \ @@ -764,7 +765,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ - $($($@_TARGET)-rgdb-configure) \ + $($($@_TARGET)-rgbu-configure) \ --with-python=no \ --with-lzma=no \ --enable-gdb \ @@ -795,7 +796,7 @@ $(OBJDIR)/%/build/riscv-gnu-gdb-only/build-gdb-py-newlib/stamp: \ --with-bugurl="https://github.com/sifive/freedom-tools/issues" \ --disable-werror \ $(GDB_TARGET_FLAGS) \ - $($($@_TARGET)-rgdb-configure) \ + $($($@_TARGET)-rgbu-configure) \ $($($@_TARGET)-rgdb-only-python) \ --program-prefix="$(NEWLIB_TUPLE)-" \ --program-suffix="-py" \