Allow building the toolchain for x86_64
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 22 Aug 2015 10:25:49 +0000 (12:25 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 22 Aug 2015 10:25:49 +0000 (12:25 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/binutils
lfs/gcc
lfs/glibc

index 08bc7c9..0fdc570 100644 (file)
@@ -36,6 +36,8 @@ DIR_APP    = $(DIR_SRC)/$(THISAPP)
 ifeq "$(ROOT)" ""
   TARGET = $(DIR_INFO)/$(THISAPP)
   EXTRA_CONFIG = \
+       --host="${BUILDTARGET}" \
+       --build="${BUILDTARGET}" \
        --prefix=/usr \
        --enable-shared \
        --disable-nls
@@ -76,6 +78,9 @@ ifeq "$(MACHINE_TYPE)" "arm"
                --with-float=soft
 endif
 
+EXTRA_CONFIG += \
+       --enable-64-bit-bfd
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
@@ -125,9 +130,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        # Prevent installing libiberty to lib64.
        cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
 
-       cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
-       cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MACHINE=
-       cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MACHINE=
+       cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) $(DIR_APP)/configure $(EXTRA_CONFIG)
+       cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
+       cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
 ifeq "$(ROOT)" ""
        cp -v $(DIR_APP)/include/libiberty.h /usr/include
 else
diff --git a/lfs/gcc b/lfs/gcc
index 0264d37..ca6f4d7 100644 (file)
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -114,6 +114,11 @@ ifeq "$(MACHINE)" "i586"
                --with-tune=generic
 endif
 
+ifeq "$(MACHINE)" "x86_64"
+       EXTRA_CONFIG += \
+               --disable-multilib
+endif
+
 EXTRA_CONFIG += \
        --with-bugurl=http://bugtracker.ipfire.org \
        --disable-libunwind-exceptions \
index 4ec71a7..3391d2d 100644 (file)
--- a/lfs/glibc
+++ b/lfs/glibc
@@ -304,10 +304,15 @@ ifeq "$(ROOT)" ""
 ifeq "$(MACHINE_TYPE)" "arm"
        cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
                scripts/test-installation.pl
+else
+ifeq "$(MACHINE)" "x86_64"
+       cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
+               scripts/test-installation.pl
 else
        cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
                scripts/test-installation.pl
 endif
+endif
 endif
 
        cd $(DIR_SRC)/glibc-build && \
@@ -337,6 +342,8 @@ ifeq "$(ROOT)" ""
 
        # Timezone data will be shipped by tzdata.
        rm -rfv /usr/share/zoneinfo
+else
+       ln -svf lib /tools/lib64
 endif
        @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
        @$(POSTBUILD)