赞
踩
硬件平台:高通8155
软件平台:yocoto linux + ubuntu16.04
最近开始接触8155平台,发现编译阶段出现cmake编译失败,网上搜了一下没有相关的解决方案,因此自己研究了下并记录一下,方便有需要的同行快速解决。
问题描述:
- | [ 93%] Building CXX object Source/CMakeFiles/CTestLib.dir/LexerParser/cmCTestResourceGroupsLexer.cxx.o
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/g++ -DLIBARCHIVE_STATIC -I/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Utilities -I/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source -I/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Source -I/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Source/LexerParser -I/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Source/CTest -I/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Source/CPack -isystem /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Utilities/std -isystem /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Utilities -isystem/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/recipe-sysroot-native/usr/include -O2 -pipe -O3 -DNDEBUG -std=c++14 -o CMakeFiles/CTestLib.dir/LexerParser/cmCTestResourceGroupsLexer.cxx.o -c /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/cmake-3.19.5/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
- | [ 93%] Linking CXX static library libCPackLib.a
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Bootstrap.cmk/cmake -P CMakeFiles/CPackLib.dir/cmake_clean_target.cmake
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/CPackLib.dir/link.txt --verbose=1
- | /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/ar qc libCPackLib.a CMakeFiles/CPackLib.dir/CPack/cmCPackArchiveGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackComponentGroup.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackDebGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackExternalGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackGeneratorFactory.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackLog.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackNSISGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackNuGetGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackSTGZGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/IFW/cmCPackIFWCommon.cxx.o CMakeFiles/CPackLib.dir/CPack/IFW/cmCPackIFWGenerator.cxx.o CMakeFiles/CPackLib.dir/CPack/IFW/cmCPackIFWInstaller.cxx.o CMakeFiles/CPackLib.dir/CPack/IFW/cmCPackIFWPackage.cxx.o CMakeFiles/CPackLib.dir/CPack/IFW/cmCPackIFWRepository.cxx.o CMakeFiles/CPackLib.dir/CPack/cmCPackRPMGenerator.cxx.o
- | /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/ranlib libCPackLib.a
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_read_support_filter_zstd.c.o): In function `zstd_filter_close':
- | archive_read_support_filter_zstd.c:(.text+0x9): undefined reference to `ZSTD_freeDStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_read_support_filter_zstd.c.o): In function `zstd_bidder_init':
- | archive_read_support_filter_zstd.c:(.text+0x3e): undefined reference to `ZSTD_DStreamOutSize'
- | archive_read_support_filter_zstd.c:(.text+0x72): undefined reference to `ZSTD_createDStream'
- | archive_read_support_filter_zstd.c:(.text+0xe5): undefined reference to `ZSTD_freeDStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_read_support_filter_zstd.c.o): In function `zstd_filter_read':
- | archive_read_support_filter_zstd.c:(.text+0x207): undefined reference to `ZSTD_decompressStream'
- | archive_read_support_filter_zstd.c:(.text+0x253): undefined reference to `ZSTD_initDStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_free':
- | archive_write_add_filter_zstd.c:(.text+0x12): undefined reference to `ZSTD_freeCStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_open':
- | archive_write_add_filter_zstd.c:(.text+0xc1): undefined reference to `ZSTD_initCStream'
- | archive_write_add_filter_zstd.c:(.text+0xe1): undefined reference to `ZSTD_CStreamOutSize'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_write':
- | archive_write_add_filter_zstd.c:(.text+0x1d7): undefined reference to `ZSTD_compressStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_close':
- | archive_write_add_filter_zstd.c:(.text+0x298): undefined reference to `ZSTD_endStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_write_add_filter_zstd':
- | archive_write_add_filter_zstd.c:(.text+0x3ac): undefined reference to `ZSTD_createCStream'
- | collect2: error: ld returned 1 exit status
- | Source/CursesDialog/CMakeFiles/ccmake.dir/build.make:315: recipe for target 'bin/ccmake' failed
- | make[2]: *** [bin/ccmake] Error 1
- | make[2]: Leaving directory '/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build'
- | CMakeFiles/Makefile2:2176: recipe for target 'Source/CursesDialog/CMakeFiles/ccmake.dir/all' failed
- | make[1]: *** [Source/CursesDialog/CMakeFiles/ccmake.dir/all] Error 2
- | make[2]: Leaving directory '/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build'
- | [ 93%] Built target CPackLib
- | [ 93%] Linking CXX static library libCMakeServerLib.a
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Bootstrap.cmk/cmake -P CMakeFiles/CMakeServerLib.dir/cmake_clean_target.cmake
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/CMakeServerLib.dir/link.txt --verbose=1
- | /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/ar qc libCMakeServerLib.a CMakeFiles/CMakeServerLib.dir/cmConnection.cxx.o CMakeFiles/CMakeServerLib.dir/cmFileMonitor.cxx.o CMakeFiles/CMakeServerLib.dir/cmJsonObjects.cxx.o CMakeFiles/CMakeServerLib.dir/cmPipeConnection.cxx.o CMakeFiles/CMakeServerLib.dir/cmServer.cxx.o CMakeFiles/CMakeServerLib.dir/cmServerConnection.cxx.o CMakeFiles/CMakeServerLib.dir/cmServerProtocol.cxx.o
- | /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/ranlib libCMakeServerLib.a
- | make[2]: Leaving directory '/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build'
- | [ 93%] Built target CMakeServerLib
- | [ 93%] Linking CXX static library libCTestLib.a
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Bootstrap.cmk/cmake -P CMakeFiles/CTestLib.dir/cmake_clean_target.cmake
- | cd /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Source && /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/CTestLib.dir/link.txt --verbose=1
- | /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/ar qc libCTestLib.a CMakeFiles/CTestLib.dir/cmCTest.cxx.o CMakeFiles/CTestLib.dir/CTest/cmProcess.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestBinPacker.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestBuildAndTestHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestBuildCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestBuildHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestConfigureCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestConfigureHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestCoverageCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestCoverageHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestCurl.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseMumpsCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseCacheCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseGTMCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseJacocoCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseBlanketJSCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParsePHPCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseCoberturaCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmParseDelphiCoverage.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestGenericHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestHandlerCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestResourceAllocator.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestResourceSpec.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestLaunch.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestLaunchReporter.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestMemCheckCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestMemCheckHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestMultiProcessHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestReadCustomFilesCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestResourceGroupsLexerHelper.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestRunScriptCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestRunTest.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestScriptHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestSleepCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestStartCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestSubmitCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestSubmitHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestTestCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestTestHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestUpdateCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestUpdateHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestUploadCommand.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestUploadHandler.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestVC.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestGlobalVC.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestCVS.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestSVN.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestBZR.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestGIT.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestHG.cxx.o CMakeFiles/CTestLib.dir/CTest/cmCTestP4.cxx.o CMakeFiles/CTestLib.dir/LexerParser/cmCTestResourceGroupsLexer.cxx.o
- | /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/hosttools/ranlib libCTestLib.a
- | make[2]: Leaving directory '/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build'
- | [ 93%] Built target CTestLib
- | make[1]: Leaving directory '/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/build'
- | Makefile:184: recipe for target 'all' failed
- | make: *** [all] Error 2
- | WARNING: /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.19.5-r0/temp/run.do_compile.3918:1 exit 1 from 'exit 1'
- |
- ERROR: Task (/home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/meta/recipes-devtools/cmake/cmake-native_3.19.5.bb:do_compile) failed with exit code '1'
- NOTE: Tasks Summary: Attempted 5070 tasks of which 4104 didn't need to be rerun and 1 failed.
- NOTE: Writing buildhistory
- NOTE: Writing buildhistory took: 4 seconds
- Summary: 1 task failed:
- /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/meta/recipes-devtools/cmake/cmake-native_3.19.5.bb:do_compile
- Summary: There were 116 WARNING messages shown.
- Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
- /home/CN/yongfeng.liu/SA8155_LV_1_0_v2/apps/apps_proc/poky/build
- ==== Error run 'cdbitbake machine-image'. (build-sa8155agl-perf-image)
查看以上log信息,发现是因为zstd头文件出行未定义错误:
- | archive_read_support_filter_zstd.c:(.text+0x9): undefined reference to `ZSTD_freeDStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_read_support_filter_zstd.c.o): In function `zstd_bidder_init':
- | archive_read_support_filter_zstd.c:(.text+0x3e): undefined reference to `ZSTD_DStreamOutSize'
- | archive_read_support_filter_zstd.c:(.text+0x72): undefined reference to `ZSTD_createDStream'
- | archive_read_support_filter_zstd.c:(.text+0xe5): undefined reference to `ZSTD_freeDStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_read_support_filter_zstd.c.o): In function `zstd_filter_read':
- | archive_read_support_filter_zstd.c:(.text+0x207): undefined reference to `ZSTD_decompressStream'
- | archive_read_support_filter_zstd.c:(.text+0x253): undefined reference to `ZSTD_initDStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_free':
- | archive_write_add_filter_zstd.c:(.text+0x12): undefined reference to `ZSTD_freeCStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_open':
- | archive_write_add_filter_zstd.c:(.text+0xc1): undefined reference to `ZSTD_initCStream'
- | archive_write_add_filter_zstd.c:(.text+0xe1): undefined reference to `ZSTD_CStreamOutSize'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_write':
- | archive_write_add_filter_zstd.c:(.text+0x1d7): undefined reference to `ZSTD_compressStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_compressor_zstd_close':
- | archive_write_add_filter_zstd.c:(.text+0x298): undefined reference to `ZSTD_endStream'
- | ../../Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_write_add_filter_zstd.c.o): In function `archive_write_add_filter_zstd':
- | archive_write_add_filter_zstd.c:(.text+0x3ac): undefined reference to `ZSTD_createCStream'
在yocto系统中,编译时会先下载cmake源码,然后配置,最后编译。
查看cmake的源码和配置方法,发现CMAKE_USE_SYSTEM_ZSTD:BOOL=NO,表示cmake编译会采用系统的zstd,改为OFF之后可以编译通过。
- ~/SA8155_LV_1_0_v2/apps/apps_proc/poky/build/tmp-glibc/work/x86_64-linux/cmake-native/3.16.5-r0$ vim build/CMakeCache.txt +297
-
- //Use system-installed zstd
- CMAKE_USE_SYSTEM_ZSTD:BOOL=OFF
是否可以通过配置来避免呢?查看cmake的配置信息:
- --system-zstd use system-installed zstd library
- --no-system-zstd use cmake-provided zstd library (default) --- 关键信息
- --system-libarchive use system-installed libarchive library
- --no-system-libarchive use cmake-provided libarchive library (default)
其中的--no-system-zstd use cmake-provided zstd library (default),正是我们要找的。那么如何修改呢?这里需要一点bitbake的基础知识,每个recipe中,可以找到*.bb文件,里面会定义配置阶段的操作,如下:
- apps/apps_proc/poky/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
-
- do_configure () {
- ${S}/configure --verbose --prefix=${prefix} --no-system-zstd \
- ${@oe.utils.parallel_make_argument(d, '--parallel=%d')} \
- ${@bb.utils.contains('CCACHE', 'ccache ', '--enable-ccache', '', d)} \
- -- ${CMAKE_EXTRACONF}
- }
-
- 这里增加了--no-system-zstd选项。
只需要在这里加上--no-system-zstd即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。