From: Arne Fitzenreiter Date: Tue, 18 Aug 2009 21:41:20 +0000 (+0200) Subject: Add x86_64 target to toolchain. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bd410e77e7c8ef8279725ce06675c5f2164db25;p=ipfire-3.x.git Add x86_64 target to toolchain. --- diff --git a/lfs/gcc b/lfs/gcc index 8b1ea5ce6..25889c0a5 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -61,9 +61,19 @@ CXXFLAGS = GMP = $(shell grep ^PKG_VER $(DIR_LFS)/gmp | awk '{ print $$3 }') MPFR = $(shell grep ^PKG_VER $(DIR_LFS)/mpfr | awk '{ print $$3 }') +ifneq "$(STAGE)" "base" ifeq "$(MACHINE)" "i586" CONFIGURE_ARGS = --disable-decimal-float endif +endif + +ifeq "$(MACHINE)" "x86_64" + CONFIGURE_ARGS = --without-cloog --without-ppl --disable-multilib +endif + +ifneq "$(MACHINE)" "x86_64" + CONFIG_CPU = --with-cpu=$(MACHINE) --with-arch=$(MACHINE) +endif ############################################################################### # Top-level Rules @@ -116,6 +126,8 @@ ifeq "$(PASS)" "1" ## Enable -fPIC by default cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \ -i gcc/config/i386/linux.h + cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \ + -i gcc/config/i386/x86-64.h # libssp has no use with new versions of Glibc. Glibc completely replaces all # functions in libssp, linking to libssp will cause conflicts with libc, so @@ -126,8 +138,7 @@ ifeq "$(PASS)" "1" ../$(THISAPP)/configure \ $(CONFIGURE_ARCH) \ --target=$(IFS_TARGET) \ - --with-cpu=$(MACHINE) \ - --with-arch=$(MACHINE) \ + $(CONFIG_CPU) \ --prefix=$(TOOLS_DIR) \ --with-local-prefix=$(TOOLS_DIR) \ --libexecdir=$(TOOLS_DIR)/lib \ @@ -166,6 +177,14 @@ ifeq "$(PASS)" "2" touch $$file.orig; \ done +ifeq "$(MACHINE)" "x86_64" + # Remove multilib options and searchpath (/lib... /usr/lib...) + cd $(DIR_APP) && echo "" > gcc/config/i386/t-linux64 + ## Enable -fPIC by default (why i have to do this again ???) + cd $(DIR_APP) && sed 's/^\(#define CC1_SPEC.*\)\("\)$$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \ + -i gcc/config/i386/x86-64.h +endif + # Libgomp uses -Werror regardless of --disable-werror, and this will cause a # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings: cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure @@ -175,8 +194,7 @@ ifeq "$(PASS)" "2" ../$(THISAPP)/configure \ $(CONFIGURE_ARCH) \ --target=$(IFS_TARGET) \ - --with-cpu=$(MACHINE) \ - --with-arch=$(MACHINE) \ + $(CONFIG_CPU) \ --prefix=$(TOOLS_DIR) \ --with-local-prefix=$(TOOLS_DIR) \ --libexecdir=$(TOOLS_DIR)/lib \ @@ -213,8 +231,7 @@ ifeq "$(STAGE)" "base" ../$(THISAPP)/configure \ $(CONFIGURE_ARCH) \ --target=$(IFS_TARGET) \ - --with-cpu=$(MACHINE) \ - --with-arch=$(MACHINE) \ + $(CONFIG_CPU) \ --prefix=/usr \ --libexecdir=/usr/lib \ --enable-espf \ @@ -226,7 +243,8 @@ ifeq "$(STAGE)" "base" --disable-bootstrap \ --disable-werror \ --disable-libssp \ - --disable-static + --disable-static \ + $(CONFIGURE_ARGS) cd $(DIR_SRC)/gcc-build && make $(PARALLELISMFLAGS) cd $(DIR_SRC)/gcc-build && make install diff --git a/lfs/gmp b/lfs/gmp index 03733f3fc..aec2eb185 100644 --- a/lfs/gmp +++ b/lfs/gmp @@ -56,6 +56,11 @@ define LONG_DESC emphasizes speed over simplicity/elegance in its operations. endef +ifeq "$(MACHINE)" "x86_64" + ABI = 64 +else + ABI = 32 +endif ############################################################################### # Top-level Rules ############################################################################### @@ -84,7 +89,7 @@ $(objects): $(OBJECT): $(objects) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && ABI=32 \ + cd $(DIR_APP) && ABI=$(ABI) \ ./configure \ $(CONFIGURE_ARCH) \ --prefix=/usr \ diff --git a/lfs/stage1 b/lfs/stage1 index dfed2a9e2..38b8c972d 100644 --- a/lfs/stage1 +++ b/lfs/stage1 @@ -76,4 +76,8 @@ $(objects): $(OBJECT): $(objects) @$(PREBUILD) -mkdir -p $(TOOLS_DIR)/usr/bin +ifeq "$(MACHINE)" "x86_64" + #Link lib64 to lib on 64bit target + ln -sf ./lib $(TOOLS_DIR)/lib64 +endif @$(POSTBUILD) diff --git a/lfs/stage2 b/lfs/stage2 index a15a5af2d..98ac3a090 100644 --- a/lfs/stage2 +++ b/lfs/stage2 @@ -115,4 +115,9 @@ $(OBJECT): $(objects) -mkdir -p /home/nobody chown -R nobody:nobody /home/nobody +ifeq "$(MACHINE)" "x86_64" + # Link lib64 to lib for 64bit target + ln -sf lib /lib64 + ln -sf lib /use/lib64 +endif @$(POSTBUILD) diff --git a/tools/make-constants b/tools/make-constants index b6e1b2cba..6cb4e8659 100644 --- a/tools/make-constants +++ b/tools/make-constants @@ -26,7 +26,7 @@ # Default target TARGET=${TARGET-i686} -POSSIBLE_TARGETS="i686 i586 i486 via-c7 via-c3 geodelx atom core2duo" +POSSIBLE_TARGETS="i686 i586 i486 via-c7 via-c3 geodelx atom core2duo x86_64" # Configuration rootdir CONFIG_ROOT=/etc/$SNAME @@ -128,6 +128,12 @@ elif [ 'geodelx' = $TARGET ]; then CFLAGS="-Os -march=geode $GLOBAL_CFLAGS" CXXFLAGS="${CFLAGS}" ICECC=off +elif [ 'x86_64' = $TARGET ]; then + MACHINE=x86_64 + IFS_TARGET="${MACHINE}-pc-linux-gnu" + CFLAGS="-Os $GLOBAL_CFLAGS" + CXXFLAGS="${CFLAGS}" + LINKER=/lib64/ld-linux-x86-64.so.2 else beautify message FAIL echo "Not a valid target arch ($POSSIBLE_TARGETS) - $TARGET"