由于GCC 7,Yocto for Nvidia Jetson失败-无法计算目标文件的后缀 [英] Yocto for Nvidia Jetson fails because of GCC 7 - cannot compute suffix of object files
问题描述
我正在尝试将Yocto与meta-tegra( https://github.com/madisongh/ meta-tegra )来为Nvidia Jetson Nano构建一个最小的系统。我需要在此平台上将CUDA(适用于Nano的当前版本10)与OpenCV一起使用。 CUDA 10仅支持GCC 7,不支持GCC8。已弃用GCC 7,并从OpenEmbedded Warrior版本中删除了它,以支持GCC 8.3。我的错误与尝试将GCC 7与战士的OE版本一起使用有关:配置:错误:无法计算目标文件的后缀:无法编译
I am trying to use Yocto with meta-tegra ( https://github.com/madisongh/meta-tegra ) to build a minimal system for the Nvidia Jetson Nano. I need to use CUDA ( current version 10 for Nano ) with OpenCV on this platform. CUDA 10 only support GCC 7, and not GCC 8. GCC 7 has be deprecated and removed from OpenEmbedded Warrior release in favor of GCC 8.3. My error has to do with trying to use GCC 7 with Warrior release of OE: configure: error: cannot compute suffix of object files: cannot compile
meta-tegra的自述文件指出以下内容:
The README for meta-tegra states the following:
* CUDA 10 supports up through gcc 7 only, and some NVIDIA-provided
binary libraries appear to be compiled with g++ 7 and cause linker
failures when building applications with g++ 6, so **only** gcc 7
should be used if you intend to use CUDA. (For Jetson-TK1, CUDA 6.5
supports up through gcc 5.x only.)
Selecting the toolchain version
-------------------------------
Toolchain version selection is usually a distro configuration setting,
but you can also set this in your build/conf/local.conf file. To use
gcc 7 instead of gcc 8, set:
GCCVERSION = "7.%"
but you will also need the gcc 7 toolchain recipes in one of your layers,
since it was retired from OE-Core in favor of gcc 8.
我在全新,全新的Ubuntu 16.04和Ubuntu 18.04上都尝试了以下脚本。两台机器都失败并出现相同的错误:
I have tried the following script on both a brand new, fresh, install of Ubuntu 16.04 and Ubuntu 18.04. Both machines failed with the same error:
# Get current directory
cwd=$PWD
# Yocto build script
cd ~/Desktop
rm -rf dev-jetson-yocto
mkdir -p dev-jetson-yocto/layers
cd dev-jetson-yocto/layers
git clone https://git.yoctoproject.org/git/poky -b warrior
git clone https://github.com/openembedded/meta-openembedded.git -b warrior
git clone https://github.com/meta-qt5/meta-qt5.git -b warrior
git clone https://github.com/madisongh/meta-tegra.git -b warrior
git clone https://git.linaro.org/openembedded/meta-linaro.git -b warrior
cd ../
. layers/poky/oe-init-build-env build
bitbake-layers add-layer ../layers/meta-openembedded/meta-oe
bitbake-layers add-layer ../layers/meta-openembedded/meta-multimedia
bitbake-layers add-layer ../layers/meta-openembedded/meta-python
bitbake-layers add-layer ../layers/meta-openembedded/meta-networking
bitbake-layers add-layer ../layers/meta-linaro/meta-linaro
bitbake-layers add-layer ../layers/meta-linaro/meta-linaro-toolchain
bitbake-layers add-layer ../layers/meta-linaro/meta-linaro-integration
bitbake-layers add-layer ../layers/meta-linaro/meta-aarch64
bitbake-layers add-layer ../layers/meta-tegra
bitbake-layers add-layer ../layers/meta-qt5
cp $cwd/local.conf conf/local.conf
mkdir -p downloads/sdkm_downloads
rsync -av --progress $cwd/nvidia-sources/* downloads/sdkm_downloads
echo 'NVIDIA_DEVNET_MIRROR = "file://sdkm_downloads"' >> conf/local.conf
MACHINE=jetson-nano bitbake core-image-full-cmdline
Local.conf与标称值的差异:
Local.conf deltas from nominal:
CONF_VERSION = "1"
IMAGE_CLASSES += "image_types_tegra"
IMAGE_FSTYPES = "tegraflash"
GCCVERSION = "linaro-7.2"
SDKGCCVERSION = "linaro-7.2"
NVIDIA_DEVNET_MIRROR = "file://sdkm_downloads"
错误:
| checking build system type... x86_64-pc-linux-gnu
| checking host system type... aarch64-poky-linux-gnu
| checking for --enable-version-specific-runtime-libs... no
| checking for a BSD-compatible install... /home/user/Desktop/dev-jetson-yocto/build/tmp/hosttools/install -c
| checking for gawk... gawk
| checking for aarch64-poky-linux-ar... aarch64-poky-linux-gcc-ar
| checking for aarch64-poky-linux-lipo... no
| checking for lipo... no
| checking for aarch64-poky-linux-nm... aarch64-poky-linux-nm
| checking for aarch64-poky-linux-ranlib... aarch64-poky-linux-gcc-ranlib
| checking for aarch64-poky-linux-strip... aarch64-poky-linux-strip
| checking whether ln -s works... yes
| checking for aarch64-poky-linux-gcc... aarch64-poky-linux-gcc -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/user/Desktop/dev-jetson-yocto/build/tmp/work/aarch64-poky-linux/libgcc-initial/linaro-7.2-r2017.11/recipe-sysroot
| checking for suffix of object files... configure: error: in `/home/user/Desktop/dev-jetson-yocto/build/tmp/work/aarch64-poky-linux/libgcc-initial/linaro-7.2-r2017.11/gcc-linaro-7.2-2017.11/build.aarch64-poky-linux.aarch64-poky-linux/libgcc':
| configure: error: cannot compute suffix of object files: cannot compile
| See `config.log' for more details.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/user/Desktop/dev-jetson-yocto/build/tmp/work/aarch64-poky-linux/libgcc-initial/linaro-7.2-r2017.11/temp/log.do_configure.17732)
ERROR: Task (/home/user/Desktop/dev-jetson-yocto/layers/meta-linaro/meta-linaro-toolchain/recipes-devtools/gcc/libgcc-initial_linaro-7.2.bb:do_configure) failed with exit code '1'
Waiting for 1 running tasks to finish:
0: qemu-native-3.1.0-r0 do_compile - 100
如何获取此文件?谢谢。
How can I get this to compile? Thanks.
推荐答案
我遇到了同样的问题,经过快速调查,我发现失败的原因是标志 -fmacro-debug-prefix
在gcc7中不存在。
I had the same problem and after a quick investigation I discovered that the reason of the failure is the flag -fmacro-debug-prefix
not present in gcc7.
它在 bitbake.conf中使用
由变量 DEBUG_PREFIX_MAP
设置,如果您将其设置为不包含 local.conf $ c $中的标志c>该问题将消失(也许其他问题会出现:P)。
It is used in bitbake.conf
by the variableDEBUG_PREFIX_MAP
, if you set it to not contain the flag in your local.conf
that problem will disappear (maybe others will appear:P).
我不是Yocto的专家,所以这样的改变可能会带来意想不到的副作用(可能是调试过程中的路径将被破坏)。
I'm not an expert of Yocto so maybe such change could have unexpected side effect (probably the path during debug will be screwed up).
这篇关于由于GCC 7,Yocto for Nvidia Jetson失败-无法计算目标文件的后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!