From 89e2c05d92c6e9ad077bf2c12f24e495fbaf1c7d Mon Sep 17 00:00:00 2001 From: Kongou Hikari Date: Wed, 28 Aug 2019 11:51:06 +0800 Subject: [PATCH] Fix cross compiling error & tweaking multilib setting --- .gitignore | 5 ++++- Makefile.in | 19 +++++++++++++++++-- configure | 2 +- configure.ac | 2 +- riscv-binutils | 2 +- riscv-gcc | 2 +- riscv-gdb | 2 +- 7 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f63fbd3b8c5..fc2c416139d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ autom4te.cache -build +test +build* +stamps +install* config.log config.status Makefile diff --git a/Makefile.in b/Makefile.in index dd2583f6c1c..3e6282a8491 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,6 +81,14 @@ MUSL_CXX_FOR_TARGET ?= $(MUSL_TUPLE)-g++ CONFIGURE_HOST = @configure_host@ +#For cross-compiling to Windows + +ifdef CONFIGURE_HOST + TARGET_GCC_EXECUTABLE := $(NEWLIB_TUPLE)-gcc +else + TARGET_GCC_EXECUTABLE := $(INSTALL_DIR)/bin/$(NEWLIB_TUPLE)-gcc +endif + all: @default_target@ newlib: stamps/build-gcc-newlib-stage2 linux: stamps/build-gcc-linux-stage2 @@ -408,7 +416,8 @@ stamps/build-binutils-newlib: $(srcdir)/riscv-binutils --disable-gdb \ --disable-sim \ --disable-libdecnumber \ - --disable-readline + --disable-readline \ + --disable-nls $(MAKE) -C $(notdir $@) $(MAKE) -C $(notdir $@) install mkdir -p $(dir $@) && touch $@ @@ -434,6 +443,10 @@ stamps/build-gdb-newlib: $(srcdir)/riscv-gdb $(MAKE) -C $(notdir $@) install mkdir -p $(dir $@) && touch $@ +ifdef CONFIGURE_HOST +stamps/build-gcc-newlib-stage1: stamps/build-binutils-newlib + mkdir -p $(dir $@) && touch $@ +else stamps/build-gcc-newlib-stage1: $(srcdir)/riscv-gcc stamps/build-binutils-newlib if test -f $