Hardware : MIMX9352CVVXMAB / I.MX93EVK board
WSL : Linux combassou 5.15.167.4-microsoft-standard-WSL2+
Ubuntu version : Ubuntu 22.04
Reference documentation : IMX_YOCTO_PROJECT_USERS_GUIDE.pdf
Hi, I am a new to the Yocto build system. I followed the steps given in the yocto project user guide provided by NXP, but I encountered a number of errors while building my image [imx-image-core], one of which I could not solve : "ERROR: libmpc-1.3.1-r0 do_configure: configure failed".
Executing "bitbake libmpc" returns the same error. cleaning and rebuilding libmpc does not solve it. same for gmp, mpfr, gcc, meta-toolchain. below is the list of commands I tried :
bitbake -c cleansstate libmpc
bitbake -c cleansstate gmp
bitbake -c cleansstate mpfr
bitbake -c cleansstate gcc
bitbake -c cleansstate meta-toolchain
bitbake meta-toolchain
This error seems to originate from the interaction with MPFR library, see the extract of my console below.
.
.
.
| checking for MPFR... no
| configure: error: libmpfr not found or uses a different ABI (including static vs shared).
| NOTE: The following config.log files may provide further information.
| NOTE: /home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/alexandre/imx-yocto-bsp/sources/poky/meta/recipes-support/libmpc/libmpc_1.3.1.bb:do_configure) failed with exit code '1'
When looking at the logs, the libmpfr is indeed not found. See the extract of the log (log.do_configure.XXX) below :
.
.
.
| checking for MPFR... no
| configure: error: libmpfr not found or uses a different ABI (including static vs shared).
| NOTE: The following config.log files may provide further information.
| NOTE: /home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/alexandre/imx-yocto-bsp/sources/poky/meta/recipes-support/libmpc/libmpc_1.3.1.bb:do_configure) failed with exit code '1'
This log (config.log) in particular provides more precision to the error. See below :
.
.
.
configure:14040: checking for MPFR
configure:14055: aarch64-poky-linux-gcc -march=armv8-a+crc+crypto -mbranch-protection=standard -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot -o conftest -O2 -pipe -g -feliminate-unused-debug-types -fcanon-prefix-map -fmacro-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/mpc-1.3.1=/usr/src/debug/libmpc/1.3.1 -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/mpc-1.3.1=/usr/src/debug/libmpc/1.3.1 -fmacro-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/build=/usr/src/debug/libmpc/1.3.1 -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/build=/usr/src/debug/libmpc/1.3.1 -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot= -fmacro-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot= -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot-native= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fcanon-prefix-map -fmacro-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/mpc-1.3.1=/usr/src/debug/libmpc/1.3.1 -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/mpc-1.3.1=/usr/src/debug/libmpc/1.3.1 -fmacro-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/build=/usr/src/debug/libmpc/1.3.1 -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/build=/usr/src/debug/libmpc/1.3.1 -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot= -fmacro-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot= -fdebug-prefix-map=/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot-native= -Wl,-z,relro,-z,now conftest.c -lmpfr -lgmp -lm -lm >&5
/home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/13.3.0/ld: /home/alexandre/imx-yocto-bsp/build/tmp/work/armv8a-poky-linux/libmpc/1.3.1/recipe-sysroot/usr/lib/libmpfr.so: undefined reference to `__bid128_to_binary64'
collect2: error: ld returned 1 exit status
configure:14055: $? = 1
.
.
.
So it seems libmpc do_configure step fails during linking step. Any idea on how to solve it ?
Thank you for your attention.
Solved! Go to Solution.
Hi @4ntonyme!
Thank you for contacting NXP Support!
Do you have the proper packages to compile?
Essential Yocto Project host packages are:
$ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool file
locales libacl1
Try reducing the cores of the Yocto compilation adding the next lines in local.conf file:
BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 4"
We recommend 4GB of ram of each core.
If all of those recommendation doesn't work please try in a Ubuntu machine we don't have tested in WSL.
Best Regards!
Chavira
Thank you Chavira.
I've rebuilt from scratch following the threads recommandation and it worked. It seems to me that bitbake' struggles comes from starvation of processes due to unsufficient RAM, therefore limiting the number of threads helps it.
Hi @4ntonyme!
Thank you for contacting NXP Support!
Do you have the proper packages to compile?
Essential Yocto Project host packages are:
$ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool file
locales libacl1
Try reducing the cores of the Yocto compilation adding the next lines in local.conf file:
BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 4"
We recommend 4GB of ram of each core.
If all of those recommendation doesn't work please try in a Ubuntu machine we don't have tested in WSL.
Best Regards!
Chavira