5 TARGET
=microblaze-linux-musl
9 TOOLCHAIN_INSTALL
=/usr
/local
10 TOOLCHAIN_BIN
=${TOOLCHAIN_INSTALL}/bin
11 CROSS_SYSROOT
=${TOOLCHAIN_INSTALL}/$TARGET/sys-root
13 export PATH
=${TOOLCHAIN_BIN}:$PATH
16 # Grab all of the source for the toolchain bootstrap.
19 wget https
://ftp.gnu.org
/gnu
/binutils
/binutils-2.37.
tar.xz
20 wget https
://ftp.gnu.org
/gnu
/gcc
/gcc-11.2
.0/gcc-11.2
.0.
tar.xz
21 wget https
://www.musl-libc.org
/releases
/musl-1.2
.2.
tar.gz
22 wget https
://cdn.kernel.org
/pub
/linux
/kernel
/v5.x
/linux-5.10
.70.
tar.xz
24 tar axf binutils-2.37.
tar.xz
25 tar axf gcc-11.2
.0.
tar.xz
26 tar axf musl-1.2
.2.
tar.gz
27 tar axf linux-5.10
.70.
tar.xz
29 mv binutils-2.37 src-binu
31 mv musl-1.2
.2 src-musl
32 mv linux-5.10
.70 src-linux
34 mkdir
-p bld-hdr bld-binu bld-gcc bld-musl
35 mkdir
-p ${CROSS_SYSROOT}/usr
/include
38 # Install kernel headers
42 make headers_install ARCH
=${LINUX_ARCH} INSTALL_HDR_PATH
=${CROSS_SYSROOT}/usr
50 ..
/src-binu
/configure
--disable-werror \
51 --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET}
57 # Build gcc, just the compiler so far.
61 ..
/src-gcc
/configure
--disable-werror --disable-shared \
62 --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} \
63 --enable-languages=c
--disable-libssp --disable-libsanitizer \
64 --disable-libatomic --disable-libgomp --disable-libquadmath
71 # We won't go through the extra step of building shared libraries
72 # because we don't actually use them in QEMU docker testing.
76 ..
/src-musl
/configure
--prefix=/usr
--host=${TARGET} --disable-shared
78 make install DESTDIR
=${CROSS_SYSROOT}
82 # Go back and build the compiler runtime