Re: [OE-core] Query for multilib support in Yocto

2013-05-24 Thread Luo Zhenhua-B19537
Hi Mark,

Thanks for your comments. 

 -Original Message-
 From: openembedded-core-boun...@lists.openembedded.org
 [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of Mark 
 Hatle
 Sent: Thursday, May 23, 2013 10:47 PM
 
 On 5/23/13 3:46 AM, Luo Zhenhua-B19537 wrote:
 
  For gcc with multilib support running on target board 1. Can the same
  gcc binary build both 32b and 64b applications or two different gcc
 binaries(one is for 32b, the other is for 64b) are required?
 
 As far as I'm aware the same issue above holds true here.  You still need
 multiple compiler binaries, one for each multilib.  (Khem Raj would know
 if this is still true however.)
[Luo Zhenhua-B19537] I see an successful case of single gcc on target can build 
both 32b and 64b app, https://bugzilla.yoctoproject.org/show_bug.cgi?id=1369. 
Is that still true in recent Yocto? 
 
 I experienced following error when I use gcc(32bit rootfs with multilib
 support) to do 64b build, I find the linker search libraries in /usr/lib
 and /lib instead of /usr/lib64 and /lib64.
 
  root@p5020ds:~# gcc -m64 my_test.c -o my_test
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: skipping incompatible
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../powerpc-poky-linux/4.7.
  2/libgcc.a when searching for -lgcc
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: skipping incompatible
  /usr/lib/powerpc-poky-linux/4.7.2/libgcc.a when searching for -lgcc
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: cannot find -lgcc
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: skipping incompatible /lib/../lib/libgcc_s.so.1 when searching
  for libgcc_s.so.1
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: skipping incompatible //lib/libgcc_s.so.1 when searching for
  libgcc_s.so.1
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: cannot find libgcc_s.so.1
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: skipping incompatible
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../powerpc-poky-linux/4.7.
  2/libgcc.a when searching for libgcc.a
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: skipping incompatible
  /usr/lib/powerpc-poky-linux/4.7.2/libgcc.a when searching for libgcc.a
  /usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/b
  in/ld: cannot find libgcc.a
 
 Ya, this is running the 'wrong' toolchain.  From the errors it appears to
 me that it's the 32-bit gcc, attempting to compile for 64-bit.  There is
 a command that will tell you what architectures gcc was built to support,
 but unfortunately I don't remember it offhand.
[Luo Zhenhua-B19537] The test program can be compiled and assembled correctly, 
but link failed. Seems like -m64 influenced powerpc-poky-linux-gcc, but not 
influenced powerpc-poky-linux-ld, LIBRARY_PATH is same for both 32b and 64b 
build, how can the value of LIBRARY_PATH be set to different value if -m64 is 
passed?

root@p5020ds:~# gcc -m64 -c my_test.c 
root@p5020ds:~# ls -l
total 3
-rw-r--r-- 1 root root   30 May 23 09:40 my_test.c
-rw-r--r-- 1 root root 1208 May 24 08:09 my_test.o
root@p5020ds:~# file my_test.o 
my_test.o: ELF 64-bit MSB relocatable, 64-bit PowerPC or cisco 7500, version 1 
(SYSV), not stripped
root@p5020ds:~# cat my_test.c 
int main()
{
return 0;
}


Best Regards,

Zhenhua

___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] Query for multilib support in Yocto

2013-05-23 Thread Luo Zhenhua-B19537
Hi all, 

I am trying the multilib feature of Yocto, and I want to make sure if below 
scenarios are supported, who can help to clarify? Thanks in advance. 

For standalone toolchain built by bitbake meta-toolchain
1. Can the same gcc binary build both 32b and 64b applications or two different 
gcc binaries(one is for 32b, the other is for 64b) are required? 

For gcc with multilib support running on target board
1. Can the same gcc binary build both 32b and 64b applications or two different 
gcc binaries(one is for 32b, the other is for 64b) are required? 
2. Can both 32b and 64b application be executed in the same rootfs image with 
multilib support?

BTW, may I know how the default value of LIBRARY_PATH is set? I experienced 
following error when I use gcc(32bit rootfs with multilib support) to do 64b 
build, I find the linker search libraries in /usr/lib and /lib instead of 
/usr/lib64 and /lib64. 

root@p5020ds:~# gcc -m64 my_test.c -o my_test
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible 
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../powerpc-poky-linux/4.7.2/libgcc.a
 when searching for -lgcc
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible /usr/lib/powerpc-poky-linux/4.7.2/libgcc.a when searching 
for -lgcc
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
cannot find -lgcc
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible /lib/../lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible //lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
cannot find libgcc_s.so.1
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible 
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../powerpc-poky-linux/4.7.2/libgcc.a
 when searching for libgcc.a
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible /usr/lib/powerpc-poky-linux/4.7.2/libgcc.a when searching 
for libgcc.a
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
cannot find libgcc.a
collect2: error: ld returned 1 exit status
root@p5020ds:~# cat my_test.c 
int main()
{
int a=0;

return a;
}


Best Regards,

Zhenhua

___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] Query for multilib support in Yocto

2013-05-23 Thread Mark Hatle

On 5/23/13 3:46 AM, Luo Zhenhua-B19537 wrote:

Hi all,

I am trying the multilib feature of Yocto, and I want to make sure if below 
scenarios are supported, who can help to clarify? Thanks in advance.

For standalone toolchain built by bitbake meta-toolchain
1. Can the same gcc binary build both 32b and 64b applications or two different 
gcc binaries(one is for 32b, the other is for 64b) are required?


As far as I know, you can create a multilib SDK, but you will need multilib gcc 
binaries.  We don't yet have singular gcc with multilib cflag options available. 
 (At Wind River we use a prebuilt binary toolchain that does allow this single 
binary/multilib target behavior.  Other then that we are using the standard SDK 
support and it is working for us.)



For gcc with multilib support running on target board
1. Can the same gcc binary build both 32b and 64b applications or two different 
gcc binaries(one is for 32b, the other is for 64b) are required?


As far as I'm aware the same issue above holds true here.  You still need 
multiple compiler binaries, one for each multilib.  (Khem Raj would know if this 
is still true however.)


It was discussed a while back that we really want to follow the single binary, 
multilib target model -- but I don't know where that is from a development 
perspective.



2. Can both 32b and 64b application be executed in the same rootfs image with 
multilib support?


Yes.  As long as the multilib support is configured properly (i.e. different 
baselib for each tune) it works properly today.  I've been building 1.4 (and 
master) recently for x86/x86_64 systems with multilib support and as far as I 
can tell it is working correctly.


On Power there have been some issues reported in the past with the prelinker and 
PPC64 binaries.  But other then that, it should be working fine.



BTW, may I know how the default value of LIBRARY_PATH is set? I experienced 
following error when I use gcc(32bit rootfs with multilib support) to do 64b 
build, I find the linker search libraries in /usr/lib and /lib instead of 
/usr/lib64 and /lib64.

root@p5020ds:~# gcc -m64 my_test.c -o my_test
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible 
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../powerpc-poky-linux/4.7.2/libgcc.a
 when searching for -lgcc
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible /usr/lib/powerpc-poky-linux/4.7.2/libgcc.a when searching 
for -lgcc
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
cannot find -lgcc
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible /lib/../lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible //lib/libgcc_s.so.1 when searching for libgcc_s.so.1
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
cannot find libgcc_s.so.1
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible 
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../powerpc-poky-linux/4.7.2/libgcc.a
 when searching for libgcc.a
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
skipping incompatible /usr/lib/powerpc-poky-linux/4.7.2/libgcc.a when searching 
for libgcc.a
/usr/lib/gcc/powerpc-poky-linux/4.7.2/../../../../powerpc-poky-linux/bin/ld: 
cannot find libgcc.a


Ya, this is running the 'wrong' toolchain.  From the errors it appears to me 
that it's the 32-bit gcc, attempting to compile for 64-bit.  There is a command 
that will tell you what architectures gcc was built to support, but 
unfortunately I don't remember it offhand.


At one point we had installed the full canonical name of the gcc binary, so 
powerpc-poky-linux-gcc would be 32-bit, and powerpc64-poky-linux-gcc would 
be the 64-bit version.  I don't know if that is still true however.


--Mark


collect2: error: ld returned 1 exit status
root@p5020ds:~# cat my_test.c
int main()
{
 int a=0;

 return a;
}


Best Regards,

Zhenhua

___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core



___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core