IMX8MM Yocto构建遇见的错误及解决方法:
- 1 bison-3.0.4 error
- 2 Opencv BB_NO_NETWORK Error :
- 3 Yocto构建时出现U-boot 问题
- 4 Yocto构建时出现Linux kernel编译问题
- 5 wayland-native
- 6 cross-localedef-native
- 7 wayland-protocols
- 8 mesa
硬件:米尔 IMX8MM
1 bison-3.0.4 error
| ../bison-3.0.4/lib/fseterr.c: In function 'fseterr':
| ../bison-3.0.4/lib/fseterr.c:77:3: error: #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
| #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
解决方法:
进入bison-3.0.4目录,文件中进行替换和添加内容。
在 lib 目录下的所有以 .c 结尾的文件中,将字符串 IO_ftrylockfile 替换为 IO_EOF_SEEN,并在 lib/stdio-impl.h 文件末尾添加一个 C 语言宏定义
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
2 Opencv BB_NO_NETWORK Error :
ERROR: opencv-4.2.0.imx-r0 do_fetch: Network access disabled through
BB_NO_NETWORK (or set indirectly due to use of BB_FETCH_PREMIRRORONLY)
but access requested with command LANG=C git -c
core.fsyncobjectfiles=0 fetch -f --prune --progress
https://source.codeaurora.org/external/imx/opencv-imx.git
refs/:refs/ (for url
git://source.codeaurora.org/external/imx/opencv-imx.git;protocol=https;branch=4.2.0_imx;name=opencv)
当设置了 BB_NO_NETWORK 为 1 时,构建系统会禁止所有网络访问。这在一些场景下很有用,例如在没有互联网连接或者出于安全原因需要禁止网络访问的情况下。设置了 BB_NO_NETWORK 后,构建系统将不会尝试下载任何软件包或依赖项,而是会依赖本地缓存的文件。
解决
将 local.conf 文件里面的 BB_NO_NETWORK 设置删除或者设置为0
BB_NO_NETWORK = “0”
3 Yocto构建时出现U-boot 问题
ERROR: u-boot-imx-2018.03-r0 do_fetch: Fetcher failure: Unable to
resolve ‘cc2c0393 14066949b84d48c035e9e08380ddc56dcb’ in upstream git
repository in git ls-remote out put for
//home/hufan/MYIR-i.MX8MM-Uboot ERROR: u-boot-imx-2018.03-r0 do_fetch:
Function failed: base_do_fetch ERROR: Logfile of failure stored in:
/media/hufan/new-im8xmm-20190527/build_8m_mini
_0706/tmp/work/myd_imx8mm-poky-linux/u-boot-imx/2018.03-r0/temp/log.do_fetch.18702
ERROR: Task
(/media/hufan/new-im8xmm-20190527/sources/meta-myir/meta-myir-bsp/recip
es-bsp/u-boot/u-boot-imx_2018.03.bb:do_fetch) failed with exit code
‘1’ ERROR: linux-imx-4.14.98-r0 do_fetch: Fetcher failure: Unable to
resolve ‘111d006bf 101e8aebab28acdd034d7fe1281c0e77c1’ in upstream git
repository in git ls-remote out put for
//home/hufan/MYIR-i.MX8MM-Linux ERROR: linux-imx-4.14.98-r0 do_fetch:
Function failed: base_do_fetch
解决:这种情况是由于U-Boot更新后,Yocto没有更新的对应的版本。
修改步骤如下:
1. 进⼊U-Boot源码⽬录,使⽤"git log"查看commit id。
2. 修改Yocto源码⽬录下的"source/meta-myir/meta-myir-bsp/recipes-bsp/u-boot/u-boot-imx_2018.03.bb"⽂
件中的SRCREV变量为查询到的commit id即可。
4 Yocto构建时出现Linux kernel编译问题
同样是Linux Kernel更新后,Yocto没有更新版本。修改步骤如下:
1. 进⼊Linux源码⽬录,使⽤"git log"查看commit id并复制
2. 修改Yocto源码⽬录下的"source/meta-myir/meta-myir-bsp/recipes-kernel/linux/linux-imx_4.14.98.bb"⽂
件中的SRCREV变量为commit id即可。
5 wayland-native
ERROR: wayland-native-1.17.0-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS=“unix:path=/run/user/1000/bus,guid=c5a2e3679a31b7ffd15fafb165b85632”; export SSH_AGENT_PID=“1307”; export SSH_AUTH_SOCK=“/run/user/1000/keyring/ssh”; export ALL_PROXY=“socks5://172.16.112.237:1090”; export https_proxy=“http://127.0.0.1:7890”; export http_proxy=“http://127.0.0.1:7890”; export PATH=“/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/scripts/native-intercept:/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/scripts:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-linux:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/bin:/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/bitbake/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/hosttools”; export HOME=“/home/hh”; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -P /home/hh/MYIR-Yocto-i.MX8MM/downloads/ ‘https://wayland.freedesktop.org/releases/wayland-1.17.0.tar.xz’ --progress=dot -v failed with exit code 4, output:
–2024-01-30 03:15:48-- https://wayland.freedesktop.org/releases/wayland-1.17.0.tar.xz
Connecting to 127.0.0.1:7890… failed: Connection refused.
ERROR: wayland-native-1.17.0-r0 do_fetch: Fetcher failure for URL: ‘https://wayland.freedesktop.org/releases/wayland-1.17.0.tar.xz’. Unable to fetch URL from any source.
ERROR: wayland-native-1.17.0-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/temp/log.do_fetch.12853
ERROR: Task (virtual:native:/home/hh/MYIR-Yocto-i.MX8MM/sources/meta-myir/meta-myir-bsp/recipes-graphics/wayland/wayland_1.17.0.bb:do_fetch) failed with exit code ‘1’
解决:
downloads 目录下面只有 wayland-1.16.0.tar.xz ,所有我自己去下载 1.17的版本放进去即可。
手动下载源代码包: 手动从浏览器或其他工具中下载 wayland-1.17.0.tar.xz,并将其放置在 Yocto 项目的 downloads 目录中。
6 cross-localedef-native
ERROR: cross-localedef-native-2.27-r0 do_compile: oe_runmake failed
ERROR: cross-localedef-native-2.27-r0 do_compile: Function failed: do_compile (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-localedef-native/2.27-r0/temp/log.do_compile.12121)
ERROR: Logfile of failure stored in: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-localedef-native/2.27-r0/temp/log.do_compile.12121
Log data follows:
| DEBUG: SITE files [‘endian-little’, ‘common-linux’, ‘common-glibc’, ‘bit-64’, ‘x86_64-linux’, ‘common’]
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4
| gcc -isystem/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-telephone.o ld-time.o linereader.o localedef.o locarchive.o locfile.o record-status.o repertoire.o
…
…
parse.o argp-pv.o argp-xinl.o error.o getopt.o getopt1.o md5.o obstack.o asprintf.o getdelim.o localedef_extra.o obstack_printf.o vasprintf.o
| argp-fmtstream.o: In function_argp_fmtstream_update': | argp-fmtstream.c:(.text+0x231): undefined reference to
_IO_fwide’
| argp-fmtstream.c:(.text+0x3e6): undefined reference to_IO_fwide' | argp-help.o: In function
argp_failure’:
| argp-help.c:(.text+0x2123): undefined reference to `_IO_fwide’
| collect2: error: ld returned 1 exit status
| ERROR: oe_runmake failed
| Makefile:60: recipe for target ‘localedef’ failed
| make: *** [localedef] Error 1
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-localedef-native/2.27-r0/temp/log.do_compile.12121)
ERROR: Task (/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 817 tasks of which 730 didn’t need to be rerun and 1 failed.
解决:
在文件 cross-localedef-native_2.27.bb 里面添加 -D_IO_fwide=fwide。
CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0' -D_IO_fwide=fwide"
7 wayland-protocols
ERROR: wayland-protocols-1.17.imx-r0 do_fetch: Fetcher failure: Fetch
command export PSEUDO_DISABLED=1; export
DBUS_SESSION_BUS_ADDRESS=“unix:path=/run/user/1000/bus,guid=c5a2e3679a31b7ffd15fafb165b85632”; export SSH_AGENT_PID=“1307”; export
SSH_AUTH_SOCK=“/run/user/1000/keyring/ssh”; export
ALL_PROXY=“socks5://172.16.112.237:1090”; export
https_proxy=“http://127.0.0.1:7890”; export
http_proxy=“http://127.0.0.1:7890”; export
PATH=“/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/scripts:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/usr/bin/allarch-poky-linux:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot/usr/bin/crossscripts:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/usr/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/usr/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/bin:/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/bitbake/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/hosttools”;
export HOME=“/home/hh”; LANG=C git -c core.fsyncobjectfiles=0 fetch -f
–prune --progress https://source.codeaurora.org/external/imx/wayland-protocols-imx.git
refs/:refs/ failed with exit code 128, output: fatal: unable to
access
‘https://source.codeaurora.org/external/imx/wayland-protocols-imx.git/’:
Failed to connect to 127.0.0.1 port 7890: Connection refused ERROR:
wayland-protocols-1.17.imx-r0 do_fetch: Fetcher failure for URL:
‘git://source.codeaurora.org/external/imx/wayland-protocols-imx.git;protocol=https;branch=wayland-protocols-imx-1.17’.
Unable to fetch URL from any source. ERROR:
wayland-protocols-1.17.imx-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in:
/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/temp/log.do_fetch.20943
ERROR: Task
(/home/hh/MYIR-Yocto-i.MX8MM/sources/meta-myir/meta-myir-bsp/recipes-graphics/wayland/wayland-protocols_1.17.imx.bb:do_fetch)
failed with exit code ‘1’
解决:
主要是 https://source.codeaurora.org/external/imx/wayland-protocols-imx.git 这个网站进不去了屏蔽这个网站下载及去github下载,并将其放置在 Yocto 项目的 downloads 目录中即可。
过程:
使用grep 查看 source.codeaurora.org 在哪些文件,只修改有错误的文件。
删除后面部分即可。
从github下载
https://github.com/nxp-imx/wayland-protocols-imx
或者
https://coral.googlesource.com/wayland-protocols-imx/
或者官网下载
https://wayland.freedesktop.org/releases.html
下载下来应该是zip格式,解压缩后面,重新压缩为wayland-protocols-imx-1.17.tar.xz,并将其放置在 Yocto 项目的 downloads 目录中。
8 mesa
ERROR: mesa-2_17.3.8-r0 do_configure: configure failed
ERROR: mesa-2_17.3.8-r0 do_configure: Function failed: do_configure (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/temp/log.do_configure.26972)
ERROR: Logfile of failure stored in: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/temp/log.do_configure.26972
Log data follows:
| DEBUG: SITE files [‘endian-little’, ‘bit-64’, ‘arm-common’, ‘arm-64’, ‘common-linux’, ‘common-glibc’, ‘aarch64-linux’, ‘common’]
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_aclocals
| DEBUG: SITE files [‘endian-little’, ‘bit-64’, ‘arm-common’, ‘arm-64’, ‘common-linux’, ‘common-glibc’, ‘aarch64-linux’, ‘common’]
| DEBUG: Python function autotools_aclocals finished
| DEBUG: Executing shell function do_configure
| automake (GNU automake) 1.15.1
…
…
| checking for PTHREAD_PRIO_INHERIT… yes
| checking for libelf… no
| checking for elf_memory in -lelf… no
| …/mesa-17.3.8/configure: line 22925: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| …/mesa-17.3.8/configure: line 22908: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| …/mesa-17.3.8/configure: line 22927: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| …/mesa-17.3.8/configure: line 22928: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| checking for libdrm >= 2.4.75… yes
| checking for glproto >= 1.4.14… yes
| checking for dri2proto >= 2.8… yes
| checking for xxf86vm… yes
| checking for x11 xext xdamage >= 1.1 xfixes x11-xcb xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8 xxf86vm… yes
| checking for wayland-scanner… /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/wayland-scanner
| checking for wayland-client >= 1.11… yes
| checking for wayland-server >= 1.11… yes
| configure: error: wayland-protocols >= 1.8 is needed to compile the wayland platform
| NOTE: The following config.log files may provide further information.
| NOTE: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/temp/log.do_configure.9383)
ERROR: Task (/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb:do_configure) failed with exit code ‘1’
https://archive.mesa3d.org//older-versions/17.x/
sudo apt-get install libelf-dev