-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] ChibiOS compilation error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] #12925
Comments
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 :/
|
I think it is this bug: |
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 However if I downgrade the ARM bare metal GCC target package ( 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 ? |
This prevents gcc from incorrectly trying to validate array bounds. ``` tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds] 107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16 Fixes qmk#12925
This prevents gcc from incorrectly trying to validate array bounds. ``` tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds] 107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16 Fixes #12925
#13450 Fixes this issue. I rebased my branch on |
This prevents gcc from incorrectly trying to validate array bounds. ``` tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds] 107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16 Fixes qmk#12925
This prevents gcc from incorrectly trying to validate array bounds. ``` tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds] 107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16 Fixes qmk#12925
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:
The text was updated successfully, but these errors were encountered: