Hi,
I just installed gcc-arm-11.2-2022.02-darwin-x86_64-arm-none-eabi.pkg on a Mac with Apple Silicon.Trying to compile anything, always results in this error: internal compiler error: Illegal instruction: 4I don't have any of these issues with the previous release of the toolchain (gcc-arm-none-eabi-10.3-2021.10-mac.pkg).I also tried version 11.2-2022.02 on an Intel based Mac, and there are no compiler errors, as can be seen below.
❯ system_profiler SPHardwareDataType SPSoftwareDataType Hardware: Hardware Overview: Model Name: MacBook Air Model Identifier: MacBookAir10,1 Chip: Apple M1 Total Number of Cores: 8 (4 performance and 4 efficiency) Memory: 8 GB System Firmware Version: 7429.81.3 OS Loader Version: 7429.81.3 Activation Lock Status: Disabled Software: System Software Overview: System Version: macOS 12.2.1 (21D62) Kernel Version: Darwin 21.3.0 Boot Volume: Macintosh HD Boot Mode: Normal Computer Name: derek’s MacBook Air User Name: derek (derek) Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 6:07 ❯ arm-none-eabi-gcc --version arm-none-eabi-gcc (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 11.2.1 20220111 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ❯ bat main.c ───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │ File: main.c │ Size: 53 B ───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 1 │ int main(void) 2 │ { 3 │ float var = 1.f; 4 │ return 0; 5 │ } ───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ arm-none-eabi-gcc -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -mthumb -c main.c main.c: In function 'main': main.c:3:5: internal compiler error: Illegal instruction: 4 3 | float var = 1.f; | ^~~~~ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.linaro.org/> for instructions. ❯ source .zshrc ~  ❯ arm-none-eabi-gcc --version arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~  ❯ arm-none-eabi-gcc -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -mthumb -c main.c ~  ❯
➜ ~ system_profiler SPHardwareDataType SPSoftwareDataType Hardware: Hardware Overview: Model Name: MacBook Pro Model Identifier: MacBookPro16,1 Processor Name: 6-Core Intel Core i7 Processor Speed: 2,6 GHz Number of Processors: 1 Total Number of Cores: 6 L2 Cache (per Core): 256 KB L3 Cache: 12 MB Hyper-Threading Technology: Enabled Memory: 16 GB System Firmware Version: 1715.81.2.0.0 (iBridge: 19.16.10744.0.0,0) OS Loader Version: 540.80.2~11 Activation Lock Status: Disabled Software: System Software Overview: System Version: macOS 12.2.1 (21D62) Kernel Version: Darwin 21.3.0 Boot Volume: Macintosh HD Boot Mode: Normal Computer Name: derek’s MacBook Pro User Name: derek (derek) Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 1 minute ➜ ~ arm-none-eabi-gcc --version arm-none-eabi-gcc (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 11.2.1 20220111 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ➜ ~ bat main.c ───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────── │ File: main.c │ Size: 53 B ───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────── 1 │ int main(void) 2 │ { 3 │ float var = 1.f; 4 │ return 0; 5 │ } ───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────── ➜ ~ arm-none-eabi-gcc -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mabi=aapcs -mthumb -c main.c ➜ ~
Any idea what might be causing these problems?
Best regards,Derek
That seems to indicate that Rosetta, the x86_64 emulation layer on Apple Silcon doesn't support support an instruction the program needs.
Hi Tamar,thank you for the reply.I thought so too, maybe some AVX vector instructions.
Do you know if there is any plan to solve this problem?If so, can I be of any help?
Hi community,
I copy this issue on MacBook Pro M1 Max. Homebrew decided to upgrade the gcc-arm-embedded cask to 11.2, yet compilation seems actually broken now on Apple Silicon. Yes, we can downgrade to 10.3 in the meanwhile, but what is the suggested way to move forward with this?
Best
Oliver
Also seeing this same error on a regular x86 Mac with 11.2-2022.02. Previous version of the ARM toolchain (10.3-2021.07) works fine.
I am experiencing different issue but would somehow indicate to the same underlaying problem with version 11.2. I am using Segger Embedded studio which crashes when I am trying to load certain standard libraries. Probably missing some instructions that are used by the compiler and then IDE is not handling the errors correctly and crashes..
Is this issue that needs to be fixed by ARM compiler (so hopefully in next version it will work) or are we waiting for Rosetta patch ? Because same code on 10.3 works like a charm.
I think this might be the same issue as: community.arm.com/.../gcc-11-2-arm-none-eabi-internal-compiler-error-illegal-instruction
Which as indicated in: https://community.arm.com/support-forums/f/compilers-and-libraries-forum/52623/gcc-11-2-arm-none-eabi-internal-compiler-error-illegal-instruction/176970#176970
It would be a known issue fixed in the latest release: bugs.linaro.org/show_bug.cgi
The issue is solved for me in version 11.3.1