Skip to content

Commit

Permalink
Make it easier to build newlib with our SDK
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hpvb committed Sep 1, 2024
1 parent f457d3b commit 0a54d83
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion build-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 13 additions & 1 deletion build-sdk64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 0a54d83

Please sign in to comment.