altcross-2stage.sh: fixed the smoke test
This commit is contained in:
parent
3fb2681856
commit
9519d1f099
@ -3,6 +3,9 @@ set -e
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
TARGET=aarch64-linux-gnu
|
TARGET=aarch64-linux-gnu
|
||||||
|
ARCH=aarch64
|
||||||
|
LINUX_ARCH=arm64
|
||||||
|
QEMU_ARCH=aarch64
|
||||||
|
|
||||||
unset NIL
|
unset NIL
|
||||||
|
|
||||||
@ -103,7 +106,7 @@ make -j$(nproc) install-gcc install-target-libgcc DESTDIR="$BOOTSTRAP_INSTALLDIR
|
|||||||
make -j$(nproc) \
|
make -j$(nproc) \
|
||||||
-C "$SRCDIR/linux" \
|
-C "$SRCDIR/linux" \
|
||||||
O="$BUILDDIR/obj_linux" \
|
O="$BUILDDIR/obj_linux" \
|
||||||
ARCH=arm64 \
|
ARCH=${LINUX_ARCH} \
|
||||||
INSTALL_HDR_PATH="$SYSROOTDIR/usr" \
|
INSTALL_HDR_PATH="$SYSROOTDIR/usr" \
|
||||||
headers_install
|
headers_install
|
||||||
|
|
||||||
@ -148,7 +151,7 @@ cd "$BUILDDIR/obj_gcc"
|
|||||||
--disable-multilib \
|
--disable-multilib \
|
||||||
${NIL}
|
${NIL}
|
||||||
|
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
make -j$(nproc) install DESTDIR="$INSTALLDIR"
|
make -j$(nproc) install DESTDIR="$INSTALLDIR"
|
||||||
|
|
||||||
|
|
||||||
@ -168,14 +171,18 @@ mv $INSTALLDIR/lib/gcc/$TARGET/lib64/libgcc_s.so* "$INSTALLDIR/lib/gcc/$TARGET/$
|
|||||||
rmdir "$INSTALLDIR/lib/gcc/$TARGET/lib64"
|
rmdir "$INSTALLDIR/lib/gcc/$TARGET/lib64"
|
||||||
|
|
||||||
|
|
||||||
$INSTALLDIR/bin/${target}-gcc -o ${BUILDDIR}/hello_c hello.c || exit 2
|
$INSTALLDIR/bin/${TARGET}-gcc -o ${BUILDDIR}/hello_c hello.c || exit 2
|
||||||
$INSTALLDIR/bin/${target}-g++ -o ${BUILDDIR}/hello_cpp hello.cpp || exit 3
|
$INSTALLDIR/bin/${TARGET}-g++ -o ${BUILDDIR}/hello_cpp hello.cpp || exit 3
|
||||||
|
$INSTALLDIR/bin/${TARGET}-gcc -o ${BUILDDIR}/bye_asm -static -nostdlib bye-${LINUX_ARCH}.S || exit 11
|
||||||
|
|
||||||
gcc_runtime_libdir=`$INSTALLDIR/bin/${target}-gcc --print-libgcc-file-name`
|
gcc_runtime_libdir=`$INSTALLDIR/bin/${TARGET}-gcc --print-libgcc-file-name`
|
||||||
gcc_runtime_libdir="${gcc_runtime_libdir%/*}"
|
gcc_runtime_libdir="${gcc_runtime_libdir%/*}"
|
||||||
|
|
||||||
env LD_LIBRARY_PATH=$INSTALLDIR${SYSROOT}/lib64:${gcc_runtime_libdir} \
|
if command -v qemu-${QEMU_ARCH}-static; then
|
||||||
qemu-${arch}-static -L ${INSTALLDIR}${SYSROOT} ${BUILDDIR}/hello_c || exit 5
|
# run test binaries
|
||||||
env LD_LIBRARY_PATH=$INSTALLDIR${SYSROOT}/lib64:${gcc_runtime_libdir} \
|
env LD_LIBRARY_PATH=$INSTALLDIR${SYSROOT}/lib64:${gcc_runtime_libdir} \
|
||||||
qemu-${arch}-static -L ${INSTALLDIR}${SYSROOT} ${BUILDDIR}/hello_cpp || exit 7
|
qemu-${QEMU_ARCH}-static -L ${INSTALLDIR}${SYSROOT} ${BUILDDIR}/hello_c || exit 5
|
||||||
|
env LD_LIBRARY_PATH=$INSTALLDIR${SYSROOT}/lib64:${gcc_runtime_libdir} \
|
||||||
|
qemu-${QEMU_ARCH}-static -L ${INSTALLDIR}${SYSROOT} ${BUILDDIR}/hello_cpp || exit 7
|
||||||
|
qemu-${QEMU_ARCH}-static ${BUILDDIR}/bye_asm || exit 13
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user