[yocto] help required to build 32-bit executable using yocto gcc

Ram Regar (rregar) rregar at cisco.com
Tue Oct 23 21:45:46 PDT 2018


Hi,

I am looking to use gcc built by yocto sdk with –m32 option.

I changed MACHINE to genericx86-64 local.conf and also added these lines to be able to add multilib support with gcc.

IMAGE_INSTALL_append = " glibc-staticdev"
NO32LIBS = "0"

require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

But I get these these errors. I am using dizzy branch, a bit old but I believe this branch also support –m32 in gcc that it build internally. Gcc can generate 64 bit binaries but not 32-bit binaries.

[dizzy at dizzy-centos7 core-minimal]$ x86_64-poky-linux-gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/core2-64-poky-linux ~/thread.c
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: skipping incompatible /home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/core2-64-poky-linux/usr/lib64/x86_64-poky-linux/4.9.1/libgcc.a when searching for -lgcc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: cannot find -lgcc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: skipping incompatible /home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/core2-64-poky-linux/usr/lib64/libc.so when searching for -lc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: skipping incompatible /home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/core2-64-poky-linux/usr/lib64/libc.a when searching for -lc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: cannot find -lc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: skipping incompatible /home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/core2-64-poky-linux/usr/lib64/x86_64-poky-linux/4.9.1/libgcc.a when searching for -lgcc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: cannot find -lgcc
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: skipping incompatible /home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/core2-64-poky-linux/lib64/libgcc_s.so when searching for -lgcc_s
/home/dizzy/poky/build/tmp/deploy/sdk/core-minimal/sysroots/x86_64-pokysdk-linux/usr/bin/x86_64-poky-linux/../../libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
[dizzy at dizzy-centos7 core-minimal]$

Thanks for your help in advance.

Thanks
Ram Regar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20181024/841a1dc3/attachment-0001.html>


More information about the yocto mailing list