I don't know how to change compile level in GCC_RELEASE(hp).
There're few ways I have been tried but all failed, test with a global vriable:
Changed all the Os to O0 in every related Makefile.
Defined a global variable with __attribute__ ((optimize("O0"))), e.g., volatile char *s __attribute__ ((optimize("O0"))) = "Hello World string from KM4";, after flashing and entering gdb shell, tried to print the variable but no symbol
Once the variable is used, such as printf, DiagPrintf("The km4_string is : %s\n", s);it can keep away from being optimized,
Surrounded the global vriable by pragma
#pragma GCC push_options
#pragma GCC optimize ("O0")
char *s = "Hello World string from KM4";
#pragma GCC pop_options
I also noted the compile option has been changed from "O2" to "Os" in Git 210714_317d518b to Git 210809_a30eac93 but I have no idea what to do.
Description
I don't know how to change compile level in GCC_RELEASE(hp).
There're few ways I have been tried but all failed, test with a global vriable:
Changed all the![image](https://github.com/ambiot/ambd_sdk/assets/117975206/30f5e7ef-1772-4232-bb1d-159360715a2f)
Os
toO0
in every related Makefile.Defined a global variable with
Once the variable is used, such as printf, ![image](https://github.com/ambiot/ambd_sdk/assets/117975206/166ccec8-1caf-40ff-a99b-4b05ed533b86)
__attribute__ ((optimize("O0")))
, e.g.,volatile char *s __attribute__ ((optimize("O0"))) = "Hello World string from KM4";
, after flashing and entering gdb shell, tried to print the variable but no symbolDiagPrintf("The km4_string is : %s\n", s);
it can keep away from being optimized,Surrounded the global vriable by pragma
I also noted the compile option has been changed from "O2" to "Os" in Git 210714_317d518b to Git 210809_a30eac93 but I have no idea what to do.
Thanks in advance.