Hi @henrique.tx !
Thank you very much for your interest and for your time to try to replicate this issue. In response to your questions:
- I am using BSP 5.4 with Yocto 3.1 dunfell.
- On my host computer I am using 20.04.1-Ubuntu.
- When copying and pasting a space character has slipped into me. The correct thing would be aarch64-tdx-linux-g ++.
I understand that you have been able to generate the binary of the hello world example. You could take a look at the run.do_compile file and see if you find any difference from the one I copy below.
#!/bin/sh
# Emit a useful diagnostic if something fails:
bb_exit_handler() {
ret=$?
case $ret in
0) ;;
*) case $BASH_VERSION in
"") echo "WARNING: exit code $ret from a shell command.";;
*) echo "WARNING: ${BASH_SOURCE[0]}:${BASH_LINENO[0]} exit $ret from '$BASH_COMMAND'";;
esac
exit $ret
esac
}
trap 'bb_exit_handler' 0
set -e
export AR="aarch64-tdx-linux-gcc-ar"
export AS="aarch64-tdx-linux-as "
export BUILD_AR="ar"
export BUILD_AS="as "
export BUILD_CC="gcc "
export BUILD_CCLD="gcc "
export BUILD_CFLAGS="-isystem/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/include -O2 -pipe"
export BUILD_CPP="gcc -E"
export BUILD_CPPFLAGS="-isystem/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/include"
export BUILD_CXX="g++ "
export BUILD_CXXFLAGS="-isystem/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/include -O2 -pipe"
export BUILD_FC="gfortran "
export BUILD_LD="ld "
export BUILD_LDFLAGS="-L/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/lib -L/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/lib -Wl,--enable-new-dtags -Wl,-rpath-link,/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/lib -Wl,-rpath,/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/cocinero/oe-core/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2"
export BUILD_NM="nm"
export BUILD_RANLIB="ranlib"
export BUILD_STRIP="strip"
export CC="aarch64-tdx-linux-gcc -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot"
export CCLD="aarch64-tdx-linux-gcc -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0=/usr/src/debug/hello-world/1.0.0-r0 -fdebug-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0=/usr/src/debug/hello-world/1.0.0-r0 -fdebug-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native= "
export CPP="aarch64-tdx-linux-gcc -E --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security"
export CPPFLAGS=""
export CXX="aarch64-tdx-linux-g++ -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0=/usr/src/debug/hello-world/1.0.0-r0 -fdebug-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0=/usr/src/debug/hello-world/1.0.0-r0 -fdebug-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native= -fvisibility-inlines-hidden"
unset DISTRO
export FC="aarch64-tdx-linux-gfortran -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot"
export GIT_CEILING_DIRECTORIES="/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0"
export HOME="/home/cocinero"
export LC_ALL="en_US.UTF-8"
export LD="aarch64-tdx-linux-ld --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot "
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now"
export LOGNAME="cocinero"
unset MACHINE
export MAKE="make"
export NM="aarch64-tdx-linux-nm"
export OBJCOPY="aarch64-tdx-linux-objcopy"
export OBJDUMP="aarch64-tdx-linux-objdump"
export PATH="/home/cocinero/oe-core/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/cocinero/oe-core/layers/openembedded-core/scripts:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/bin/aarch64-tdx-linux:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot/usr/bin/crossscripts:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/sbin:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/usr/bin:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/sbin:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot-native/bin:/home/cocinero/oe-core/layers/openembedded-core/bitbake/bin:/home/cocinero/oe-core/build/tmp/hosttools"
export PERL_HASH_SEED="0"
export PKG_CONFIG_DIR="/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot/usr/lib/pkgconfig"
export PKG_CONFIG_DISABLE_UNINSTALLED="yes"
export PKG_CONFIG_LIBDIR="/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot/usr/lib/pkgconfig"
export PKG_CONFIG_PATH="/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot/usr/lib/pkgconfig:/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot/usr/share/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot"
export PKG_CONFIG_SYSTEM_INCLUDE_PATH="/usr/include"
export PKG_CONFIG_SYSTEM_LIBRARY_PATH="/lib:/usr/lib"
export PSEUDO_DISABLED="1"
export PSEUDO_UNLOAD="1"
export PYTHONHASHSEED="0"
export RANLIB="aarch64-tdx-linux-gcc-ranlib"
export READELF="aarch64-tdx-linux-readelf"
unset SHELL
export SOURCE_DATE_EPOCH="1302044400"
export SOURCE_DATE_EPOCH_FALLBACK="1302044400"
export STRINGS="aarch64-tdx-linux-strings"
export STRIP="aarch64-tdx-linux-strip"
unset TARGET_ARCH
export TERM="screen-256color"
export TZ="UTC"
export USER="cocinero"
export base_bindir="/bin"
export base_libdir="/lib"
export base_prefix=""
export base_sbindir="/sbin"
export bindir="/usr/bin"
export datadir="/usr/share"
export docdir="/usr/share/doc"
export exec_prefix="/usr"
export includedir="/usr/include"
export infodir="/usr/share/info"
export libdir="/usr/lib"
export libexecdir="/usr/libexec"
export localstatedir="/var"
export mandir="/usr/share/man"
export nonarch_base_libdir="/lib"
export nonarch_libdir="/usr/lib"
export oldincludedir="/usr/include"
export prefix="/usr"
export sbindir="/usr/sbin"
export servicedir="/srv"
export sharedstatedir="/com"
export sysconfdir="/etc"
export systemd_system_unitdir="/lib/systemd/system"
export systemd_unitdir="/lib/systemd"
export systemd_user_unitdir="/usr/lib/systemd/user"
do_compile() {
aarch64-tdx-linux-g++ -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0/recipe-sysroot -O hello-world.cpp -o hello-world
}
cd '/home/cocinero/oe-core/build/tmp/work/aarch64-tdx-linux/hello-world/1.0.0-r0'
do_compile
# cleanup
ret=$?
trap '' 0
exit $ret
The only thing that occurs to me is that this automatically generated file is being generated incorrectly or some environment variable is missing a path to the compiler.
Best regards,