arsv / riscv-toolchain

build scripts for multi-sysroot RISC-V toolchain
Other
1 stars 2 forks source link

Build fails with `scripts/stagebin: 14: Bad substitution` #1

Open TommyMurphyTM1234 opened 1 year ago

TommyMurphyTM1234 commented 1 year ago

Using a Zorin OS Lite 16.2 (Ubuntu 20.04 derivative) VirtualBox virtual machine with all prerequiste packages installed I tried to build as follows but got the error shown:

cd ~/Downloads
git clone https://github.com/arsv/riscv-toolchain arsv-riscv-toolchain
cd arsv-riscv-toolchain
./configure --prefix `pwd`/installed-tools
make 2>&1 | tee build.log

...

make[12]: Nothing to be done for 'install-data-am'.
make[12]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib/import'
make[11]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib/import'
make[10]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib/import'
make[9]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib/import'
make[8]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib'
make[7]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib'
make[6]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb/build-gnulib'
make[5]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb'
make[4]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb'
make[3]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils/gdb'
make[2]: Nothing to be done for 'install-target'.
make[2]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils'
make[1]: Leaving directory '/home/tommy/Downloads/arsv-riscv-toolchain/build-binutils'
touch files-binutils/stamp
scripts/stagebin files-binutils/bin riscv64-riscv32-elf
scripts/stagebin: 14: Bad substitution
make: *** [make-binutils.mk:22: staging/exe/ld] Error 2

Full build log (compressed): build.log.tar.gz

The issue seems to be here but I don't know why:

TommyMurphyTM1234 commented 1 year ago

The issue seems to be here but I don't know why:

I changed that line to:

        stem=${base#"$target-"}

and it seems to work.