- "add_to_path": []
  "builds":
    "default":
      "build_dependencies":
      - |-
        gcc-host-toolchain
      - |-
        ncurses
      "configure": |
        mkdir -p "$BUILD_DIR"
        extract.sh --into "$BUILD_DIR" https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2.tar.gz
        cd "$BUILD_DIR" && ./bootstrap \
          --prefix="$ORCHESTRA_ROOT" \
          --parallel=16 \
          LDFLAGS="-static-libstdc++ -static-libgcc" \
          -- -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_INSTALL_PREFIX="$ORCHESTRA_ROOT" \
          -DCMAKE_SHARED_LINKER_FLAGS="-static-libstdc++ -static-libgcc" \
          -DCMAKE_MODULE_LINKER_FLAGS="-static-libstdc++ -static-libgcc" \
          -DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc" \
          -DCMAKE_USE_OPENSSL=OFF
      "dependencies": []
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    Licenses/README.rst
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies":
      - |-
        glibc
      - |-
        toolchain/host/linux-headers
      - |-
        gmp
      - |-
        mpc
      - |-
        mpfr
      "configure": |
        mkdir -p "$BUILD_DIR/source"
        extract.sh --into "$BUILD_DIR/source" https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz

        cd "$BUILD_DIR"

        echo 'char __libc_single_threaded __attribute__ ((weak));' > fake-libc-single-threaded.c
        gcc -c -fPIC -x c fake-libc-single-threaded.c -o "$BUILD_DIR/fake-libc-single-threaded.o"

        ./source/configure \
          --prefix="$INSTALL_LINK_ONLY_PATH/early-gcc" \
          --disable-multilib \
          --enable-languages=c,c++ \
          --disable-nls \
          --disable-libsanitizer \
          --with-glibc-version=2.13 \
          --disable-bootstrap \
          --with-sysroot=$INSTALL_LINK_ONLY_PATH \
          --with-gmp="$ORCHESTRA_ROOT" \
          --with-mpfr="$ORCHESTRA_ROOT" \
          --with-mpc="$ORCHESTRA_ROOT" \
          --disable-libgomp \
          CFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -I$ORCHESTRA_ROOT/include" \
          CXXFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -I$ORCHESTRA_ROOT/include" \
          LDFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -Wl,-z,origin -Wl,--enable-new-dtags -L$ORCHESTRA_ROOT/lib -L$INSTALL_LINK_ONLY_PATH/lib"
      "dependencies": []
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    source/COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies": []
      "configure": |-
        mkdir -p "$BUILD_DIR"
      "dependencies":
      - |-
        gcc-runtime
      - |-
        toolchain/host/gcc
      - |-
        toolchain/host/binutils
      "install": |-
        exit 0
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": !!null |-
    null
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies":
      - |-
        toolchain/host/gcc
      "configure": |
        mkdir -p "$BUILD_DIR"
      "dependencies": []
      "install": |+
        cd "$BUILD_DIR"
        cp -a "${ORCHESTRA_ROOT}/share/orchestra/toolchain_host_gcc.license" LICENSE.TXT
        tar xf "${ORCHESTRA_ROOT}/share/orchestra/save_for_later/gcc-runtime.tar.xz" \
          -C "${DESTDIR}${ORCHESTRA_ROOT}"

      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    LICENSE.TXT
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies":
      - |-
        libgcc
      "configure": |
        mkdir -p "$BUILD_DIR/source"
        extract.sh --into "$BUILD_DIR/source" https://ftp.gnu.org/gnu/glibc/glibc-2.13.tar.xz

        sed -i 's|test -n ".critic_missing"|false|g' "$BUILD_DIR/source/configure"
        sed -i 's|struct obstack ._obstack_compat|\0 = 0|g' "$BUILD_DIR/source/malloc/obstack.c"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/glibc-2.13-fix-isinf.patch" "$BUILD_DIR/source"

        cd $BUILD_DIR
        export CC="cc -no-pie -fuse-ld=bfd -Wl,-z,origin -Wl,--enable-new-dtags -Wl,-rpath,$RPATH_PLACEHOLDER/link-only/lib -L$INSTALL_LINK_ONLY_PATH/lib"
        ./source/configure \
          --disable-profile \
          --without-gd \
          --enable-crypt \
          --disable-static-pie \
          --disable-systemtap \
          --disable-nscd \
          --disable-timezone-tools \
          --enable-stack-protector=strong \
          --enable-stackguard-randomization \
          --disable-cet \
          --without-selinux \
          --without-cvs \
          --disable-werror \
          --enable-bind-now \
          --disable-sanity-checks \
          --prefix="$INSTALL_LINK_ONLY_PATH" \
          CFLAGS="-w -O2 -fno-stack-protector -DNDEBUG -march=core2 -U_FORTIFY_SOURCE"
      "dependencies": []
      "install": |+
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install_root="$DESTDIR" install
        sed -i "s|$INSTALL_LINK_ONLY_PATH/lib/||g" \
          "$DESTDIR$INSTALL_LINK_ONLY_PATH/lib/libpthread.so" \
          "$DESTDIR$INSTALL_LINK_ONLY_PATH/lib/libc.so"
        ln -s . "$DESTDIR$INSTALL_LINK_ONLY_PATH/usr"
        rm -f "$DESTDIR$INSTALL_LINK_ONLY_PATH"/libexec/getconf/POSIX_V7_LP64_OFF64*
        rm -rf "$DESTDIR$INSTALL_LINK_ONLY_PATH"/bin

        # This file is needed because gcc fixinclude detects it when bootstrapping toolchains
        touch "$DESTDIR$INSTALL_LINK_ONLY_PATH/include/stdc-predef.h"

      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    source/COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies": []
      "configure": |
        mkdir -p "$BUILD_DIR"
        extract.sh --into "$BUILD_DIR" "https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz"
        cd "$BUILD_DIR" && ./configure \
          --prefix="$ORCHESTRA_ROOT" \
          --enable-shared=no \
          --enable-fat \
          CFLAGS="-fPIC" \
          CXXFLAGS="-fPIC" \
          LDFLAGS="-static-libgcc"
      "dependencies": []
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies":
      - |-
        toolchain/host/linux-headers
      - |-
        gmp
      - |-
        mpc
      - |-
        mpfr
      "configure": |
        mkdir -p "$BUILD_DIR/source"
        extract.sh --into "$BUILD_DIR/source" https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz

        cd "$BUILD_DIR"
        ./source/configure \
          --prefix="$INSTALL_LINK_ONLY_PATH" \
          --disable-multilib \
          --enable-languages=c \
          --disable-nls \
          --disable-libsanitizer \
          --with-glibc-version=2.13 \
          --with-gmp="$ORCHESTRA_ROOT" \
          --with-mpfr="$ORCHESTRA_ROOT" \
          --with-mpc="$ORCHESTRA_ROOT"
      "dependencies": []
      "install": |+
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS} all-gcc
        make ${JOBS:+-j$JOBS} all-target-libgcc
        make ${JOBS:+-j$JOBS} install-target-libgcc
        cp -a "${DESTDIR}${INSTALL_LINK_ONLY_PATH}"/lib/gcc/x86_64-pc-linux-gnu/11.2.0/*.{a,o} "${DESTDIR}${INSTALL_LINK_ONLY_PATH}"/lib/

        mkdir -p "${DESTDIR}${INSTALL_LINK_ONLY_PATH}"/include/
        cp -a "${DESTDIR}${INSTALL_LINK_ONLY_PATH}"/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/* "${DESTDIR}${INSTALL_LINK_ONLY_PATH}"/include/

      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    source/COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies": []
      "configure": |
        mkdir -p "$BUILD_DIR"
        extract.sh --into "$BUILD_DIR" https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
        cd "$BUILD_DIR" && ./configure \
          --prefix="$ORCHESTRA_ROOT" \
          --with-gmp="$ORCHESTRA_ROOT" \
          --with-mpfr="$ORCHESTRA_ROOT" \
          --enable-shared=no \
          CFLAGS="-fPIC" \
          CXXFLAGS="-fPIC" \
          LDFLAGS="-static-libgcc"
      "dependencies":
      - |-
        gmp
      - |-
        mpfr
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    COPYING.LESSER
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies": []
      "configure": |
        mkdir -p "$BUILD_DIR"
        extract.sh --into "$BUILD_DIR" https://www.mpfr.org/mpfr-4.1.0/mpfr-4.1.0.tar.xz
        cd "$BUILD_DIR" && ./configure \
          --prefix="$ORCHESTRA_ROOT" \
          --with-gmp="$ORCHESTRA_ROOT" \
          --enable-shared=no \
          CFLAGS="-fPIC" \
          CXXFLAGS="-fPIC" \
          LDFLAGS="-static-libgcc"
      "dependencies":
      - |-
        gmp
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies":
      - |-
        gcc-host-toolchain
      - |-
        glibc
      "configure": |
        mkdir -p "$BUILD_DIR"
        extract.sh --into "$BUILD_DIR" https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz
        cd "$BUILD_DIR"
        ./configure \
          --enable-pc-files \
          --enable-widec \
          --with-cxx \
          --with-cxx-binding \
          --with-cxx-shared \
          --with-shared \
          --with-versioned-syms \
          --with-xterm-kbs=del \
          --with-manpage-format=normal \
          --without-ada \
          --without-assertions \
          --without-debug \
          --without-dlsym \
          --without-expanded \
          --without-gpm \
          --without-hashed-db \
          --without-profile \
          --without-tack \
          --without-tests \
          --without-trace \
          --prefix="$ORCHESTRA_ROOT" \
          --with-pkg-config-libdir="$ORCHESTRA_ROOT/lib/pkgconfig"
      "dependencies": []
      "install": |+
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"

        INSTALLDIR="${DESTDIR}${ORCHESTRA_ROOT}"

        # Adapted from ArchLinux PKGBUILD
        # fool packages looking to link to non-wide-character ncurses libraries
        for lib in ncurses ncurses++ form panel menu; do
          printf "INPUT(-l%sw)\n" "${lib}" > "$INSTALLDIR/lib/lib${lib}.so"
          ln -sv lib${lib}w.so.6.3 "$INSTALLDIR/lib/lib${lib}.so.6.3"
          ln -sv lib${lib}w.so.6.3 "$INSTALLDIR/lib/lib${lib}.so.6"
          ln -sv ${lib}w.pc "$INSTALLDIR/lib/pkgconfig/${lib}.pc"
        done

        # some packages look for -lcurses during build
        printf 'INPUT(-lncursesw)\n' > "$INSTALLDIR/lib/libcursesw.so"
        ln -sv libncurses.so "$INSTALLDIR/lib/libcurses.so"

        # tic and ticinfo functionality is built in by default
        # make sure that anything linking against it links against libncursesw.so instead
        for lib in tic tinfo; do
          printf "INPUT(libncursesw.so.6)\n" > "$INSTALLDIR/lib/lib${lib}.so"
          ln -sv libncursesw.so.6.3 "$INSTALLDIR/lib/lib${lib}.so.6.3"
          ln -sv libncursesw.so.6.3 "$INSTALLDIR/lib/lib${lib}.so.6"
          ln -sv ncursesw.pc "$INSTALLDIR/lib/pkgconfig/${lib}.pc"
        done

      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path":
  - |-
    ${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39
  "builds":
    "default":
      "build_dependencies":
      - |-
        glibc
      - |-
        toolchain/host/gcc
      "configure": |
        export SOURCE_DIR="$BUILD_DIR/source"
        mkdir -p "$SOURCE_DIR"
        extract.sh --into "$SOURCE_DIR" https://ftp.gnu.org/gnu/binutils/binutils-2.39.tar.bz2
        cd "$BUILD_DIR" && "$SOURCE_DIR/configure" \
          --build=x86_64-pc-linux-gnu \
          --host=x86_64-pc-linux-gnu \
          --target=x86_64-pc-linux-gnu \
          --with-sysroot="$ORCHESTRA_ROOT/x86_64-pc-linux-gnu" \
          --prefix=$ORCHESTRA_ROOT \
          --datadir=$ORCHESTRA_ROOT/share/binutils-data/x86_64-pc-linux-gnu/2.39 \
          --infodir=$ORCHESTRA_ROOT/share/binutils-data/x86_64-pc-linux-gnu/2.39/info \
          --mandir=$ORCHESTRA_ROOT/share/binutils-data/x86_64-pc-linux-gnu/2.39/man \
          --bindir=$ORCHESTRA_ROOT/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/binutils-bin/2.39 \
          --libdir=$ORCHESTRA_ROOT/lib64/binutils/x86_64-pc-linux-gnu/2.39 \
          --libexecdir=$ORCHESTRA_ROOT/lib64/binutils/x86_64-pc-linux-gnu/2.39 \
          --includedir=$ORCHESTRA_ROOT/lib64/binutils/x86_64-pc-linux-gnu/2.39/include \
          --without-included-gettext \
          --with-zlib \
          --enable-poison-system-directories \
          --enable-secureplt \
          --enable-obsolete \
          --enable-gold \
          --disable-shared \
          --enable-threads \
          --enable-install-libiberty \
          --disable-werror \
          --disable-static \
          --disable-gdb \
          --disable-libdecnumber \
          --disable-readline \
          --disable-sim \
          --without-debuginfod \
          --without-stage1-ldflags \
          --enable-gold=default \
          CFLAGS="-w -ggdb3 -O3" \
          CXXFLAGS="-w -ggdb3 -O3"
      "dependencies":
      - |-
        gcc-runtime
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS}
        make ${JOBS:+-j$JOBS} install DESTDIR="$DESTDIR"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    source/COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path":
  - |-
    ${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/gcc-bin/11.2.0
  "builds":
    "stage1":
      "build_dependencies":
      - |-
        glibc
      - |-
        gmp
      - |-
        mpfr
      - |-
        mpc
      "configure": |
        export SOURCE_DIR="$BUILD_DIR/source"
        mkdir -p "$SOURCE_DIR"
        extract.sh --into "$SOURCE_DIR" https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-cfns-fix-mismatch-in-gnu_inline-attributes.patch" "$SOURCE_DIR"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-cpp-musl-support.patch" "$SOURCE_DIR"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-fixes.patch" "$SOURCE_DIR"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-remove-dependency-on-libc_single_threaded.patch" "$SOURCE_DIR"
        sed -i 's|gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"|gcc_gxx_include_dir="/${gcc_gxx_without_sysroot#/}"|' "$SOURCE_DIR/gcc/configure"

        sed -i "s|SHLIB_LINK = .(CC)|\0 -L$ORCHESTRA_ROOT/link-only/lib|" "$SOURCE_DIR/libgcc/config/t-slibgcc"
        sed -i 's|@multilib_flags@||' "$SOURCE_DIR/libgcc/config/t-slibgcc"


        mkdir -p "$BUILD_DIR"
        cd "$BUILD_DIR"

        echo 'char __libc_single_threaded __attribute__ ((weak));' > fake-libc-single-threaded.c
        gcc -c -fPIC -x c fake-libc-single-threaded.c -o "$BUILD_DIR/fake-libc-single-threaded.o"

        "$SOURCE_DIR/configure" \
          --host=x86_64-pc-linux-gnu \
          --build=x86_64-pc-linux-gnu \
          --target=x86_64-pc-linux-gnu \
          --prefix=$ORCHESTRA_ROOT \
          --bindir=$ORCHESTRA_ROOT/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/gcc-bin/11.2.0 \
          --includedir=$ORCHESTRA_ROOT/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include \
          --datadir=$ORCHESTRA_ROOT/share/gcc-data/x86_64-pc-linux-gnu/11.2.0 \
          --mandir=$ORCHESTRA_ROOT/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man \
          --infodir=$ORCHESTRA_ROOT/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info \
          --with-sysroot=$INSTALL_LINK_ONLY_PATH \
          --enable-obsolete \
          --enable-secureplt \
          --disable-werror \
          --disable-nls \
          --without-included-gettext \
          --enable-checking=release \
          --enable-libstdcxx-time \
          --enable-poison-system-directories \
          --disable-host-shared \
          --enable-shared \
          --disable-libatomic \
          --disable-bootstrap \
          --disable-multilib \
          --disable-altivec \
          --disable-fixed-point \
          --disable-libgcj \
          --disable-libgomp \
          --disable-libmudflap \
          --disable-libssp \
          --disable-libcilkrts \
          --disable-vtable-verify \
          --disable-libvtv \
          --disable-libquadmath \
          --disable-rpath \
          --enable-lto \
          --disable-vtable-verify \
          --disable-libsanitizer \
          --with-gmp="$ORCHESTRA_ROOT" \
          --with-mpfr="$ORCHESTRA_ROOT" \
          --with-mpc="$ORCHESTRA_ROOT" \
          --without-zstd \
          --without-cloog \
          --enable-libsanitizer \
          --enable-libssp \
          --enable-shared \
          --enable-libatomic \
          --enable-libquadmath \
          --enable-esp \
          --disable-libstdcxx-pch \
          --enable-threads=posix \
          --enable-__cxa_atexit \
          --enable-clocale=gnu \
          --disable-altivec \
          --disable-fixed-point \
          --enable-targets=all \
          --enable-libgomp \
          --disable-libmudflap \
          --disable-libssp \
          --disable-systemtap \
          --enable-lto \
          --without-isl \
          --enable-default-pie \
          --enable-default-ssp \
          --disable-libmpx \
          --with-glibc-version=2.13 \
          CC=$INSTALL_LINK_ONLY_PATH/early-gcc/bin/gcc \
          CXX=$INSTALL_LINK_ONLY_PATH/early-gcc/bin/g++ \
          CFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -I$ORCHESTRA_ROOT/include" \
          CXXFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -I$ORCHESTRA_ROOT/include" \
          LDFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -Wl,-z,origin -Wl,--enable-new-dtags -L$ORCHESTRA_ROOT/lib -L$INSTALL_LINK_ONLY_PATH/lib" \
          --enable-languages=c \
          CFLAGS="-w -ggdb3 -O3 --sysroot $INSTALL_LINK_ONLY_PATH -idirafter $ORCHESTRA_ROOT/include -idirafter /usr/local/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include" \
          CXXFLAGS="-w -ggdb3 -O3 --sysroot $INSTALL_LINK_ONLY_PATH -idirafter $ORCHESTRA_ROOT/include -idirafter /usr/local/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include -std=gnu++11" \
          LDFLAGS="-L$INSTALL_LINK_ONLY_PATH/lib -L$ORCHESTRA_ROOT/lib -lrt --sysroot=$INSTALL_LINK_ONLY_PATH -Wl,-z,origin -Wl,--enable-new-dtags -fuse-ld=gold -Wl,-rpath,$RPATH_PLACEHOLDER/lib -Wl,-rpath,$RPATH_PLACEHOLDER/lib64/llvm/clang-release/lib/clang/12.0.0/lib/linux -static-libgcc -static-libstdc++ $BUILD_DIR/fake-libc-single-threaded.o -L$INSTALL_LINK_ONLY_PATH/lib64 --sysroot=$INSTALL_LINK_ONLY_PATH"
      "dependencies":
      - |-
        toolchain/host/linux-headers
      "install": "cd \"$BUILD_DIR\"\nmake ${JOBS:+-j$JOBS} \nmake install \n\nNEW_GCC_PATH=\"$ORCHESTRA_ROOT/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/gcc-bin/11.2.0/\"\n\nif test -e \"${DESTDIR}${NEW_GCC_PATH}/gcc\"; then\n\n  if ! test -e \"${DESTDIR}${NEW_GCC_PATH}/cc\"; then\n    ln -s gcc \"${DESTDIR}${NEW_GCC_PATH}/cc\"\n  fi\n\n  mkdir -p \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin\"\n  cp \"${ORCHESTRA_DOTDIR}/support/hard-flags-compiler-wrapper.py\" \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/gcc\"\n  ln -s gcc \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/cc\"\n  ln -s gcc \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-cc\"\n  ln -s gcc \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-gcc\"\n\n  cp -a \"${DESTDIR}${ORCHESTRA_ROOT}\"/lib/gcc/x86_64-pc-linux-gnu/11.2.0/*.{a,o} \"${DESTDIR}${ORCHESTRA_ROOT}\"/lib/\n\nfi\n\nif test -e \"${DESTDIR}${NEW_GCC_PATH}/g++\"; then\n\n  if ! test -e \"${DESTDIR}${NEW_GCC_PATH}/c++\"; then\n    ln -s g++ \"${DESTDIR}${NEW_GCC_PATH}/c++\"\n  fi\n\n  cp \"${ORCHESTRA_DOTDIR}/support/hard-flags-compiler-wrapper.py\" \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/g++\"\n  ln -s g++ \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-g++\"\n  mkdir -p \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin\"\n  ln -s g++ \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/c++\"\n  ln -s g++ \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-c++\"\n\nfi\n\nrm -f \"${DESTDIR}${ORCHESTRA_ROOT}\"/lib64/libcc1.*\n\n# Fixinclude locates the wrong pthread.h\nfind \"${DESTDIR}${ORCHESTRA_ROOT}\" -type d -name include-fixed -exec rm -f {}/pthread.h \\;\n\"$ORCHESTRA_DOTDIR\"/support/save-for-later \\\n  -i \"${DESTDIR}${ORCHESTRA_ROOT}\" \\\n  gcc-runtime \\\n  '^lib(|32|64)\\/lib[^/]*$' '^lib(|32|64)\\/crt[^/]*\\.o$'\n"
      "ndebug": !!bool |-
        true
    "stage2":
      "build_dependencies":
      - |-
        early-gcc
      - |-
        glibc
      - |-
        gmp
      - |-
        mpfr
      - |-
        mpc
      "configure": |
        export SOURCE_DIR="$BUILD_DIR/source"
        mkdir -p "$SOURCE_DIR"
        extract.sh --into "$SOURCE_DIR" https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-cfns-fix-mismatch-in-gnu_inline-attributes.patch" "$SOURCE_DIR"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-cpp-musl-support.patch" "$SOURCE_DIR"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-fixes.patch" "$SOURCE_DIR"
        patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-11.2.0-remove-dependency-on-libc_single_threaded.patch" "$SOURCE_DIR"
        sed -i 's|gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"|gcc_gxx_include_dir="/${gcc_gxx_without_sysroot#/}"|' "$SOURCE_DIR/gcc/configure"

        sed -i "s|SHLIB_LINK = .(CC)|\0 -L$ORCHESTRA_ROOT/link-only/lib|" "$SOURCE_DIR/libgcc/config/t-slibgcc"
        sed -i 's|@multilib_flags@||' "$SOURCE_DIR/libgcc/config/t-slibgcc"


        mkdir -p "$BUILD_DIR"
        cd "$BUILD_DIR"

        echo 'char __libc_single_threaded __attribute__ ((weak));' > fake-libc-single-threaded.c
        gcc -c -fPIC -x c fake-libc-single-threaded.c -o "$BUILD_DIR/fake-libc-single-threaded.o"

        "$SOURCE_DIR/configure" \
          --host=x86_64-pc-linux-gnu \
          --build=x86_64-pc-linux-gnu \
          --target=x86_64-pc-linux-gnu \
          --prefix=$ORCHESTRA_ROOT \
          --bindir=$ORCHESTRA_ROOT/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/gcc-bin/11.2.0 \
          --includedir=$ORCHESTRA_ROOT/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include \
          --datadir=$ORCHESTRA_ROOT/share/gcc-data/x86_64-pc-linux-gnu/11.2.0 \
          --mandir=$ORCHESTRA_ROOT/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man \
          --infodir=$ORCHESTRA_ROOT/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info \
          --with-sysroot=$INSTALL_LINK_ONLY_PATH \
          --enable-obsolete \
          --enable-secureplt \
          --disable-werror \
          --disable-nls \
          --without-included-gettext \
          --enable-checking=release \
          --enable-libstdcxx-time \
          --enable-poison-system-directories \
          --disable-host-shared \
          --enable-shared \
          --disable-libatomic \
          --disable-bootstrap \
          --disable-multilib \
          --disable-altivec \
          --disable-fixed-point \
          --disable-libgcj \
          --disable-libgomp \
          --disable-libmudflap \
          --disable-libssp \
          --disable-libcilkrts \
          --disable-vtable-verify \
          --disable-libvtv \
          --disable-libquadmath \
          --disable-rpath \
          --enable-lto \
          --disable-vtable-verify \
          --disable-libsanitizer \
          --with-gmp="$ORCHESTRA_ROOT" \
          --with-mpfr="$ORCHESTRA_ROOT" \
          --with-mpc="$ORCHESTRA_ROOT" \
          --without-zstd \
          --without-cloog \
          --enable-libsanitizer \
          --enable-libssp \
          --enable-shared \
          --enable-libatomic \
          --enable-libquadmath \
          --enable-esp \
          --disable-libstdcxx-pch \
          --enable-threads=posix \
          --enable-__cxa_atexit \
          --enable-clocale=gnu \
          --disable-altivec \
          --disable-fixed-point \
          --enable-targets=all \
          --enable-libgomp \
          --disable-libmudflap \
          --disable-libssp \
          --disable-systemtap \
          --enable-lto \
          --without-isl \
          --enable-default-pie \
          --enable-default-ssp \
          --disable-libmpx \
          --with-glibc-version=2.13 \
          CC=$INSTALL_LINK_ONLY_PATH/early-gcc/bin/gcc \
          CXX=$INSTALL_LINK_ONLY_PATH/early-gcc/bin/g++ \
          CFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -I$ORCHESTRA_ROOT/include" \
          CXXFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -I$ORCHESTRA_ROOT/include" \
          LDFLAGS_FOR_TARGET="--sysroot=$INSTALL_LINK_ONLY_PATH -Wl,-z,origin -Wl,--enable-new-dtags -L$ORCHESTRA_ROOT/lib -L$INSTALL_LINK_ONLY_PATH/lib" \
          --enable-languages=c,c++ \
          CFLAGS="-w -ggdb3 -O3 --sysroot $INSTALL_LINK_ONLY_PATH -idirafter $ORCHESTRA_ROOT/include -idirafter /usr/local/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include" \
          CXXFLAGS="-w -ggdb3 -O3 --sysroot $INSTALL_LINK_ONLY_PATH -idirafter $ORCHESTRA_ROOT/include -idirafter /usr/local/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include -std=gnu++11" \
          LDFLAGS="-L$INSTALL_LINK_ONLY_PATH/lib -L$ORCHESTRA_ROOT/lib -lrt --sysroot=$INSTALL_LINK_ONLY_PATH -Wl,-z,origin -Wl,--enable-new-dtags -fuse-ld=gold -Wl,-rpath,$RPATH_PLACEHOLDER/lib -Wl,-rpath,$RPATH_PLACEHOLDER/lib64/llvm/clang-release/lib/clang/12.0.0/lib/linux -static-libgcc -static-libstdc++ $BUILD_DIR/fake-libc-single-threaded.o -L$INSTALL_LINK_ONLY_PATH/lib64 --sysroot=$INSTALL_LINK_ONLY_PATH"
      "dependencies":
      - |-
        toolchain/host/linux-headers
      "install": "cd \"$BUILD_DIR\"\nmake ${JOBS:+-j$JOBS} \nmake install \n\nNEW_GCC_PATH=\"$ORCHESTRA_ROOT/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/gcc-bin/11.2.0/\"\n\nif test -e \"${DESTDIR}${NEW_GCC_PATH}/gcc\"; then\n\n  if ! test -e \"${DESTDIR}${NEW_GCC_PATH}/cc\"; then\n    ln -s gcc \"${DESTDIR}${NEW_GCC_PATH}/cc\"\n  fi\n\n  mkdir -p \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin\"\n  cp \"${ORCHESTRA_DOTDIR}/support/hard-flags-compiler-wrapper.py\" \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/gcc\"\n  ln -s gcc \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/cc\"\n  ln -s gcc \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-cc\"\n  ln -s gcc \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-gcc\"\n\n  cp -a \"${DESTDIR}${ORCHESTRA_ROOT}\"/lib/gcc/x86_64-pc-linux-gnu/11.2.0/*.{a,o} \"${DESTDIR}${ORCHESTRA_ROOT}\"/lib/\n\nfi\n\nif test -e \"${DESTDIR}${NEW_GCC_PATH}/g++\"; then\n\n  if ! test -e \"${DESTDIR}${NEW_GCC_PATH}/c++\"; then\n    ln -s g++ \"${DESTDIR}${NEW_GCC_PATH}/c++\"\n  fi\n\n  cp \"${ORCHESTRA_DOTDIR}/support/hard-flags-compiler-wrapper.py\" \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/g++\"\n  ln -s g++ \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-g++\"\n  mkdir -p \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin\"\n  ln -s g++ \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/c++\"\n  ln -s g++ \"${DESTDIR}${ORCHESTRA_ROOT}/link-only/bin/x86_64-pc-linux-gnu-c++\"\n\nfi\n\nrm -f \"${DESTDIR}${ORCHESTRA_ROOT}\"/lib64/libcc1.*\n\n# Fixinclude locates the wrong pthread.h\nfind \"${DESTDIR}${ORCHESTRA_ROOT}\" -type d -name include-fixed -exec rm -f {}/pthread.h \\;\n\"$ORCHESTRA_DOTDIR\"/support/save-for-later \\\n  -i \"${DESTDIR}${ORCHESTRA_ROOT}\" \\\n  gcc-runtime \\\n  '^lib(|32|64)\\/lib[^/]*$' '^lib(|32|64)\\/crt[^/]*\\.o$'\n"
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    stage2
  "license": |-
    source/COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
- "add_to_path": []
  "builds":
    "default":
      "build_dependencies": []
      "configure": |
        mkdir -p "$BUILD_DIR"
        extract.sh --into "$BUILD_DIR" https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.4.tar.xz
      "dependencies": []
      "install": |
        cd "$BUILD_DIR"
        make ${JOBS:+-j$JOBS} -C "$BUILD_DIR" \
          ARCH=x86_64 \
          INSTALL_HDR_PATH="${DESTDIR}${ORCHESTRA_ROOT}/link-only" headers_install
      "ndebug": !!bool |-
        true
  "commit": !!null |-
    null
  "default_build": |-
    default
  "license": |-
    COPYING
  "repository": !!null |-
    null
  "skip_post_install": !!bool |-
    false
