diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-14 10:58:40 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-14 10:58:40 +0000 |
commit | cacfffaed987a877570ee8551c2fc669916fe8ec (patch) | |
tree | 4687c4ca23b9d07da16acb9583b04e7457fbbbaf | |
parent | 2f39ec7032e3576108133524e4d1bf7638216261 (diff) | |
download | gcc-tarball-cacfffaed987a877570ee8551c2fc669916fe8ec.tar.gz |
Convert JSON morphologies to YAML
-rw-r--r-- | gcc.morph | 58 | ||||
-rw-r--r-- | gcc.morph.yaml | 42 | ||||
-rw-r--r-- | stage1-gcc.morph | 63 | ||||
-rw-r--r-- | stage1-gcc.morph.yaml | 48 | ||||
-rw-r--r-- | stage2-gcc.morph | 101 | ||||
-rw-r--r-- | stage2-gcc.morph.yaml | 84 |
6 files changed, 174 insertions, 222 deletions
@@ -1,16 +1,42 @@ -{ - "name": "gcc", - "kind": "chunk", - "configure-commands": [ - "mkdir o", - "cd o && \\\n../configure \\\n $(../morph-arch-config) \\\n --prefix=\"$PREFIX\" \\\n `# [1]` --libdir=$PREFIX/lib \\\n --disable-nls \\\n --enable-languages=c,c++,fortran \\\n --enable-shared --enable-threads=posix \\\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" - ], - "build-commands": [ - "cd o && make" - ], - "install-commands": [ - "cd o && make DESTDIR=\"$DESTDIR\" install", - "ln -s gcc \"$DESTDIR/$PREFIX/bin/cc\"", - "for fortran_alias in f77 f90 f95; do\n ln -s gfortran \"$DESTDIR/$PREFIX/bin/$fortran_alias\"\ndone\n" - ] -} +name: gcc +kind: chunk + +configure-commands: + - mkdir o + + # Configure flag notes: + # 1. An attempt to stop anything going in $PREFIX/lib64 (which doesn't + # fully work; we will need to hobble the multilib configuration in + # config/i386/t-linux64 if we really want to kill /lib64). + # 2. Multilib does not make sense in Baserock. + # 3. Optimisation libraries which for now we do without. + # 4. Recommended by Linux From Scratch; required for C++ ABI + # compatibility with other Linux distributions. + # 5. MPFR is built in the GCC tree, we need to locate it. + # 6. Avoid having more than one copy of ZLib in use on the system + - | + cd o && \ + ../configure \ + $(../morph-arch-config) \ + --prefix="$PREFIX" \ + `# [1]` --libdir=$PREFIX/lib \ + --disable-nls \ + --enable-languages=c,c++,fortran \ + --enable-shared --enable-threads=posix \ + `# [2]` --disable-multilib \ + `# [3]` --disable-libgomp --without-cloog --without-ppl \ + `# [4]` --enable-__cxa_atexit \ + `# [5]` --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [6]` --with-system-zlib + +build-commands: + - cd o && make + +install-commands: + - cd o && make DESTDIR="$DESTDIR" install + - ln -s gcc "$DESTDIR/$PREFIX/bin/cc" + - > + for fortran_alias in f77 f90 f95; do + ln -s gfortran "$DESTDIR/$PREFIX/bin/$fortran_alias" + done diff --git a/gcc.morph.yaml b/gcc.morph.yaml deleted file mode 100644 index 498a60bb55..0000000000 --- a/gcc.morph.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: gcc -kind: chunk - -configure-commands: - - mkdir o - - # Configure flag notes: - # 1. An attempt to stop anything going in $PREFIX/lib64 (which doesn't - # fully work; we will need to hobble the multilib configuration in - # config/i386/t-linux64 if we really want to kill /lib64). - # 2. Multilib does not make sense in Baserock. - # 3. Optimisation libraries which for now we do without. - # 4. Recommended by Linux From Scratch; required for C++ ABI - # compatibility with other Linux distributions. - # 5. MPFR is built in the GCC tree, we need to locate it. - # 6. Avoid having more than one copy of ZLib in use on the system - - | - cd o && \ - ../configure \ - $(../morph-arch-config) \ - --prefix="$PREFIX" \ - `# [1]` --libdir=$PREFIX/lib \ - --disable-nls \ - --enable-languages=c,c++,fortran \ - --enable-shared --enable-threads=posix \ - `# [2]` --disable-multilib \ - `# [3]` --disable-libgomp --without-cloog --without-ppl \ - `# [4]` --enable-__cxa_atexit \ - `# [5]` --with-mpfr-include="$(pwd)/../mpfr/src" \ - --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ - `# [6]` --with-system-zlib - -build-commands: - - cd o && make - -install-commands: - - cd o && make DESTDIR="$DESTDIR" install - - ln -s gcc "$DESTDIR/$PREFIX/bin/cc" - - > - for fortran_alias in f77 f90 f95; do - ln -s gfortran "$DESTDIR/$PREFIX/bin/$fortran_alias" - done diff --git a/stage1-gcc.morph b/stage1-gcc.morph index c0ed7cde76..ed2d54f264 100644 --- a/stage1-gcc.morph +++ b/stage1-gcc.morph @@ -1,15 +1,48 @@ -{ - "name": "stage1-gcc", - "kind": "chunk", - "configure-commands": [ - "mkdir o", - "cd o &&\n../configure \\\n $(../morph-arch-config) \\\n --build=$(sh ../config.guess) --host=$(sh ../config.guess) \\\n --target=$TARGET_STAGE1 \\\n --prefix=\"$PREFIX\" \\\n --disable-bootstrap --disable-nls \\\n `# [1]` --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 `# [2]` --with-local-prefix=\"$PREFIX\" \\\n `# [3]` --with-native-system-header-dir=\"$PREFIX/include\" \\\n `# [4]` --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" - ], - "build-commands": [ - "cd o && make" - ], - "install-commands": [ - "cd o && make DESTDIR=\"$DESTDIR\" install", - "libgcc_filename=$($DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc -print-libgcc-file-name)\nln -sv libgcc.a $(echo $libgcc_filename | sed 's/libgcc/&_eh/')\n" - ] -} +name: stage1-gcc +kind: chunk + +configure-commands: + - mkdir o + + # Configure flag notes: + # 1. Standard flags. See gcc.morph. + # 2. Disable searching /usr/local/include for headers + # 3. The pass 1 compiler needs to find the libraries we build in pass 2. + # Include path must be set explicility, because it defaults to + # $SYSROOT/usr/include rather than $SYSROOT/include. + # FIXME: this flag is not present until GCC 4.6.3! + # 4. Disable stuff that doesn't work when building a cross compiler + # without an existing libc, and generally try to keep this build as + # simple as possible. + - | + cd o && + ../configure \ + $(../morph-arch-config) \ + --build=$(sh ../config.guess) --host=$(sh ../config.guess) \ + --target=$TARGET_STAGE1 \ + --prefix="$PREFIX" \ + --disable-bootstrap --disable-nls \ + `# [1]` --libdir="$PREFIX/lib" --disable-multilib --disable-libgomp \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ + `# [2]` --with-local-prefix="$PREFIX" \ + `# [3]` --with-native-system-header-dir="$PREFIX/include" \ + `# [4]` --enable-languages=c --disable-decimal-float \ + --disable-libmudflap --disable-libquadmath --disable-libssp \ + --disable-shared --disable-threads --disable-target-libiberty \ + --disable-target-zlib --without-headers --with-newlib \ + --with-system-zlib + +build-commands: + - cd o && make + +install-commands: + - cd o && make DESTDIR="$DESTDIR" install + + # The file libgcc_eh is required during eglibc's build, but is not created + # because we built GCC with --disable-shared. This is a workaround for + # eglibc's build system being slightly broken. + - | + libgcc_filename=$($DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc -print-libgcc-file-name) + ln -sv libgcc.a $(echo $libgcc_filename | sed 's/libgcc/&_eh/') diff --git a/stage1-gcc.morph.yaml b/stage1-gcc.morph.yaml deleted file mode 100644 index ed2d54f264..0000000000 --- a/stage1-gcc.morph.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: stage1-gcc -kind: chunk - -configure-commands: - - mkdir o - - # Configure flag notes: - # 1. Standard flags. See gcc.morph. - # 2. Disable searching /usr/local/include for headers - # 3. The pass 1 compiler needs to find the libraries we build in pass 2. - # Include path must be set explicility, because it defaults to - # $SYSROOT/usr/include rather than $SYSROOT/include. - # FIXME: this flag is not present until GCC 4.6.3! - # 4. Disable stuff that doesn't work when building a cross compiler - # without an existing libc, and generally try to keep this build as - # simple as possible. - - | - cd o && - ../configure \ - $(../morph-arch-config) \ - --build=$(sh ../config.guess) --host=$(sh ../config.guess) \ - --target=$TARGET_STAGE1 \ - --prefix="$PREFIX" \ - --disable-bootstrap --disable-nls \ - `# [1]` --libdir="$PREFIX/lib" --disable-multilib --disable-libgomp \ - --without-cloog --without-ppl \ - --with-mpfr-include="$(pwd)/../mpfr/src" \ - --with-mpfr-lib="$(pwd)/mpfr/src/.libs" \ - `# [2]` --with-local-prefix="$PREFIX" \ - `# [3]` --with-native-system-header-dir="$PREFIX/include" \ - `# [4]` --enable-languages=c --disable-decimal-float \ - --disable-libmudflap --disable-libquadmath --disable-libssp \ - --disable-shared --disable-threads --disable-target-libiberty \ - --disable-target-zlib --without-headers --with-newlib \ - --with-system-zlib - -build-commands: - - cd o && make - -install-commands: - - cd o && make DESTDIR="$DESTDIR" install - - # The file libgcc_eh is required during eglibc's build, but is not created - # because we built GCC with --disable-shared. This is a workaround for - # eglibc's build system being slightly broken. - - | - libgcc_filename=$($DESTDIR$PREFIX/bin/$TARGET_STAGE1-gcc -print-libgcc-file-name) - ln -sv libgcc.a $(echo $libgcc_filename | sed 's/libgcc/&_eh/') diff --git a/stage2-gcc.morph b/stage2-gcc.morph index ed009dbdcd..b747cf9182 100644 --- a/stage2-gcc.morph +++ b/stage2-gcc.morph @@ -1,17 +1,84 @@ -{ - "name": "stage2-gcc", - "kind": "chunk", - "configure-commands": [ - "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 \\\n $(../morph-arch-config) \\\n `# [1]` --build=$(sh ../config.guess) \\\n --host=$TARGET_STAGE1 \\\n --target=$TARGET_STAGE1 \\\n --prefix=\"$PREFIX\" \\\n `# [2]` --with-local-prefix=$PREFIX \\\n `# [3]` --with-build-sysroot=\"$STAGE2_SYSROOT\" \\\n --disable-bootstrap \\\n --enable-clocale=gnu --enable-shared --enable-threads=posix \\\n `# [4]` --enable-languages=c \\\n `# [5]` --libdir=$PREFIX/lib \\\n --disable-libgomp --disable-multilib --disable-nls \\\n --without-cloog --without-ppl \\\n --with-mpfr-include=\"$(pwd)/../mpfr/src\" \\\n --with-mpfr-lib=\"$(pwd)/mpfr/src/.libs\"\n" - ], - "build-commands": [ - "export STAGE2_SYSROOT=\"$(dirname $(pwd))\"\ncd o && make\n" - ], - "install-commands": [ - "cd o && make DESTDIR=\"$DESTDIR\" install", - "if [ \"$(echo $TARGET | cut -c -6)\" = \"x86_64\" ]; then\n libdir=lib64\nelse\n libdir=lib\nfi\n\ninstall -d \"$DESTDIR/lib\"\nln -s \"$PREFIX/$libdir/libgcc_s.so\" \"$DESTDIR/lib/\"\nln -s \"$PREFIX/$libdir/libgcc_s.so.1\" \"$DESTDIR/lib/\"\n" - ] -} +name: stage2-gcc +kind: chunk + +configure-commands: + - stage2-eglibc-fix-specs + + # Stage 1 GCC's fixincludes process created a limits.h before there was + # a real limits.h available for the target. This step (taken from Linux + # Linux From Scratch) creates a better one so that stage 2 GCC can compile. + # + # THIS IS A FRAGILE HACK! We have a staging area built from hardlinked + # chunk artifacts at this point and we sidestep that by moving a file + # over the hardlink, so as not to alter the original file. Maybe we could + # fix things by altering the include path instead, but this might be even + # more fragile. + - | + cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" > limits.h.tmp + libgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name)) + cp limits.h.tmp "$libgcc_dir/include-fixed/limits.h" + + - mkdir o + + # In other projects we specify the sysroot location using CPPFLAGS. Here, + # that breaks because GCC compiles stuff for the *build* machine, too ... + # and this requires using the host's compiler, which cannot use the same + # set of CPPFLAGS as the target. If we specify the sysroot using CC instead + # then we don't interfere, because we are only specifying the *host* C + # compiler. + # + # Configure flag notes: + # 1. It's vital that this compiler targets the bootstrap machine + # (TARGET_STAGE1) so that the stage 1 GCC is used instead of the + # compiler of the build machine. + # 2. Disable searching /usr/local/include for headers + # 3. This flag causes the correct --sysroot flag to be passed when calling + # stage 1 GCC. + # 4. C++ is built in stage 3. + # 5. Standard flags. See gcc.morph. + - | + export STAGE2_SYSROOT="$(dirname $(pwd))" + export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT" + export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" + cd o && ../configure \ + $(../morph-arch-config) \ + `# [1]` --build=$(sh ../config.guess) \ + --host=$TARGET_STAGE1 \ + --target=$TARGET_STAGE1 \ + --prefix="$PREFIX" \ + `# [2]` --with-local-prefix=$PREFIX \ + `# [3]` --with-build-sysroot="$STAGE2_SYSROOT" \ + --disable-bootstrap \ + --enable-clocale=gnu --enable-shared --enable-threads=posix \ + `# [4]` --enable-languages=c \ + `# [5]` --libdir=$PREFIX/lib \ + --disable-libgomp --disable-multilib --disable-nls \ + --without-cloog --without-ppl \ + --with-mpfr-include="$(pwd)/../mpfr/src" \ + --with-mpfr-lib="$(pwd)/mpfr/src/.libs" + +build-commands: + - | + export STAGE2_SYSROOT="$(dirname $(pwd))" + cd o && make + +install-commands: + - cd o && make DESTDIR="$DESTDIR" install + + # Stage 3 builds need to link against this file in the location that + # it will be in the final system, so we make a temporary link now. + # + # On x86_64 GCC resolutely installs its libraries into lib64. To fix this + # would require hobbling the MULTILIB_OSDIRNAMES field in + # gcc/config/i386/t-linux64 and this might break things, so for now we + # tolerate the inconsistency. + - | + if [ "$(echo $TARGET | cut -c -6)" = "x86_64" ]; then + libdir=lib64 + else + libdir=lib + fi + + install -d "$DESTDIR/lib" + ln -s "$PREFIX/$libdir/libgcc_s.so" "$DESTDIR/lib/" + ln -s "$PREFIX/$libdir/libgcc_s.so.1" "$DESTDIR/lib/" diff --git a/stage2-gcc.morph.yaml b/stage2-gcc.morph.yaml deleted file mode 100644 index b747cf9182..0000000000 --- a/stage2-gcc.morph.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: stage2-gcc -kind: chunk - -configure-commands: - - stage2-eglibc-fix-specs - - # Stage 1 GCC's fixincludes process created a limits.h before there was - # a real limits.h available for the target. This step (taken from Linux - # Linux From Scratch) creates a better one so that stage 2 GCC can compile. - # - # THIS IS A FRAGILE HACK! We have a staging area built from hardlinked - # chunk artifacts at this point and we sidestep that by moving a file - # over the hardlink, so as not to alter the original file. Maybe we could - # fix things by altering the include path instead, but this might be even - # more fragile. - - | - cat "gcc/limitx.h" "gcc/glimits.h" "gcc/limity.h" > limits.h.tmp - libgcc_dir=$(dirname $($TARGET_STAGE1-gcc -print-libgcc-file-name)) - cp limits.h.tmp "$libgcc_dir/include-fixed/limits.h" - - - mkdir o - - # In other projects we specify the sysroot location using CPPFLAGS. Here, - # that breaks because GCC compiles stuff for the *build* machine, too ... - # and this requires using the host's compiler, which cannot use the same - # set of CPPFLAGS as the target. If we specify the sysroot using CC instead - # then we don't interfere, because we are only specifying the *host* C - # compiler. - # - # Configure flag notes: - # 1. It's vital that this compiler targets the bootstrap machine - # (TARGET_STAGE1) so that the stage 1 GCC is used instead of the - # compiler of the build machine. - # 2. Disable searching /usr/local/include for headers - # 3. This flag causes the correct --sysroot flag to be passed when calling - # stage 1 GCC. - # 4. C++ is built in stage 3. - # 5. Standard flags. See gcc.morph. - - | - export STAGE2_SYSROOT="$(dirname $(pwd))" - export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT" - export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT" - cd o && ../configure \ - $(../morph-arch-config) \ - `# [1]` --build=$(sh ../config.guess) \ - --host=$TARGET_STAGE1 \ - --target=$TARGET_STAGE1 \ - --prefix="$PREFIX" \ - `# [2]` --with-local-prefix=$PREFIX \ - `# [3]` --with-build-sysroot="$STAGE2_SYSROOT" \ - --disable-bootstrap \ - --enable-clocale=gnu --enable-shared --enable-threads=posix \ - `# [4]` --enable-languages=c \ - `# [5]` --libdir=$PREFIX/lib \ - --disable-libgomp --disable-multilib --disable-nls \ - --without-cloog --without-ppl \ - --with-mpfr-include="$(pwd)/../mpfr/src" \ - --with-mpfr-lib="$(pwd)/mpfr/src/.libs" - -build-commands: - - | - export STAGE2_SYSROOT="$(dirname $(pwd))" - cd o && make - -install-commands: - - cd o && make DESTDIR="$DESTDIR" install - - # Stage 3 builds need to link against this file in the location that - # it will be in the final system, so we make a temporary link now. - # - # On x86_64 GCC resolutely installs its libraries into lib64. To fix this - # would require hobbling the MULTILIB_OSDIRNAMES field in - # gcc/config/i386/t-linux64 and this might break things, so for now we - # tolerate the inconsistency. - - | - if [ "$(echo $TARGET | cut -c -6)" = "x86_64" ]; then - libdir=lib64 - else - libdir=lib - fi - - install -d "$DESTDIR/lib" - ln -s "$PREFIX/$libdir/libgcc_s.so" "$DESTDIR/lib/" - ln -s "$PREFIX/$libdir/libgcc_s.so.1" "$DESTDIR/lib/" |