I am trying to build some native packages as 32bit in yocto (2.6.1 actually, on a 64bit linux). My target does not use multilib at all. Let's say I am building recipe a
which needs (all build-time, linking statically) package b
as well as zlib
and libcrypto
. I manage to build a and b as 32bit by simply adding -m32
to the gcc calls, and linking/running works fine. However, the build system does not know about it and puts everything under work/x86_64-linux
.
I have to use pre-build 32bit zlib and libcrypto libraries for this to work because yocto will of course try to give me the 64bit versions of zlib and libcrypto when I let it (DEPENDS_class-native = "b-native zlib-native openssl-native"
), resulting in a linker error. It would be nice to have yocto build them for me in the correct architecture.
I have experimented with TARGET_ARCH
and BUILD_ARCH
but it either does not change it to 32bit at all, or it gives an error that it does not find e.g. quilt
as 32bit (to apply patches, which could/should be done using 64bit quilt).
The specific errors are prepended by a lot of
WARNING: a-native-1_0.4-r0 do_prepare_recipe_sysroot:
Manifest /yoctoroot/work/sstate-control/manifest-i586-quilt-native.populate_sysroot
not found in i586 (variant '')?
....
WARNING: a-native-1_0.4-r0 do_prepare_recipe_sysroot:
Manifest /yoctoroot/work/sstate-control/manifest-i586-openssl-native.populate_sysroot
not found in i586 (variant '')?
....
ERROR: a-native-1_0.4-r0 do_patch:
Command Error: 'quilt --quiltrc /yoctoroot/work/i586-linux/a-native/1_0.4-r0/recipe-sysroot-native/etc/quiltrc push'
exited with 0 Output: /bin/sh: quilt: command not found
ERROR: a-native-1_0.4-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: ...
when I add
BUILD_ARCH_native = "i586"
BUILD_ARCH_class-native = "i586"
TARGET_ARCH_native = "x86"
TARGET_ARCH_class-native = "x86"
to the a and b recpies.
The packages a and b are not native-only, they are also built for the target and use BBCLASSEXTEND = "native"
to enable native builds; a solution should ideally not break the target builds and not all other native stuff in the ecosystem.
The reason why I want them 32bit at all is that the packages a and b do intermixed pointer/integer arithmetic which breaks when the sizes of these datatypes do not match; I would appreciate if I would not have to change these sources. Am I asking too much?
Thanks in advance for any thoughts and directions!