[yocto] Using extensible SDK with multilib
baisch at tau-tec.com
baisch at tau-tec.com
Fri Aug 9 10:35:05 PDT 2019
Hello everyone,
Short version:
I have an 64 bit Yocto Raspberry build with a piece of 32 bit software with
multilib. The goal is now to be able to use the eSDK to build 32 bit
software for that system. After building and installing the eSDK there are
even two files environment-setup-aarch64-poky-linux and
environment-setup-armv7ve-vfp-pokymllib32-linux-gnueabi. After sourcing the
32bit armv7ve environment file, devtool is still building my software as 64
bit. Why doesn't it work?
Long version:
The multilib definition in my local config looks like this:
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "armv7ve"
IMAGE_INSTALL_append_raspberrypi3-64 = " lib32-software-dummy"
The software-dummy "hello world" project builds fine in 32 bit.
Now on to the eSDK: The
environment-setup-armv7ve-vfp-pokymllib32-linux-gnueabi actually didn't work
out of the box, I needed to add the bottom of
environment-setup-aarch64-poky-linux to
environment-setup-armv7ve-vfp-pokymllib32-linux-gnueabi, so devtool is
found.
This part was missing from the armv7ve environment file:
. /workdir/sdk/rpi/buildtools/environment-setup*
export OE_SKIP_SDK_CHECK=1
export DEPLOY_DIR_IMAGE=/workdir/sdk/rpi/tmp/deploy/images/raspberrypi3-64
export PATH=/workdir/sdk/rpi/sysroots/x86_64-pokysdk-linux/usr/bin:$PATH
printf 'SDK environment now set up; additionally you may now run devtool to
perform development tasks.
Run devtool --help for further details.
'
(which bitbake > /dev/null 2>&1 && echo 'WARNING: attempting to use the
extensible SDK in an environment set up to run bitbake - this may lead to
unexpected results. Please source this script in a new shell session
instead.') || true
Another thing I noticed that SDKTARGETSYSROOT in both files point to
/workdir/sdk/rpi/tmp/sysroots/raspberrypi3-64 which is maybe not correct.
Also not very sure about DEPLOY_DIR_IMAGE.
Eg. in environment-setup-aarch64-poky-linux we have:
export CC="aarch64-poky-linux-gcc --sysroot=$SDKTARGETSYSROOT"
export CXX="aarch64-poky-linux-g++ --sysroot=$SDKTARGETSYSROOT"
…
export ARCH=arm64
export CROSS_COMPILE=aarch64-poky-linux-
while in environment-setup-armv7ve-vfp-pokymllib32-linux-gnueabi:
export CC="arm-pokymllib32-linux-gnueabi-gcc -march=armv7ve -mfpu=vfp
-mfloat-abi=softfp --sysroot=$SDKTARGETSYSROOT"
export CXX="arm-pokymllib32-linux-gnueabi-g++ -march=armv7ve -mfpu=vfp
-mfloat-abi=softfp --sysroot=$SDKTARGETSYSROOT"
…
export ARCH=arm
export CROSS_COMPILE=arm-pokymllib32-linux-gnueabi-
After sourcing the armv7ve environment file, building the software I added
with devtool, it's still building in 64 bit. Looking at the run.do_install
logfile I see this:
export AR="aarch64-poky-linux-ar"
export AS="aarch64-poky-linux-as "
…
export CC="aarch64-poky-linux-gcc -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
--sysroot=/workdir/sdk/rpi/tmp/work/aarch64-poky-linux/cmake-test/1.0-r0/recipe-sysroot"
…
export CCLD="aarch64-poky-linux-gcc -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security
--sysroot=/workdir/sdk/rpi/tmp/work/aarch64-poky-linux/cmake-test/1.0-r0/recipe-sysroot"
for some reason it's all 64 bit in there and I don't know where this comes
from. The armv7ve environment file also has
/workdir/sdk/rpi/tmp/sysroots/x86_64/usr/bin/arm-pokymllib32-linux-gnueabi
in it's PATH, where the 32 bit compilers seem to live.
The only way I found to build my software is to build a little script that
calls bitbake directly or to add IMAGE_INSTALL_append_raspberrypi3-64 = "
lib32-cmake-test" to the local.config and build the image with devtool. Both
are not nice solutions.
Thank you for any help!
Regards,
- Michael
--
More information about the yocto
mailing list