The background is we used extended buildtools SDK to provide gcc and other
build tools on host for a Yocto build, but recipes that uses gcc-multilib
and glibc-multilib on host will fail with extended buildtools. For example,
lib32-luajit fails with extended buildtools.

With a simple search, we have enabled multilib for target gcc [1][2]

$ cat << ENDOF > main.c
#include <stdio.h>
int main() {
  printf("Hello world");
  return 0;
}
ENDOF

$ gcc main.c -o main-64
$ gcc -m32 main.c -o main-32

$ file main-64 main-32
main-64: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically 
linked, interpreter /lib64/ld-linux-x86-64.so.2, 
BuildID[sha1]=6d51010a38e03f84ea07897cd4ba6fd97ef9c74b, for GNU/Linux 3.2.0, 
not stripped
main-32: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), 
dynamically linked, interpreter /lib/ld-linux.so.2, 
BuildID[sha1]=fc8c3058b07d98d2fd19d91a0bf9e35c715c7014, for GNU/Linux 3.2.0, 
not stripped

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=1369
[2] 
https://git.openembedded.org/openembedded-core/commit/?id=b26819c85881e82ee1b5c68840011e78c321f18e


This RFC is discussing to enable multilib for nativesdk gcc, similar like:

root@qemux86-64:~# ./x86_64-buildtools-extended-nativesdk-standalone-5.1.sh -d 
sdk
root@qemux86-64:~# source sdk/environment-setup-x86_64-pokysdk-linux
root@qemux86-64:~# which gcc
/home/root/sdk/sysroots/x86_64-sdk-linux/usr/bin/gcc
root@qemux86-64:~# gcc main.c -o main-64
root@qemux86-64:~# gcc -m32 main.c -o main-32
root@qemux86-64:~# file main-64 main-32
main-64: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically 
linked, interpreter 
//home/root/sdk/sysroots/x86_64-sdk-linux/lib64/ld-linux-x86-64.so.2, for 
GNU/Linux 3.2.0, BuildID[sha1]=3c912c568c7fce674deb3de2978abad0cfe41743, not 
stripped
main-32: ELF 32-bit LSB pie executable, Intel i386, version 1 (SYSV), 
dynamically linked, interpreter 
//home/root/sdk/sysroots/x86_64-sdk-linux/lib/ld-linux.so.2, for GNU/Linux 
3.2.0, BuildID[sha1]=49394a5afa840379278cf9e30ed6c7f8a251e850, not stripped

It requires:
- Enhance GCC to enable multilib for nativesdk gcc
- Enhance SDK to support multilib dynamic loaders relocation
- Enhance multilib bbclass to support nativesdk extension

The blocking issue is 'multilib bbclass to support nativesdk extension',
Target GCC use multilib bbclass to build 32bit glibc (lib32-glibc) and
32bit libgcc (lib32-libgcc), but multilib bbclass in Yocto oe-core does
not support nativesdk extension. So we can't build 32bit nativesdk-gcc
and 32 bit natveisdk-libgcc

One try to improve multilib bbclass to support nativesdk extension,
such as set 'lib32nativesdk' to multilib bbclass

  require conf/multilib.conf
  MULTILIBS = "multilib:lib32nativesdk"

I am not sure it is worth to improve multilib bbclass to support nativesdk
extension, great efforts are needed and will make multilib bbclass more
complicated

//Hongxu
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#2091): 
https://lists.openembedded.org/g/openembedded-architecture/message/2091
Mute This Topic: https://lists.openembedded.org/mt/110660766/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-architecture/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to