add support for canadian cross build

A mingw-w64 -> arm-linux-musleabi canadian cross compiler can be built
by setting the following variables in config.mak:

TARGET = arm-linux-musleabi
GCC_CONFIG += --host=x86_64-w64-mingw32
CANADIAN := y

Note that this requires both build->host (x86_64-w64-mingw32) and
build->target (arm-linux-musleabi) toolchains to already exist on the
build machine.
This commit is contained in:
Patrick Oppenlander 2016-05-30 15:04:34 +10:00
parent f00b09f654
commit 267663b951
1 changed files with 11 additions and 5 deletions

View File

@ -61,16 +61,22 @@ FULL_TOOLCHAIN_CONFIG = --enable-languages=c,c++ \
FULL_MUSL_CONFIG = $(MUSL_CONFIG) \
--prefix= --host=$(TARGET)
ifeq ($(NATIVE),)
ifneq ($(NATIVE),)
SYSROOT = /
FULL_TOOLCHAIN_CONFIG += --host=$(TARGET)
MUSL_VARS =
else ifneq ($(CANADIAN),)
SYSROOT = /$(TARGET)
FULL_MUSL_CONFIG += CROSS_COMPILE=$(TARGET)- LIBCC="../obj_toolchain/$(TARGET)/libgcc/libgcc.a"
MUSL_VARS =
obj_musl/.lc_built: | obj_toolchain/$(TARGET)/libgcc/libgcc.a
obj_toolchain/.lc_built: | obj_sysroot/.lc_libs obj_sysroot/.lc_headers
else
SYSROOT = /$(TARGET)
FULL_MUSL_CONFIG += CC="$(XGCC)" LIBCC="../obj_toolchain/$(TARGET)/libgcc/libgcc.a"
MUSL_VARS = AR=../obj_toolchain/binutils/ar RANLIB=../obj_toolchain/binutils/ranlib
obj_musl/.lc_built: | obj_toolchain/$(TARGET)/libgcc/libgcc.a
obj_toolchain/.lc_built: | obj_sysroot/.lc_libs obj_sysroot/.lc_headers
else
SYSROOT = /
FULL_TOOLCHAIN_CONFIG += --host=$(TARGET)
MUSL_VARS =
endif
ifeq ($(TARGET),)