[SOLVED] New install on Debian 11 - "illegal instruction" error

Hi, change the main drive of my laptop and tried to install the toolchain once more (it worked before).

Followed: 1. Setting Up Your Development Environment · electro-smith/DaisyWiki Wiki · GitHub

DL’ed and extracted gcc-arm-11.2-2022.02-x86_64-arm-none-eabi.tar.xz and set the PATH variable.

When I run ./rebuild_all.sh in the DaisyExamples folder I get:

staffan@debiandelle6430:~/Documents/projects/tech/daisy/DaisyExamples$ ./rebuild_all.sh
building libDaisy . . .
In file included from src/daisy.h:5,
from src/daisy_seed.h:5,
from src/daisy_field.h:4,
from src/daisy_field.cpp:1:
src/daisy_core.h:81:5: internal compiler error: Illegal instruction
81 | return ((float)x - 127.f) * U82F_SCALE;
| ^~~~~~

When running make in the Blink folder:

arm-none-eabi-g++ -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000 -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER -include stm32h7xx.h -I…/…/libDaisy -I…/…/libDaisy/src/ -I…/…/libDaisy/src/sys -I…/…/libDaisy/src/usbd -I…/…/libDaisy/src/usbh -I…/…/libDaisy/Drivers/CMSIS/Include/ -I…/…/libDaisy/Drivers/CMSIS/DSP/Include -I…/…/libDaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I…/…/libDaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I…/…/libDaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I…/…/libDaisy/Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I…/…/libDaisy/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I…/…/libDaisy/core/ -I…/…/DaisySP/Source -I…/…/libDaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -Wno-stringop-overflow -g -ggdb -MMD -MP -MF"build/Blink.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables -Wno-register -std=gnu++14 -Wa,-a,-ad,-alms=build/Blink.lst Blink.cpp -o build/Blink.o
In file included from …/…/libDaisy/src/daisy.h:5,
from …/…/libDaisy/src/daisy_seed.h:5,
from Blink.cpp:1:
…/…/libDaisy/src/daisy_core.h:81:5: internal compiler error: Illegal instruction
81 | return ((float)x - 127.f) * U82F_SCALE;

Am I doing something wrong?

OS: Debian 11 Testing.

I cant’ decipher what you may be doing that is not the same as I did just now, setting up and building on debian 11 testing.

sudo apt install build-essential git
sudo apt install dfu-util
sudo apt install openocd

mkdir ~/Dev
wget -c https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi.tar.xz
tar xf gcc-arm-11.2-2022.02-x86_64-arm-none-eabi.tar.xz -C ~/Dev

cat >> ~/.bashrc << \EOT
GCC_PATH=~/Dev/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin
export PATH=$GCC_PATH:$PATH
EOT

source ~/.bashrc

git clone --recursive https://github.com/electro-smith/DaisyExamples

cd DaisyExamples/

./ci/build_libs.sh

cd seed/Blink/
make

(`./rebuild_all.sh` works too)
1 Like

Thank yout for your respons anyway, Jens. Very strange. I am getting “illegal instruction” errors on “return” and “float”…

Do you get the same compiler instructions as me when building the Blink example?

arm-none-eabi-g++ -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000 -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER -include stm32h7xx.h -I…/…/libDaisy -I…/…/libDaisy/src/ -I…/…/libDaisy/src/sys -I…/…/libDaisy/src/usbd -I…/…/libDaisy/src/usbh -I…/…/libDaisy/Drivers/CMSIS/Include/ -I…/…/libDaisy/Drivers/CMSIS/DSP/Include -I…/…/libDaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I…/…/libDaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I…/…/libDaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I…/…/libDaisy/Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I…/…/libDaisy/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I…/…/libDaisy/core/ -I…/…/DaisySP/Source -I…/…/libDaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -Wno-stringop-overflow -g -ggdb -MMD -MP -MF"build/Blink.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables -Wno-register -std=gnu++14 -Wa,-a,-ad,-alms=build/Blink.lst Blink.cpp -o build/Blink.o

~/DaisyExamples/seed/Blink$ make

mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER -include stm32h7xx.h -I../../libDaisy -I../../libDaisy/src/ -I../../libDaisy/src/sys -I../../libDaisy/src/usbd -I../../libDaisy/src/usbh -I../../libDaisy/Drivers/CMSIS/Include/ -I../../libDaisy/Drivers/CMSIS/DSP/Include -I../../libDaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libDaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libDaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libDaisy/Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../../libDaisy/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I../../libDaisy/core/ -I../../DaisySP/Source -I../../libDaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -Wno-stringop-overflow -g -ggdb -MMD -MP -MF"build/startup_stm32h750xx.d" -std=gnu11 -Wa,-a,-ad,-alms=build/startup_stm32h750xx.lst ../../libDaisy/core/startup_stm32h750xx.c -o build/startup_stm32h750xx.o
arm-none-eabi-g++  -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER -include stm32h7xx.h -I../../libDaisy -I../../libDaisy/src/ -I../../libDaisy/src/sys -I../../libDaisy/src/usbd -I../../libDaisy/src/usbh -I../../libDaisy/Drivers/CMSIS/Include/ -I../../libDaisy/Drivers/CMSIS/DSP/Include -I../../libDaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libDaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libDaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libDaisy/Middlewares/ST/STM32_USB_Host_Library/Core/Inc -I../../libDaisy/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc -I../../libDaisy/core/ -I../../DaisySP/Source -I../../libDaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -Wno-stringop-overflow -g -ggdb -MMD -MP -MF"build/Blink.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables -Wno-register -std=gnu++14 -Wa,-a,-ad,-alms=build/Blink.lst Blink.cpp -o build/Blink.o
arm-none-eabi-g++  build/startup_stm32h750xx.o build/Blink.o  -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard --specs=nano.specs --specs=nosys.specs -T../../libDaisy/core/STM32H750IB_flash.lds -L../../libDaisy/build -L ../../DaisySP/build -ldaisy -lc -lm -lnosys -ldaisysp -Wl,-Map=build/Blink.map,--cref -Wl,--gc-sections -Wl,--print-memory-usage -o build/Blink.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       45512 B       128 KB     34.72%
         DTCMRAM:          0 GB       128 KB      0.00%
            SRAM:        7440 B       512 KB      1.42%
          RAM_D2:         16 KB       288 KB      5.56%
          RAM_D3:          0 GB        64 KB      0.00%
         ITCMRAM:          0 GB        64 KB      0.00%
           SDRAM:          0 GB        64 MB      0.00%
       QSPIFLASH:          0 GB         8 MB      0.00%
arm-none-eabi-objcopy -O ihex build/Blink.elf build/Blink.hex
arm-none-eabi-objcopy -O binary -S build/Blink.elf build/Blink.bin
arm-none-eabi-g++ -v

Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=/home/jpn/Dev/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/11.2.1/lto-wrapper
Target: arm-none-eabi
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure --target=arm-none-eabi --prefix=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-eabi/install// --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-eabi/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-eabi/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-eabi/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-eabi/host-tools --disable-shared --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c,c++,fortran --with-newlib --with-multilib-list=aprofile,rmprofile --with-pkgversion='GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)' --with-bugurl=https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220111 (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14))
1 Like

Thank you @Jens.Peter.Nielsen, looks identitcal to what I have. Except that the call to arm-none-eabi-g++ for Blink.cpp throws this error for me. Which looks like an internal error in the compiler.

I downloaded it a second time but get the same error. I have no idea how to move forward from this.

Running on a Dell E6430 core i7, updated Debian 11 Testing.

It seems to me that it’s simliar to this bug ?

… it looks like the GMP function is using the Intel ADX feature here, which explains why the issue only occurs on certain machines (those without that architecture feature). It seems the host architecture has been picked up from that of the build machine.

A rebuild of the toolchain, compiled for a baseline x86_64 host architecture should fix this issue.

5825 – Illegal instruction: 4 on questionable float conversion

I would try compiling using the previous arm toolcain release.

https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2

add: see this support page too.

1 Like

Thanks you very much @Jens.Peter.Nielsen! I searched for the possible bug online but didn’t think of looking at the issue queue for the compiler.

Going back to the 2021 version and it works now! My Dell is a pretty old computer so maybe it is no wonder it is missing instructions in the processor.

Once again, thank you for all your help! Have a nice day!

EDIT: the rebuild_all.sh script is not working (and not really usable) as it compiles examples for other platforms and generates errors. But ./ci/build_libs.sh does the trick.

1 Like