#!/bin/env bash set -e PATH=/opt/bootstrap/bin:/opt/toolchain/bin:$PATH mkdir -p /toolchain/newlib/.build && cd /toolchain/newlib tar xf /downloads/newlib-$NEWLIB_VERSION.tar.gz cd .build LDFLAGS=-mno-red-zone ../newlib-$NEWLIB_VERSION/configure \ --disable-newlib-fseek-optimization \ --disable-newlib-io-float \ --disable-newlib-supplied-syscalls \ --disable-nls \ --disable-werror \ --prefix=/opt/toolchain \ --target=$TARGET \ CFLAGS_FOR_TARGET="-mcmodel=kernel -fno-pie" make -j$(nproc) make install