Closed TheEdgeOfRage closed 3 years ago
Yeah looks like a compiler issue -- it looks like trying to be smart and validate the size of the target variable, ignoring the fact that it'd been cast to something else.
Can you try changing VBAT to VBAT_BASE?
Same thing :/
Compiling: tmk_core/common/chibios/bootloader.c tmk_core/common/chibios/bootloader.c: In function 'bootloader_jump':
tmk_core/common/chibios/bootloader.c:90:5: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds]
90 | __builtin_memcpy((void *)VBAT_BASE, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think it is this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
For anyone suffering the same problem, I have one insight to offer:
The problem seems to not be universal as I am able to compile a dz60
default layout, but is perhaps limited to keyboards made by input club. I tried compiling infinity60
and whitefox
with the default layers, which ended with the same compilation error. Based on the fact that the affected keyboards are designed by the same team I would guess they would be related - software and/or hardware.
However if I downgrade the ARM bare metal GCC target package (arm-none-eabi-gcc
on arch linux) to 10.3.0 from 11.1.0, I can compile and flash just fine.
Perhaps it would be possible to tweak the code to use different logic than currently, but I honestly don't know if that makes sense to do, or if it is even possible. Maybe waiting for the GCC fix is most reasonable thing to do ?
develop
and it compiled just fine with the latest version of arm-none-eabi-gcc (11.1.0)
I'm not sure whether I should open this issue here, on tmk, or chibios, but it's not in any of the submodules, so I guess I'll start here. If it doesn't belong here, please redirect me to the correct place.
Describe the Bug
When trying to compile the firmware for ergodox_infinity, I get the following output:
This is after a second make run, to reduce the output for files that have already previously been compiled successfully.
System Information
Additional Context
A few days ago, this compilation ran just fine, and this error happened both before rebasing on the latest master commid and after. My guess is that something changed in my local environment, since running it in the Docker container from the provided Dockerfile, works flawlessly.
The
arm-none-eabi-gcc
package on archlinux received an update 4 days ago, so I assume that that is the culprit, I'm just not sure why.I have set up a Dockerfile that reproduces the error (at least at time of writing) using the archlinux base image: