From 0a54d83391f10a804d654fe8fa14cf817fa11cd7 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Sun, 1 Sep 2024 18:34:33 +0200 Subject: [PATCH] Make it easier to build newlib with our SDK The whole process of building newlib is a lot easier if we have a compiler with the same prefix as our operating system. In this case that is riscv32-badgeros or riscv64-badgeros. The SDK can now easily support this. --- build-sdk.sh | 14 +++++++++++++- build-sdk64.sh | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/build-sdk.sh b/build-sdk.sh index c25292081df5..f8b05339e4c2 100755 --- a/build-sdk.sh +++ b/build-sdk.sh @@ -17,10 +17,22 @@ function build_linux_sdk() { ${container} build -f Dockerfile.linux-builder -t badgeros-buildroot-builder-linux ${container} run -it --rm -v $(pwd):/tmp/buildroot:z -w /tmp/buildroot -e FORCE_UNSAFE_CONFIGURE=1 --userns=keep-id badgeros-buildroot-builder-linux bash -c "make clean; make syncconfig; make sdk" + + mkdir -p badgeros-toolchains + tar xf output/images/${toolchain_prefix}_sdk-buildroot.tar.gz -C badgeros-toolchains + + pushd badgeros-toolchains/${toolchain_prefix}_sdk-buildroot/bin + for f in $(ls -1 riscv32-linux-*); do ln -s ${f} $(echo $f | sed -e 's/linux/badgeros/'); done + popd + + pushd badgeros-toolchains + tar -cjf ${toolchain_prefix}_sdk-buildroot.tar.bz2 ${toolchain_prefix}_sdk-buildroot + rm -rf ${toolchain_prefix}_sdk-buildroot + popd } build_linux_sdk echo echo "***************************************" -echo "Build succesful your toolchain is in output/images/${toolchain_prefix}_sdk-buildroot.tar.gz" +echo "Build succesful your toolchain is in badgeros-toolchains/${toolchain_prefix}_sdk-buildroot.tar.gz" diff --git a/build-sdk64.sh b/build-sdk64.sh index 211d665dddfd..3ff4db2b8462 100755 --- a/build-sdk64.sh +++ b/build-sdk64.sh @@ -17,10 +17,22 @@ function build_linux_sdk() { ${container} build -f Dockerfile.linux-builder -t badgeros-buildroot-builder-linux ${container} run -it --rm -v $(pwd):/tmp/buildroot:z -w /tmp/buildroot -e FORCE_UNSAFE_CONFIGURE=1 --userns=keep-id badgeros-buildroot-builder-linux bash -c "make clean; make syncconfig; make sdk" + + mkdir -p badgeros-toolchains + tar xf output/images/${toolchain_prefix}_sdk-buildroot.tar.gz -C badgeros-toolchains + + pushd badgeros-toolchains/${toolchain_prefix}_sdk-buildroot/bin + for f in $(ls -1 riscv64-linux-*); do ln -s ${f} $(echo $f | sed -e 's/linux/badgeros/'); done + popd + + pushd badgeros-toolchains + tar -cjf ${toolchain_prefix}_sdk-buildroot.tar.bz2 ${toolchain_prefix}_sdk-buildroot + rm -rf ${toolchain_prefix}_sdk-buildroot + popd } build_linux_sdk echo echo "***************************************" -echo "Build succesful your toolchain is in output/images/${toolchain_prefix}_sdk-buildroot.tar.gz" +echo "Build succesful your toolchain is in badgeros-toolchains/${toolchain_prefix}_sdk-buildroot.tar.gz"