linux 由于愚者7,用于Nvidia Jetson的Yocto失败-无法计算目标文件的后缀

nzkunb0c  于 2022-12-03  发布在  Linux
关注(0)|答案(1)|浏览(101)

我正在尝试使用Yocto和Meta-tegra(https://github.com/madisongh/meta-tegra)为Nvidia Jetson Nano构建最小系统。我需要使用CUDA(当前Nano版本10)。CUDA 10仅支持GCC 7,而不是愚者8。愚者7已被弃用并从OpenEmbedded Warrior发行版中删除,以支持愚者8.3。我的错误与尝试使用愚者7和Warrior OE版本有关:配置:错误:无法计算对象文件的后缀:无法编译
meta-tegra的自述文件说明如下:

* 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上尝试了以下脚本。两台机器都失败了,并出现了相同的错误:

# 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

本地.conf与标称值的差值:

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

我怎样才能让它编译?

kwvwclae

kwvwclae1#

我遇到了同样的问题,经过快速调查,我发现失败的原因是gcc7中不存在的标志-fmacro-debug-prefix
它在bitbake.conf中由变量DEBUG_PREFIX_MAP使用,如果您将其设置为不包含local.conf中的标志,则该问题将消失(可能会出现其他问题:P)。
我不是Yocto的Maven,所以这样的改变可能会有意想不到的副作用(可能调试过程中的路径会被搞砸)。

相关问题