cancel
Showing results for 
Search instead for 
Did you mean: 

bug in yocto - compiler bug in STM32MP1-Ecosystem-v5.0.0 mickledore-mp1-v23.06.21

UStre.2
Associate II

Hi,

compiler bug while building m4-projects from `https://github.com/STMicroelectronics/oe-manifest/tree/mickledore` The compiler series 11.2 has a internal compiler bug, so that I cannot compile the yocto mickledore with st settings. 
The issue is here `https://github.com/STMicroelectronics/meta-st-stm32mp/blob/mickledore/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi_11.inc` - buggy compiler is used.


Here are some bug reports on this topic:

https://bugs.launchpad.net/gcc-arm-embedded/+bug/1970029

https://bugs.linaro.org/show_bug.cgi?id=5825

Here the answer from arm:

https://community.arm.com/support-forums/f/compilers-and-libraries-forum/52623/gcc-11-2-arm-none-eabi-internal-compiler-error-illegal-instruction

Regards

Uwe

 

OS: Ubuntu 22.04/20.04

Arch: x64

 

| /home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp
1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/git/Projects/STM32MP157C-EV1/Demonstrations/AI_Charact
er_Recognition/Src/app_x-cube-ai.c: In function 'MX_X_CUBE_AI_Process':
| /home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp
1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/git/Projects/STM32MP157C-EV1/Demonstrations/AI_Charact
er_Recognition/Src/app_x-cube-ai.c:91:3: internal compiler error: Illegal instruction
|    91 |   if(imax >= 0 && max > 0.5F)
|       |   ^~
| 0x1521b50 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag 
(*) [1], diagnostic_t)
|       ???:0
| 0x15227d6 internal_error(char const*, ...)
|       ???:0
| 0xb7838f crash_signal(int)
|       ???:0
| 0x1721239 __gmpn_tdiv_qr
|       ???:0
| 0x17036ed parsed_string_to_mpfr
|       ???:0
| 0x1704497 mpfr_strtofr
|       ???:0
| 0xae57ec real_from_string(real_value*, char const*)
|       ???:0
| 0xae61cb real_from_string3(real_value*, char const*, format_helper)
|       ???:0
| 0x6e33a6 interpret_float(cpp_token const*, unsigned int, char const*, overflow_type*)
|       ???:0
| 0x6e43c7 c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
|       ???:0
| 0x66cbbe c_lex_one_token(c_parser*, c_token*, bool)
|       ???:0
| 0x67d33c c_parser_cast_expression(c_parser*, c_expr*)
|       ???:0
| 0x67dde6 c_parser_binary_expression(c_parser*, c_expr*, tree_node*)
|       ???:0
| 0x67e905 c_parser_conditional_expression(c_parser*, c_expr*, tree_node*)
|       ???:0
| 0x67ef04 c_parser_expr_no_commas(c_parser*, c_expr*, tree_node*)
|       ???:0
| 0x67f1b2 c_parser_expression(c_parser*)
|       ???:0
| 0x67f8cb c_parser_expression_conv(c_parser*)
|       ???:0
| 0x67f962 c_parser_condition(c_parser*)
|       ???:0
| 0x67fa0f c_parser_paren_condition(c_parser*)
|       ???:0
| 0x696148 c_parser_statement_after_labels(c_parser*, bool*, vec<tree_node*, va_heap, vl_ptr>*)
|       ???:0
| Please submit a full bug report,
| with preprocessed source if appropriate.
| Please include the complete backtrace with any bug report.
| See <https://bugs.linaro.org/> for instructions.
| make: *** [/home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/w
ork/stm32mp1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/Makefile.stm32:64: /home/uwe/Projects/git/p
VentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp1-ostl-linux-gnueabi/m4pro
jects-stm32mp1/1.6.0-r0/build/STM32MP157C-EV1/Demonstrations/AI_Character_Recognition/out/Debug//home/uw
e/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp1-ostl-lin
ux-gnueabi/m4projects-stm32mp1/1.6.0-r0/git/Projects/STM32MP157C-EV1/Demonstrations/AI_Character_Recogni
tion/Src/app_x-cube-ai.c.o] Error 1
| make: *** Waiting for unfinished jobs....
| free(): invalid next size (fast)
| /home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp
1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/git/Projects/STM32MP157C-EV1/Demonstrations/AI_Charact
er_Recognition/Src/main.c: In function 'main':
| /home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp
1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/git/Projects/STM32MP157C-EV1/Demonstrations/AI_Charact
er_Recognition/Src/main.c:314:3: internal compiler error: Aborted
|   314 |   if(IS_ENGINEERING_BOOT_MODE())
|       |   ^~
| 0x1521b50 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag 
(*) [1], diagnostic_t)
|       ???:0
| 0x15227d6 internal_error(char const*, ...)
|       ???:0
| 0xb7838f crash_signal(int)
|       ???:0
| 0x7f2072a39325 raise
|       ???:0
| 0x7f2072a2386b abort
|       ???:0
| 0x7f2072a93f82 free
|       ???:0
| 0x1551694 cpp_get_token_1(cpp_reader*, unsigned int*)
|       ???:0
| 0x6e416e c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
|       ???:0
| 0x66cbbe c_lex_one_token(c_parser*, c_token*, bool)
|       ???:0
| 0x68089c c_parser_postfix_expression_after_primary(c_parser*, unsigned int, c_expr)
|       ???:0
| 0x67062d c_parser_postfix_expression(c_parser*)
|       ???:0
| 0x67c292 c_parser_unary_expression(c_parser*)
|       ???:0
| 0x67d366 c_parser_cast_expression(c_parser*, c_expr*)
|       ???:0
| 0x67d620 c_parser_binary_expression(c_parser*, c_expr*, tree_node*)
|       ???:0
| 0x67e905 c_parser_conditional_expression(c_parser*, c_expr*, tree_node*)
|       ???:0
| 0x67ef04 c_parser_expr_no_commas(c_parser*, c_expr*, tree_node*)
|       ???:0
| 0x67f1b2 c_parser_expression(c_parser*)
|       ???:0
| 0x67f8cb c_parser_expression_conv(c_parser*)
|       ???:0
| 0x67f962 c_parser_condition(c_parser*)
|       ???:0
| 0x67fa0f c_parser_paren_condition(c_parser*)
|       ???:0
| Please submit a full bug report,
| with preprocessed source if appropriate.
| Please include the complete backtrace with any bug report.
| See <https://bugs.linaro.org/> for instructions.
| make: *** [/home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/w
ork/stm32mp1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/Makefile.stm32:64: /home/uwe/Projects/git/p
VentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp1-ostl-linux-gnueabi/m4pro
jects-stm32mp1/1.6.0-r0/build/STM32MP157C-EV1/Demonstrations/AI_Character_Recognition/out/Debug//home/uw
e/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/work/stm32mp1-ostl-lin
ux-gnueabi/m4projects-stm32mp1/1.6.0-r0/git/Projects/STM32MP157C-EV1/Demonstrations/AI_Character_Recogni
tion/Src/main.c.o] Error 1
| ERROR: oe_runmake failed
| WARNING: /home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1/tmp-glibc/wor
k/stm32mp1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/temp/run.do_compile.2191488:211 exit 1 from '
exit 1'
| WARNING: Backtrace (BB generated script):
|       #1: bbfatal_log, /home/uwe/Projects/git/pVentRefresh/yocto/yocto/build-openstlinuxeglfs-stm32mp1
/tmp-glibc/work/stm32mp1-ostl-linux-gnueabi/m4projects-stm32mp1/1.6.0-r0/temp/run.do_compile.2191488, li
ne 211

 

 

16 REPLIES 16

Dear Bernard,

Thanks for your feedback.

Sorry for my ignorance, but I don't see directly how this is linked with the file you attached earlier in the conversation.

Wasn't the file something I needed to use?

 

 

In the code above I see recipes for the devtools, which seems to be related to the Yocto builds.

Is Yocto downloading and building GCC ARM ?

So fixing the recipe would fix the build?

 

Thanks in advance for the clarifications.

 

Stefan.

Bernard PUEL
ST Employee

@debugging, These wiki articles are generic ones ("how to's"). The issue here comes from Arm gcc toolchain version and the patch (consisting in moving to another arm gcc toolchain version) will be integrated in V5.0.1 version delivered today.

But it is a good point, not easy to solve, how to share with customers already known issues ... any proposal ?

Hello Stefan,

Yes this is the same patch already shared in zip. You need to apply it in Yocto bsp layer (you can use git am or git apply-patch for that) : openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/layers/meta-st/meta-st-stm32mp.

The patch will change arm gcc version used to build the M4 SW then resolving the reported build issue.

Hope it is clear.

Dear Bernard,

I looked into it further this morning and applied the changes to the recipe.

Running again "bitbake st-image-weston".

I saw the recipe for the devtools got executed (which I wasn't sure would be the case) and now the earlier task seems to pass. At least the build is still running.

Thanks for the help and clarifications.

 

Regarding @debugging's remark for documentation. The issues should probably be on git, or alternatively a pinned thread on the forum. But the documentation should have a link to that list.

Other problems are most probably to be expected given the complexity of the build chain and the great variety or Linux package flavors.

Hello Bernard, about ideas. Don't want to interfere this discussion  So Ill probably create one for it to that other can provide input as well.

Stefan77
Associate II

Dear Bernard,

I just wanted to report that the build finished without further issues and I was able to flash the created image to my DK1.

Thanks for the help.

Happy to see your pb solved Stefan. This patch is integrated in release V5.0.1 that was delivered today.