-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
GEN_ABSOLUTE_SYM cannot handle value larger than INT_MAX on qemu_x86_64 #22542
Comments
I'll take a look. |
The "c" modifier:
From https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html in 6.47.2.8 x86 Operand Modifiers Seems like it is not a fan of constants that don't fit in a 32-bit integer? hmmm |
Note that this fails only on |
This boils down to the following GCC inline asm code:
We are trying to set the value with The fact that this works fine with x86 32-bit is truly baffling. |
I might have to ask in the GCC mailing list about this one. The documentation for all of this is so far not helping. |
It passes if the value is less than UINT_MAX, if it's bigger than that it still builds but the value is truncated |
So what I'm seeing here is as follows:
For the former, we probably should open another bug if we're expecting to start dealing with Kconfigs that have values larger than UINT_MAX. We might consider other alternatives such as having CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC be expressed in terms of KHz instead of Hz, but that may or may not be feasible. For the latter, I've sent a message to gcc-help, maybe someone knows a workaround. |
Use the special x86 operand modifier 'p' to print the raw value. This fixes an issue on x86-64 where errors were generated if a constant larger than INT_MAX was used. Values larger than UINT_MAX are still unsupported (on any arch). Fixes: zephyrproject-rtos#22542 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Use the special x86 operand modifier 'p' to print the raw value. This fixes an issue on x86-64 where errors were generated if a constant larger than INT_MAX was used. Values larger than UINT_MAX are still unsupported (on any arch). Fixes: #22542 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
If a kconfig (e.g.
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
is defined with a value > +2147483647, it fails to compile with following error:I haven't tried negative maximum but it is reasonable to believe that it would also fail to compile.
The text was updated successfully, but these errors were encountered: