summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-05-06 10:49:52 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-05-11 07:41:37 +0200
commit5f734311e4fe963ea41e686b1b7bae5b0ac3260f (patch)
tree6cf628528f20cc5b6fad22d87a65e28d8bdaad22 /rules
parent73fbfa7ed205c36178f95b983e1c7eea175420af (diff)
downloadOSELAS.Toolchain-5f734311e4fe963ea41e686b1b7bae5b0ac3260f.tar.gz
OSELAS.Toolchain-5f734311e4fe963ea41e686b1b7bae5b0ac3260f.tar.xz
use icecc for cross-compiling
Multiple things are needed to make this possible: - the wrapper dir must be first in $PATH to ensure that any available wrapper is used. - when gcc-first and gcc are done building, then a new icecc environment must be created. - use icerun to limit parallelization when xgcc/xg++ is used to build the internal libraries Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules')
-rw-r--r--rules/cross-gcc-first.make9
-rw-r--r--rules/cross-gcc.make10
-rw-r--r--rules/pre/toolchain.make2
3 files changed, 18 insertions, 3 deletions
diff --git a/rules/cross-gcc-first.make b/rules/cross-gcc-first.make
index d842939..6953a9a 100644
--- a/rules/cross-gcc-first.make
+++ b/rules/cross-gcc-first.make
@@ -31,7 +31,7 @@ CROSS_GCC_FIRST_LICENSE := ignore
# Prepare
# ----------------------------------------------------------------------------
-CROSS_GCC_FIRST_ENV := \
+CROSS_GCC_FIRST_CONF_ENV := \
$(HOST_ENV) \
CFLAGS="-g0 -O2" \
CXXFLAGS="-g0 -O2" \
@@ -60,6 +60,11 @@ CROSS_GCC_FIRST_CONF_OPT = \
--disable-libatomic \
--with-system-zlib
+ifdef PTXDIST_ICECC
+CROSS_GCC_FIRST_MAKE_ENV := \
+ STAGE_CC_WRAPPER=icerun
+endif
+
# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------
@@ -76,7 +81,7 @@ $(STATEDIR)/cross-gcc-first.install:
ln -sfv libgcc.a `$(CROSS_GCC_FIRST_PREFIX)/bin/$(PTXCONF_GNU_TARGET)-gcc \
-print-libgcc-file-name | \
sed 's/libgcc/&_s/'`
-
+ @ptxd_make_setup_target_compiler $(CROSS_GCC_FIRST_PREFIX)/bin
@$(call touch)
# vim: syntax=make
diff --git a/rules/cross-gcc.make b/rules/cross-gcc.make
index c4ef5fa..26bb3e7 100644
--- a/rules/cross-gcc.make
+++ b/rules/cross-gcc.make
@@ -149,6 +149,11 @@ $(STATEDIR)/cross-gcc.prepare:
# Compile
# ----------------------------------------------------------------------------
+ifdef PTXDIST_ICECC
+CROSS_GCC_MAKE_ENV := \
+ STAGE_CC_WRAPPER=icerun
+endif
+
CROSS_GCC_MAKE_OPT := \
build_tooldir=$(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/$(PTXCONF_GNU_TARGET) \
all
@@ -178,7 +183,12 @@ ifneq ($(call remove_quotes,$(PTXDIST_SYSROOT_CROSS)),)
$(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/install-tools/mkheaders.conf \
$(wildcard $(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/include-fixed/bits/statx.h)
endif
+ @$(call touch)
+$(STATEDIR)/cross-gcc.install.post:
+ @$(call targetinfo)
+ @$(call world/install.post, CROSS_GCC)
+ @ptxd_make_setup_target_compiler $(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/bin
@$(call touch)
# vim: syntax=make
diff --git a/rules/pre/toolchain.make b/rules/pre/toolchain.make
index ec948f2..fd3703a 100644
--- a/rules/pre/toolchain.make
+++ b/rules/pre/toolchain.make
@@ -78,7 +78,7 @@ endif
# gcc-first
#
CROSS_GCC_FIRST_PREFIX := $(PTXDIST_PLATFORMDIR)/sysroot-target
-CROSS_PATH := $(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/bin:$(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/sbin:$(CROSS_GCC_FIRST_PREFIX)/bin:$(PATH)
+CROSS_PATH := $(PTXDIST_SYSROOT_HOST)/lib/wrapper:$(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/bin:$(subst $(PTXDIST_SYSROOT_HOST)/lib/wrapper:,,$(PATH))
HOST_CROSS_PATH := $(CROSS_PATH)
#