Build Failed - OpenCV

I met an error on the compile step while I built an OpenCV.

nicolas@nicolas-14U530-MFLGL:~/ose/build-webos$ bitbake opencv
Loading cache: 100% |####################################################| Time: 0:00:01
Loaded 3627 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.40.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-14.04"
TARGET_SYS           = "arm-webos-linux-gnueabi"
MACHINE              = "raspberrypi4"
DISTRO               = "webos"
DISTRO_VERSION       = "2.4.g"
TUNE_FEATURES        = "arm armv7ve vfp thumb neon vfpv4 callconvention-hard cortexa7"
TARGET_FPU           = "hard"
WEBOS_DISTRO_RELEASE_CODENAME = "webos-master"
WEBOS_DISTRO_BUILD_ID = "unofficial"
WEBOS_DISTRO_TOPDIR_REVISION = "199e974a41cea43516572320d32eac3d6df4df79"
WEBOS_DISTRO_TOPDIR_DESCRIBE = "v2.4.0"
DATETIME             = "20200417012325"
meta-security        = "thud:31dc4e7532fa7a82060e0b50e5eb8d0414aa7e93"
meta-webos-smack     
meta-webos-virtualization 
meta-webos-updater   
meta-webos-raspberrypi = "master:66608405f7ffbe711cd4edc16d38e06611ec1bc8"
meta-raspberrypi     = "thud:4e5be97d75668804694412f9b86e9291edb38b9d"
meta-webos           
meta-webos-backports-3.1 
meta-webos-backports-3.0 
meta-webos-backports-2.7 = "master:66608405f7ffbe711cd4edc16d38e06611ec1bc8"
meta-qt5             = "warrior:20331bd6b696793a7aa23a3c035e5ebcf3075aa3"
meta-virtualization  = "thud:7685c7d415e0002c448007960837ae8898cd57a5"
meta-updater         = "thud:544eecf0f74c708f531328116bcff4386fb3906f"
meta-filesystems     
meta-python          
meta-networking      
meta-multimedia      
meta-oe              = "thud:446bd615fd7cb9bc7a159fe5c2019ed08d1a7a93"
meta                 = "thud:e68991ceb5933f7d03b96697e8a0ba0829feb320"

Initialising tasks: 100% |###############################################| Time: 0:00:02
Sstate summary: Wanted 898 Found 0 Missed 898 Current 74 (0% match, 7% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: mesa-native-2_19.1.1-r0 do_compile: Function failed: do_compile (log file is located at /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/temp/log.do_compile.1491)
ERROR: Logfile of failure stored in: /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/temp/log.do_compile.1491
Log data follows:
| DEBUG: Executing shell function do_compile
| [1/34] /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/bin/python3-native/python3 ../mesa-19.1.1/bin/git_sha1_gen.py --output src/git_sha1.h
| [2/23] g++   -o src/mesa/drivers/dri/libmesa_dri_drivers.so  -L/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib -L/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/lib -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libmesa_dri_drivers.so -Wl,--whole-archive src/mesa/drivers/dri/swrast/libswrast_dri.a -Wl,--no-whole-archive -Wl,-rpath-link,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/lib -Wl,-O1 src/mesa/drivers/dri/common/libmegadriver_stub.a src/mesa/drivers/dri/common/libdricommon.a src/util/libxmlconfig.a src/util/libmesa_util.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/mesa/libmesa_classic.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/mesa/libmesa_sse41.a -Wl,--build-id=sha1 -Wl,-Bsymbolic -Wl,--gc-sections /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib/libdrm.so /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib/libexpat.so -lm -ldl -lm /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib/libz.so -lm -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi:$ORIGIN/../../../../../recipe-sysroot-native/usr/lib' -Wl,-rpath-link,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/build/src/mapi/shared-glapi:/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib
| FAILED: src/mesa/drivers/dri/libmesa_dri_drivers.so
| g++   -o src/mesa/drivers/dri/libmesa_dri_drivers.so  -L/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib -L/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/lib -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libmesa_dri_drivers.so -Wl,--whole-archive src/mesa/drivers/dri/swrast/libswrast_dri.a -Wl,--no-whole-archive -Wl,-rpath-link,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/lib -Wl,-O1 src/mesa/drivers/dri/common/libmegadriver_stub.a src/mesa/drivers/dri/common/libdricommon.a src/util/libxmlconfig.a src/util/libmesa_util.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/mesa/libmesa_classic.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/mesa/libmesa_sse41.a -Wl,--build-id=sha1 -Wl,-Bsymbolic -Wl,--gc-sections /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib/libdrm.so /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib/libexpat.so -lm -ldl -lm /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib/libz.so -lm -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi:$ORIGIN/../../../../../recipe-sysroot-native/usr/lib' -Wl,-rpath-link,/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/build/src/mapi/shared-glapi:/home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/recipe-sysroot-native/usr/lib/pkgconfig/../../../usr/lib
| src/mesa/drivers/dri/common/libmegadriver_stub.a(megadriver_stub.c.o): In function `megadriver_stub_init':
| megadriver_stub.c:(.text.startup+0x13): undefined reference to `dladdr'
| megadriver_stub.c:(.text.startup+0xb6): undefined reference to `dlsym'
| src/util/libmesa_util.a(crc32.c.o): In function `util_hash_crc32':
| crc32.c:(.text+0x45): undefined reference to `crc32'
| src/util/libmesa_util.a(disk_cache.c.o): In function `deflate_and_write_to_disk.isra.6':
| disk_cache.c:(.text+0x65a): undefined reference to `deflateInit_'
| disk_cache.c:(.text+0x6b4): undefined reference to `deflate'
| disk_cache.c:(.text+0x6e1): undefined reference to `deflateEnd'
| disk_cache.c:(.text+0x72c): undefined reference to `deflateEnd'
| src/util/libmesa_util.a(disk_cache.c.o): In function `disk_cache_get':
| disk_cache.c:(.text+0x1472): undefined reference to `inflateInit_'
| disk_cache.c:(.text+0x14e0): undefined reference to `inflate'
| disk_cache.c:(.text+0x14fd): undefined reference to `inflateEnd'
| disk_cache.c:(.text+0x1555): undefined reference to `inflateEnd'
| collect2: error: ld returned 1 exit status
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/nicolas/ose/build-webos/BUILD/work/x86_64-linux/mesa-native/2_19.1.1-r0/temp/log.do_compile.1491)
ERROR: Task (virtual:native:/home/nicolas/ose/build-webos/meta-webosose/meta-webos-backports/meta-webos-backports-3.0/recipes-graphics/mesa/mesa_19.1.1.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 632 tasks of which 631 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory

Summary: 1 task failed:
  virtual:native:/home/nicolas/ose/build-webos/meta-webosose/meta-webos-backports/meta-webos-backports-3.0/recipes-graphics/mesa/mesa_19.1.1.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

But, I don't know what is the problem. Could someone help me? Please, Give me a little advise on this error.

Try with Ubuntu 18.04 host.

1 Like

Thanks. I think it is good advice to me.
I will try it on 18.04 environment.

I succeeded to build the openCV, thanks.