summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2013-03-14 16:25:54 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2013-03-14 16:43:06 +0000
commitfbecf9d3bfd7e961e39c3bf2cc068572a5c379a3 (patch)
treefcc13ecaf3973a592f78af97c4d02702ebf4c9b0
parent19e060b7ab6d7cbc118a6646b9fed0adf35afedf (diff)
downloadgcc-tarball-fbecf9d3bfd7e961e39c3bf2cc068572a5c379a3.tar.gz
Use MORPH_ARCH field to set target-specific flags
Also, use config.guess when we need to know BUILD, because Morph no longer sets this variable.
-rw-r--r--gcc.morph2
-rw-r--r--gcc.morph.yaml2
-rwxr-xr-xmorph-arch-config10
-rw-r--r--stage1-gcc.morph2
-rw-r--r--stage1-gcc.morph.yaml5
-rw-r--r--stage2-gcc.morph2
-rw-r--r--stage2-gcc.morph.yaml6
7 files changed, 20 insertions, 9 deletions
diff --git a/gcc.morph b/gcc.morph
index ce2a95479b..90e18bb165 100644
--- a/gcc.morph
+++ b/gcc.morph
@@ -3,7 +3,7 @@
"kind": "chunk",
"configure-commands": [
"mkdir o",
- "cd o && \\\n../configure --prefix=\"$PREFIX\" --disable-nls $(morph-arch-flags) \\\n `# [1]` --libdir=$PREFIX/lib \\\n `# [2]` --disable-multilib \\\n `# [3]` --disable-libgomp --without-cloog --without-ppl \\\n `# [4]` --enable-__cxa_atexit \\\n `# [5]` --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\" \\\n `# [6]` --with-system-zlib \\\n --enable-languages=c,c++ --enable-shared --enable-threads=posix\n"
+ "cd o && \\\n../configure --prefix=\"$PREFIX\" --disable-nls $(morph-arch-config) \\\n `# [1]` --libdir=$PREFIX/lib \\\n `# [2]` --disable-multilib \\\n `# [3]` --disable-libgomp --without-cloog --without-ppl \\\n `# [4]` --enable-__cxa_atexit \\\n `# [5]` --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\" \\\n `# [6]` --with-system-zlib \\\n --enable-languages=c,c++ --enable-shared --enable-threads=posix\n"
],
"build-commands": [
"cd o && make"
diff --git a/gcc.morph.yaml b/gcc.morph.yaml
index a08064269c..893ddbbe5e 100644
--- a/gcc.morph.yaml
+++ b/gcc.morph.yaml
@@ -14,7 +14,7 @@ configure-commands:
# 6. Avoid having more than one copy of ZLib in use on the system
- |
cd o && \
- ../configure --prefix="$PREFIX" --disable-nls $TARGET_GCC_CONFIG \
+ ../configure --prefix="$PREFIX" --disable-nls $(morph-arch-config) \
`# [1]` --libdir=$PREFIX/lib \
`# [2]` --disable-multilib \
`# [3]` --disable-libgomp --without-cloog --without-ppl \
diff --git a/morph-arch-config b/morph-arch-config
new file mode 100755
index 0000000000..f9ca2c5a0c
--- /dev/null
+++ b/morph-arch-config
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# morph-arch-config: ouput GCC-specific configuration for specific
+# Morph architectures
+
+# Morph's armv7* architecture is always armv7-a
+case "$MORPH_ARCH" in
+ armv7*) echo "--with-arch=armv7-a" ;;
+esac
+
diff --git a/stage1-gcc.morph b/stage1-gcc.morph
index 6733e8fbbc..422975a03a 100644
--- a/stage1-gcc.morph
+++ b/stage1-gcc.morph
@@ -3,7 +3,7 @@
"kind": "chunk",
"configure-commands": [
"mkdir o",
- "cd o &&\n../configure --prefix=\"$PREFIX\" --disable-nls \\\n --build=$BUILD --host=$BUILD --target=$TARGET_STAGE1 \\\n $TARGET_GCC_CONFIG --disable-bootstrap \\\n `# [1]` --with-local-prefix=\"$PREFIX\" \\\n `# [2]` --with-native-system-header-dir=\"$PREFIX/include\" \\\n `# [3]` --enable-languages=c --disable-decimal-float \\\n --disable-libmudflap --disable-libquadmath --disable-libssp \\\n --disable-shared --disable-threads --disable-target-libiberty \\\n --disable-target-zlib --without-headers --with-newlib \\\n --with-system-zlib \\\n `# [4]` --libdir=\"$PREFIX/lib\" --disable-multilib --disable-libgomp \\\n --without-cloog --without-ppl \\\n --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\"\n"
+ "cd o &&\n../configure --prefix=\"$PREFIX\" --disable-nls \\\n --build=$(sh ../config.guess) --host=$(sh ../config.guess) \\\n --target=$TARGET_STAGE1 $(morph-arch-config) \\\n --disable-bootstrap \\\n `# [1]` --with-local-prefix=\"$PREFIX\" \\\n `# [2]` --with-native-system-header-dir=\"$PREFIX/include\" \\\n `# [3]` --enable-languages=c --disable-decimal-float \\\n --disable-libmudflap --disable-libquadmath --disable-libssp \\\n --disable-shared --disable-threads --disable-target-libiberty \\\n --disable-target-zlib --without-headers --with-newlib \\\n --with-system-zlib \\\n `# [4]` --libdir=\"$PREFIX/lib\" --disable-multilib --disable-libgomp \\\n --without-cloog --without-ppl \\\n --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\"\n"
],
"build-commands": [
"cd o && make"
diff --git a/stage1-gcc.morph.yaml b/stage1-gcc.morph.yaml
index 22763ba885..3ac48bfa49 100644
--- a/stage1-gcc.morph.yaml
+++ b/stage1-gcc.morph.yaml
@@ -17,8 +17,9 @@ configure-commands:
- |
cd o &&
../configure --prefix="$PREFIX" --disable-nls \
- --build=$BUILD --host=$BUILD --target=$TARGET_STAGE1 \
- $TARGET_GCC_CONFIG --disable-bootstrap \
+ --build=$(sh ../config.guess) --host=$(sh ../config.guess) \
+ --target=$TARGET_STAGE1 $(morph-arch-config) \
+ --disable-bootstrap \
`# [1]` --with-local-prefix="$PREFIX" \
`# [2]` --with-native-system-header-dir="$PREFIX/include" \
`# [3]` --enable-languages=c --disable-decimal-float \
diff --git a/stage2-gcc.morph b/stage2-gcc.morph
index ef1315d4a0..056a352596 100644
--- a/stage2-gcc.morph
+++ b/stage2-gcc.morph
@@ -5,7 +5,7 @@
"stage2-eglibc-fix-specs",
"cat \"gcc/limitx.h\" \"gcc/glimits.h\" \"gcc/limity.h\" > limits.h.tmp\nlibgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name))\ncp limits.h.tmp \"$libgcc_dir/include-fixed/limits.h\"\n",
"mkdir o",
- "export STAGE2_SYSROOT=\"$(dirname $(pwd))\"\nexport CC=\"$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT\"\nexport LDFLAGS=\"-Wl,--sysroot=$STAGE2_SYSROOT\"\ncd o && ../configure --prefix=\"$PREFIX\" --disable-nls \\\n `# [1]` --build=$BUILD --host=$TARGET_STAGE1 --target=$TARGET_STAGE1 \\\n $TARGET_GCC_CONFIG \\\n --disable-bootstrap \\\n `# [2]` --enable-languages=c \\\n `# [3]` --with-local-prefix=$PREFIX \\\n `# [4]` --with-build-sysroot=\"$STAGE2_SYSROOT\" \\\n `# [5]` --libdir=$PREFIX/lib --disable-multilib --disable-libgomp \\\n --without-cloog --without-ppl \\\n --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\" \\\n --with-system-zlib \\\n --enable-clocale=gnu --enable-shared --enable-threads=posix\n"
+ "export STAGE2_SYSROOT=\"$(dirname $(pwd))\"\nexport CC=\"$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT\"\nexport LDFLAGS=\"-Wl,--sysroot=$STAGE2_SYSROOT\"\ncd o && ../configure --prefix=\"$PREFIX\" --disable-nls \\\n --disable-bootstrap \\\n `# [1]` --build=$(sh ../config.guess) --host=$TARGET_STAGE1 \\\n --target=$TARGET_STAGE1 $(morph-arch-config) \\\n `# [2]` --enable-languages=c \\\n `# [3]` --with-local-prefix=$PREFIX \\\n `# [4]` --with-build-sysroot=\"$STAGE2_SYSROOT\" \\\n `# [5]` --libdir=$PREFIX/lib --disable-multilib --disable-libgomp \\\n --without-cloog --without-ppl \\\n --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\" \\\n --with-system-zlib \\\n --enable-clocale=gnu --enable-shared --enable-threads=posix\n"
],
"build-commands": [
"export STAGE2_SYSROOT=\"$(dirname $(pwd))\"\ncd o && make\n"
diff --git a/stage2-gcc.morph.yaml b/stage2-gcc.morph.yaml
index efa11be14c..2a293afbcb 100644
--- a/stage2-gcc.morph.yaml
+++ b/stage2-gcc.morph.yaml
@@ -43,9 +43,9 @@ configure-commands:
export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT"
export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
cd o && ../configure --prefix="$PREFIX" --disable-nls \
- `# [1]` --build=$BUILD --host=$TARGET_STAGE1 --target=$TARGET_STAGE1 \
- $TARGET_GCC_CONFIG \
- --disable-bootstrap \
+ --disable-bootstrap \
+ `# [1]` --build=$(sh ../config.guess) --host=$TARGET_STAGE1 \
+ --target=$TARGET_STAGE1 $(morph-arch-config) \
`# [2]` --enable-languages=c \
`# [3]` --with-local-prefix=$PREFIX \
`# [4]` --with-build-sysroot="$STAGE2_SYSROOT" \