raspberrypi / pico-setup

92 stars 42 forks source link

pico_setup.sh doesn't install all of the required components on an AARCH64 kernel/32-bit userland. #9

Open DougieLawson opened 3 years ago

DougieLawson commented 3 years ago

Running pico_setup.sh on a RaspiOS system built as 32-bit userland but running with the 64-bit 5.10.10 kernel fails with

Scanning dependencies of target ELF2UF2Build
Scanning dependencies of target bs2_default
[  0%] Creating directories for 'ELF2UF2Build'
[  0%] Building ASM object pico_sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/boot2_w25q080.S.obj
[  0%] Linking ASM executable bs2_default.elf
[  0%] No download step for 'ELF2UF2Build'
arm-none-eabi-gcc: error: nosys.specs: No such file or directory
make[2]: *** [pico_sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/build.make:77: pico_sdk/src/rp2_common/boot_stage2/bs2_default.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:1016: pico_sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  0%] No update step for 'ELF2UF2Build'
[  0%] No patch step for 'ELF2UF2Build'
[  0%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /shared/pico-setup/pico/pico-examples/build/elf2uf2
[  0%] Performing build step for 'ELF2UF2Build'
Scanning dependencies of target elf2uf2
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[100%] Linking CXX executable elf2uf2
[100%] Built target elf2uf2
[  0%] No install step for 'ELF2UF2Build'
[  0%] Completed 'ELF2UF2Build'
[  0%] Built target ELF2UF2Build
make: *** [Makefile:84: all] Error 2

The solution is to install libnewlib-arm-none-eabi and libstdc++-arm-none-eabi-newlib.

pico-setup.sh needs to be updated to include those two pieces.

aallan commented 3 years ago

The solution is to install libnewlib-arm-none-eabi and libstdc++-arm-none-eabi-newlib.

This actually got picked up before launch. The manual install instructions have been changed in the Getting Started guide. However the only circumstances we have seen this is where apt is being forced to not install requirements. This shouldn't happen when running pico-setup.sh as it has control over how apt is being called. Do you have any unusual global configuration setup that might cause it to not install additional requirements?

lurch commented 3 years ago

See also https://github.com/raspberrypi/pico-sdk/commit/ef38b746efaeb0aa1354406198a76da29302aada

lurch commented 3 years ago

And FYI I did test a pure 32-bit install and a pure 64-bit install before launch, and they both worked fine (after some tweaks #4 ), I just didn't test a mixed 64/32-bit installation.

DougieLawson commented 3 years ago

Do you have any unusual global configuration setup that might cause it to not install additional requirements?

This is stock standard Raspbian Buster frequently upgraded with the 5.10.10 kernel installed with rpi-update. It's nothing special apart from 32-bit userland and the 64-bit kernel. The exact same software build (but without the 64-bit kernel) runs on my RPi2B (and seven other Raspberries).

If I've reached the point of running the script then I'm beyond the point of reading that stuff in the docs, so saying stuff is "documented" is a fatuous answer. Just change the script - because otherwise the naïve user will come a cropper on this.