Move toolchain from /tools to /tools_${arch}

This will allow us to run multiple builds on the same
system at the same time (or at least have them on disk).

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2017-11-23 11:39:23 +00:00
parent f1effdf758
commit 6c4cc7ea1b
39 changed files with 145 additions and 139 deletions

34
lfs/gcc
View File

@@ -50,7 +50,7 @@ ifeq "$(BUILD_ARCH)" "armv5tel"
FULL_BOOTSTRAP = 1
endif
# Normal build or /tools build.
# Normal build or $(TOOLS_DIR) build.
#
ifeq "$(ROOT)" ""
TARGET = $(DIR_INFO)/$(THISAPP)
@@ -71,10 +71,10 @@ ifeq "$(PASS)" "1"
TARGET = $(DIR_INFO)/$(THISAPP)-tools1
EXTRA_CONFIG = \
--target=$(CROSSTARGET) \
--prefix=/tools \
--prefix=$(TOOLS_DIR) \
--with-sysroot=$(ROOT) \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--with-local-prefix=$(TOOLS_DIR) \
--with-native-system-header-dir=$(TOOLS_DIR)/include \
--disable-nls \
--disable-shared \
--disable-decimal-float \
@@ -107,9 +107,9 @@ ifeq "$(PASS)" "2"
RANLIB="$(CROSSTARGET)-ranlib"
EXTRA_CONFIG = \
--build=$(BUILDTARGET) \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--prefix=$(TOOLS_DIR) \
--with-local-prefix=$(TOOLS_DIR) \
--with-native-system-header-dir=$(TOOLS_DIR)/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-libgomp
@@ -130,13 +130,13 @@ else
RANLIB="$(CROSSTARGET)-ranlib"
EXTRA_CONFIG = \
--host=$(CROSSTARGET) \
--prefix=/tools \
--prefix=$(TOOLS_DIR) \
--with-sysroot=$(ROOT) \
--disable-shared \
--disable-nls \
--disable-libstdcxx-threads \
--disable-libstdcxx-pch \
--with-gxx-include-dir=/tools/$(CROSSTARGET)/include/c++/$(VER)
--with-gxx-include-dir=$(TOOLS_DIR)/$(CROSSTARGET)/include/c++/$(VER)
EXTRA_MAKE =
EXTRA_INSTALL =
endif
@@ -234,18 +234,18 @@ ifeq "$(TOOLCHAIN)" "1"
ifeq "$(PASS)" "2"
cd $(DIR_APP) && cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
`dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name)`/include-fixed/limits.h
`dirname $$($(TOOLS_DIR)/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name)`/include-fixed/limits.h
endif
for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
-o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h -o -name aarch64-linux.h); do \
echo "Processing $${file}..."; \
sed -i $${file} \
-e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g'; \
-e 's@/lib\(64\)\?\(32\)\?/ld@$(TOOLS_DIR)&@g' \
-e 's@/usr@$(TOOLS_DIR)@g'; \
echo '#undef STANDARD_STARTFILE_PREFIX_1' >> $${file}; \
echo '#undef STANDARD_STARTFILE_PREFIX_2' >> $${file}; \
echo '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"' >> $${file}; \
echo '#define STANDARD_STARTFILE_PREFIX_1 "$(TOOLS_DIR)/lib/"' >> $${file}; \
echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \
done
endif
@@ -271,18 +271,18 @@ endif
ifeq "$(TOOLCHAIN)" "1"
ifeq "$(PASS)" "1"
ln -svf libgcc.a $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/')
ln -svf libgcc.a $$($(TOOLS_DIR)/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/')
endif
ifeq "$(PASS)" "2"
ln -svf gcc /tools/bin/cc
ln -svf gcc $(TOOLS_DIR)/bin/cc
# remove gdb python files from libdir
rm -rf /tools/lib/*-gdb.py
rm -rf $(TOOLS_DIR)/lib/*-gdb.py
endif
ifeq "$(PASS)" "L"
# Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70936
sed -e "s/^#include_next/#include/" -i /tools/$(CROSSTARGET)/include/c++/$(VER)/cstdlib
sed -e "s/^#include_next/#include/" -i $(TOOLS_DIR)/$(CROSSTARGET)/include/c++/$(VER)/cstdlib
endif
else # NON-TOOLCHAIN