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
Bernard PUEL
ST Employee

Hi,

Gcc version should be 11.3 in Yocto if you are on ubuntu 22.04 (this is also what i have by default on my ubuntu 22.04.2 (LTS).

 

Hi,

Yes, Ubuntu 22.04 but this is an error from meta-st-* layer from arm compiler.

Bernard PUEL
ST Employee

yes you are right. The question is why I don't have the same issue on my side. Your host is X86_64 right ?
 

Hi,

I'm tried with several CPUs  - same issue in VM, docker and native:

- Intel Core i9 11950H

- Intel Xeon CPU E31245 

- AMD Ryzen 7 5700x,

- AMD Ryzen7 5800HS

All host natively x86_64 alias x64 alias "amd64".
Errors have already been reported. See my first entry above.

ahamod3.1416
Associate II

Does anyone have any solution, I am facing the same error.

Bernard PUEL
ST Employee

Hello,

Thanks for all the details and sorry not to answer this post before. Even with all the details we could not reproduce the issue on our side (so difficult to propose a solution). Then this week, A colleague from US region got the problem on its desktop.

gcc 10.3 is no more compatible with V5 Yocto (due to Python version) and moving to gcc 12.x would require more work for validation. So we propose to move to gcc11.3 rel1 (as suggested in linaro ticket). Even if it seems not to solve all the gcc flavors, it seems to solve the one we use for the M4 build.

We could validate it on the faulty setup we have internally, please feedback if it is also ok on your side.

To avoid any misunderstanding here is attached the patch to apply. IT will be part of our next release v5.0.1.

Thanks again for your inputs.   

Hello,

I am facing the same issue.

 

I believe that when you refer to GCC version 10.3, you mean the GCC-ARM and not the one shipped with Ubuntu?

Could you clarify?.

How do I apply the patch you're giving?

And how do I know it's valid/needed for my setup?

What does that patch concretely do?

 

Where in the documentation can I find the known/open issues like this one that prevent me from running even the basic example?

If I hadn't found this post I'd still be searching why it's not working...

Yes this is Arm gcc, here is the patch:

 

diff --git a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi_11.inc b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi_11.inc
index 515784a..3d2a65b 100644
--- a/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi_11.inc
+++ b/recipes-devtools/gcc-arm-none-eabi/gcc-arm-none-eabi_11.inc
@@ -1,18 +1,17 @@
SUMMARY = "Baremetal GCC for ARM"
LICENSE = "GPL-3.0-with-GCC-exception & GPL-3.0-only"

-LIC_FILES_CHKSUM = "file://share/info/gcc.info;md5=32f1a898d3ddd89ccb368ff8f483c98a"
+LIC_FILES_CHKSUM = "file://share/info/gcc.info;md5=520901b4e94df9b4e99ad47d88719a6b"
+SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz;name=gcc-arm-x86"
+SRC_URI[gcc-arm-x86.sha256sum] = "d420d87f68615d9163b99bbb62fe69e85132dc0a8cd69fca04e813597fe06121"

-SRC_URI = "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi.tar.xz;name=gcc-arm-x86"
-SRC_URI[gcc-arm-x86.sha256sum] = "8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326"
-
-SRC_URI:aarch64 = "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-aarch64-arm-none-eabi.tar.xz;name=gcc-arm-aarch64"
-SRC_URI[gcc-arm-aarch64.sha256sum] = "ef1d82e5894e3908cb7ed49c5485b5b95deefa32872f79c2b5f6f5447cabf55f"
+SRC_URI:aarch64 = "https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi.tar.xz;name=gcc-arm-aarch64"
+SRC_URI[gcc-arm-aarch64.sha256sum] = "6c713c11d018dcecc16161f822517484a13af151480bbb722badd732412eb55e"

PV = "11"

-S = "${WORKDIR}/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi"
-S:aarch64 = "${WORKDIR}/gcc-arm-11.2-2022.02-aarch64-arm-none-eabi"
+S = "${WORKDIR}/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi"
+S:aarch64 = "${WORKDIR}/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi"

do_install() {
    install -d ${D}/${datadir}/gcc-arm-none-eabi
 

debugging
Senior III