From 5c2052fd476cb1d15eab66c23016a1add93f6767 Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Sat, 20 Nov 2021 21:04:16 +0100 Subject: [Core] RISC-V toolchain and picolibc fixes (#15109) * [Core] Fix RISC-V toolchain installation The risc-v toolchain is only available on distributions based on Debian 11+ so we check for their availability before installing them. * [Core] Fix heap symbols and syscalls for picolibc picolibc internally uses __heap_start and __heap_end instead of the defacto chibios linker script standard __heap_base__ and __heap_end__ therefore we introduce these symbols as an alias. Usually all memory used within QMK is statically allocated, but some algorithms make usage of malloc and friends. Also the timeval struct is not defined by picolibc for syscalls, therefore it is declared as stub. --- util/install/debian.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'util/install/debian.sh') diff --git a/util/install/debian.sh b/util/install/debian.sh index 2a188334b6..3e02919bdd 100755 --- a/util/install/debian.sh +++ b/util/install/debian.sh @@ -11,12 +11,18 @@ _qmk_install_prepare() { _qmk_install() { echo "Installing dependencies" - sudo apt-get -yq install \ + sudo apt-get --quiet --yes install \ build-essential clang-format diffutils gcc git unzip wget zip \ python3-pip binutils-avr gcc-avr avr-libc binutils-arm-none-eabi \ gcc-arm-none-eabi libnewlib-arm-none-eabi avrdude dfu-programmer \ - dfu-util teensy-loader-cli libhidapi-hidraw0 libusb-dev \ - picolibc-riscv64-unknown-elf gcc-riscv64-unknown-elf binutils-riscv64-unknown-elf + dfu-util teensy-loader-cli libhidapi-hidraw0 libusb-dev - python3 -m pip install --user -r $QMK_FIRMWARE_DIR/requirements.txt + # RISC-V toolchains with picolibc support are only available for distributions based on Debian 11+. + if sudo apt-get install --simulate --quiet --yes picolibc-riscv64-unknown-elf gcc-riscv64-unknown-elf binutils-riscv64-unknown-elf > /dev/null 2>&1; then + sudo apt-get --quiet --yes install picolibc-riscv64-unknown-elf \ + gcc-riscv64-unknown-elf \ + binutils-riscv64-unknown-elf + fi + + python3 -m pip install --user -r "$QMK_FIRMWARE_DIR"/requirements.txt } -- cgit v1.2.3