public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* ldd for busybox compiled for arm
@ 2017-01-03 21:49 Vered Zvi
  2017-01-04 20:19 ` ANDY KENNEDY
  0 siblings, 1 reply; 6+ messages in thread
From: Vered Zvi @ 2017-01-03 21:49 UTC (permalink / raw)
  To: crossgcc


Hello,

Using crosstool-ng 1.22.0 I created a toolchain for:  arm-cortex_a15-linux-gnueabi
The host is Centos 7.2.1511 (64)

Using this toolchain I compiled busybox.
make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-gnueabihf- defconfig
make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-gnueabihf-

Is it possible to use ldd from this toolchain to find out the dependencies for /bin/sh , /sbin/init ?

Strange: both /bin/sh, /sbin/init run under x86.
How it is possible ?
They were compiled for ARM.

Thank you,
Z.V
The information contained in this communication is proprietary to Israel Aerospace Industries Ltd. and/or third parties, may contain confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this communication in error, please notify the sender immediately and delete it from your computer.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: ldd for busybox compiled for arm
  2017-01-03 21:49 ldd for busybox compiled for arm Vered Zvi
@ 2017-01-04 20:19 ` ANDY KENNEDY
  2017-01-05  3:34   ` Vered Zvi
  0 siblings, 1 reply; 6+ messages in thread
From: ANDY KENNEDY @ 2017-01-04 20:19 UTC (permalink / raw)
  To: 'Vered Zvi', crossgcc

> -----Original Message-----
> From: crossgcc-owner@sourceware.org [mailto:crossgcc-owner@sourceware.org] On Behalf Of Vered Zvi
> Sent: Tuesday, January 03, 2017 3:49 PM
> To: crossgcc@sourceware.org
> Subject: ldd for busybox compiled for arm
> 
> 
> Hello,

Hi Vered!

> 
> Using crosstool-ng 1.22.0 I created a toolchain for:  arm-cortex_a15-linux-gnueabi
> The host is Centos 7.2.1511 (64)
> 
> Using this toolchain I compiled busybox.
> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
> gnueabihf- defconfig
> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
> gnueabihf-

After doing this, you should have ended up with two files in the
local directory:  busybox busybox_unstripped.

What does "file" return to you for these two files.

> 
> Is it possible to use ldd from this toolchain to find out the dependencies for /bin/sh , /sbin/init
> ?
> 
> Strange: both /bin/sh, /sbin/init run under x86.

I would hope that to be the case.  /bin/sh on the HOST should not have
been altered by the above steps.  Now, if you mean that you attempted to
run these two commands on the target, this is different.  On target, you
may have to run 'busybox install' to correctly configure the system with
the appropriate links.  The file /bin/busybox on TARGET should be your
NEW busybox prior to executing the install.  

If you cannot execute your freshly built busybox on the system (busybox
without options will display the built-ins applets for busybox), you may
have linking issues.  The trick there is that you would many of the libs
that come with the toolchain before this will work.  If you are looking
to build a system without libraries, I suggest that you use BuildRoot
with an internal toolchain to build your busybox statically.

> How it is possible ?
> They were compiled for ARM.
> 
> Thank you,
> Z.V

HTH!

Andy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: ldd for busybox compiled for arm
  2017-01-04 20:19 ` ANDY KENNEDY
@ 2017-01-05  3:34   ` Vered Zvi
  2017-01-05  8:58     ` Yegor Yefremov
  0 siblings, 1 reply; 6+ messages in thread
From: Vered Zvi @ 2017-01-05  3:34 UTC (permalink / raw)
  To: ANDY KENNEDY, crossgcc

Hi Andy,

Thank you for the detailed reply.

On the host I ran:
cross-compile-ldd  /mydir/boot/rootfs/bin/sh
and got:
libm.so.6 => /lib/libm.so.6 (0xdeadbeef)
libc.so.6 => /lib/libc.so.6 (0xdeadbeef)
ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0xdeadbeef)

same result for:
cross-compile-ldd  /mydir/boot/rootfs/sbin/init

I double checked that libm.so.6, libc.so.6 are in /lib

On the host I ran:
file /mydir/boot/roots/bin/busybox
and got:
/mydir//boot/rootfs/bin/busybox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=fc40d0187472069db3da93db4b30f9df92a75bbd, stripped

Does it make sense ?

On the host I tried to run /mydir/boot/rootfs/bin/ls.
It runs like the reguar host's ls

Does it make sense ?

I checked:
./arm-cortex_a15-linux-gnueabihf-gcc -v
and got:
COLLECT_GCC=./arm-cortex_a15-linux-gnueabihf-gcc
...
Target: arm-cortex_a15-linux-gnueabihf

Using genext2fs I created a ram disk image from the folder that contains:
/boot /bin/ /sbin/ /usr .....

Upon boot the kernel displays the following error:
/sbin/init exists but couldn't execute it (error -8)
/bin/sh exists but couldn't execute it (error -8)

Can you tell what can cause this error ?
Is it possible that the ramdisk image is not propery created ?

Best regards,
Z.V

________________________________________
From: ANDY KENNEDY [ANDY.KENNEDY@adtran.com]
Sent: Wednesday, January 04, 2017 10:18 PM
To: Vered Zvi; crossgcc@sourceware.org
Subject: RE: ldd for busybox compiled for arm

> -----Original Message-----
> From: crossgcc-owner@sourceware.org [mailto:crossgcc-owner@sourceware.org] On Behalf Of Vered Zvi
> Sent: Tuesday, January 03, 2017 3:49 PM
> To: crossgcc@sourceware.org
> Subject: ldd for busybox compiled for arm
>
>
> Hello,

Hi Vered!

>
> Using crosstool-ng 1.22.0 I created a toolchain for:  arm-cortex_a15-linux-gnueabi
> The host is Centos 7.2.1511 (64)
>
> Using this toolchain I compiled busybox.
> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
> gnueabihf- defconfig
> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
> gnueabihf-

After doing this, you should have ended up with two files in the
local directory:  busybox busybox_unstripped.

What does "file" return to you for these two files.

>
> Is it possible to use ldd from this toolchain to find out the dependencies for /bin/sh , /sbin/init
> ?
>
> Strange: both /bin/sh, /sbin/init run under x86.

I would hope that to be the case.  /bin/sh on the HOST should not have
been altered by the above steps.  Now, if you mean that you attempted to
run these two commands on the target, this is different.  On target, you
may have to run 'busybox install' to correctly configure the system with
the appropriate links.  The file /bin/busybox on TARGET should be your
NEW busybox prior to executing the install.

If you cannot execute your freshly built busybox on the system (busybox
without options will display the built-ins applets for busybox), you may
have linking issues.  The trick there is that you would many of the libs
that come with the toolchain before this will work.  If you are looking
to build a system without libraries, I suggest that you use BuildRoot
with an internal toolchain to build your busybox statically.

> How it is possible ?
> They were compiled for ARM.
>
> Thank you,
> Z.V

HTH!

Andy

The information contained in this communication is proprietary to Israel Aerospace Industries Ltd. and/or third parties, may contain confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this communication in error, please notify the sender immediately and delete it from your computer.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ldd for busybox compiled for arm
  2017-01-05  3:34   ` Vered Zvi
@ 2017-01-05  8:58     ` Yegor Yefremov
  2017-01-05 12:00       ` Vered Zvi
  0 siblings, 1 reply; 6+ messages in thread
From: Yegor Yefremov @ 2017-01-05  8:58 UTC (permalink / raw)
  To: Vered Zvi, ANDY KENNEDY, crossgcc

Hi Vered!

do you need ldd on your host or on the target too? On target you can use:

LD_TRACE_LOADED_OBJECTS=1 <executable>

to get dependencies, so no need to cross-compile and install ldd.

Yegor

On 05.01.2017 04:34, Vered Zvi wrote:
> Hi Andy,
> 
> Thank you for the detailed reply.
> 
> On the host I ran:
> cross-compile-ldd  /mydir/boot/rootfs/bin/sh
> and got:
> libm.so.6 => /lib/libm.so.6 (0xdeadbeef)
> libc.so.6 => /lib/libc.so.6 (0xdeadbeef)
> ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0xdeadbeef)
> 
> same result for:
> cross-compile-ldd  /mydir/boot/rootfs/sbin/init
> 
> I double checked that libm.so.6, libc.so.6 are in /lib
> 
> On the host I ran:
> file /mydir/boot/roots/bin/busybox
> and got:
> /mydir//boot/rootfs/bin/busybox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=fc40d0187472069db3da93db4b30f9df92a75bbd, stripped
> 
> Does it make sense ?
> 
> On the host I tried to run /mydir/boot/rootfs/bin/ls.
> It runs like the reguar host's ls
> 
> Does it make sense ?
> 
> I checked:
> ./arm-cortex_a15-linux-gnueabihf-gcc -v
> and got:
> COLLECT_GCC=./arm-cortex_a15-linux-gnueabihf-gcc
> ...
> Target: arm-cortex_a15-linux-gnueabihf
> 
> Using genext2fs I created a ram disk image from the folder that contains:
> /boot /bin/ /sbin/ /usr .....
> 
> Upon boot the kernel displays the following error:
> /sbin/init exists but couldn't execute it (error -8)
> /bin/sh exists but couldn't execute it (error -8)
> 
> Can you tell what can cause this error ?
> Is it possible that the ramdisk image is not propery created ?
> 
> Best regards,
> Z.V
> 
> ________________________________________
> From: ANDY KENNEDY [ANDY.KENNEDY@adtran.com]
> Sent: Wednesday, January 04, 2017 10:18 PM
> To: Vered Zvi; crossgcc@sourceware.org
> Subject: RE: ldd for busybox compiled for arm
> 
>> -----Original Message-----
>> From: crossgcc-owner@sourceware.org [mailto:crossgcc-owner@sourceware.org] On Behalf Of Vered Zvi
>> Sent: Tuesday, January 03, 2017 3:49 PM
>> To: crossgcc@sourceware.org
>> Subject: ldd for busybox compiled for arm
>>
>>
>> Hello,
> 
> Hi Vered!
> 
>>
>> Using crosstool-ng 1.22.0 I created a toolchain for:  arm-cortex_a15-linux-gnueabi
>> The host is Centos 7.2.1511 (64)
>>
>> Using this toolchain I compiled busybox.
>> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
>> gnueabihf- defconfig
>> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
>> gnueabihf-
> 
> After doing this, you should have ended up with two files in the
> local directory:  busybox busybox_unstripped.
> 
> What does "file" return to you for these two files.
> 
>>
>> Is it possible to use ldd from this toolchain to find out the dependencies for /bin/sh , /sbin/init
>> ?
>>
>> Strange: both /bin/sh, /sbin/init run under x86.
> 
> I would hope that to be the case.  /bin/sh on the HOST should not have
> been altered by the above steps.  Now, if you mean that you attempted to
> run these two commands on the target, this is different.  On target, you
> may have to run 'busybox install' to correctly configure the system with
> the appropriate links.  The file /bin/busybox on TARGET should be your
> NEW busybox prior to executing the install.
> 
> If you cannot execute your freshly built busybox on the system (busybox
> without options will display the built-ins applets for busybox), you may
> have linking issues.  The trick there is that you would many of the libs
> that come with the toolchain before this will work.  If you are looking
> to build a system without libraries, I suggest that you use BuildRoot
> with an internal toolchain to build your busybox statically.
> 
>> How it is possible ?
>> They were compiled for ARM.
>>
>> Thank you,
>> Z.V
> 
> HTH!
> 
> Andy
> 
> The information contained in this communication is proprietary to Israel Aerospace Industries Ltd. and/or third parties, may contain confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this communication in error, please notify the sender immediately and delete it from your computer.
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: ldd for busybox compiled for arm
  2017-01-05  8:58     ` Yegor Yefremov
@ 2017-01-05 12:00       ` Vered Zvi
  2017-01-05 13:06         ` Josh Branning
  0 siblings, 1 reply; 6+ messages in thread
From: Vered Zvi @ 2017-01-05 12:00 UTC (permalink / raw)
  To: Yegor Yefremov, ANDY KENNEDY, crossgcc

Hello,

The cross-compile-ldd utility was downloaded from crosstool-ng
I'm running it on the host.

On the target I can not run anything because boot hangs.

Thank you,
Z.V

________________________________________
From: Yegor Yefremov [yegor.yefremov@visionsystems.de]
Sent: Thursday, January 05, 2017 10:57 AM
To: Vered Zvi; ANDY KENNEDY; crossgcc@sourceware.org
Subject: Re: ldd for busybox compiled for arm

Hi Vered!

do you need ldd on your host or on the target too? On target you can use:

LD_TRACE_LOADED_OBJECTS=1 <executable>

to get dependencies, so no need to cross-compile and install ldd.

Yegor

On 05.01.2017 04:34, Vered Zvi wrote:
> Hi Andy,
>
> Thank you for the detailed reply.
>
> On the host I ran:
> cross-compile-ldd  /mydir/boot/rootfs/bin/sh
> and got:
> libm.so.6 => /lib/libm.so.6 (0xdeadbeef)
> libc.so.6 => /lib/libc.so.6 (0xdeadbeef)
> ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0xdeadbeef)
>
> same result for:
> cross-compile-ldd  /mydir/boot/rootfs/sbin/init
>
> I double checked that libm.so.6, libc.so.6 are in /lib
>
> On the host I ran:
> file /mydir/boot/roots/bin/busybox
> and got:
> /mydir//boot/rootfs/bin/busybox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=fc40d0187472069db3da93db4b30f9df92a75bbd, stripped
>
> Does it make sense ?
>
> On the host I tried to run /mydir/boot/rootfs/bin/ls.
> It runs like the reguar host's ls
>
> Does it make sense ?
>
> I checked:
> ./arm-cortex_a15-linux-gnueabihf-gcc -v
> and got:
> COLLECT_GCC=./arm-cortex_a15-linux-gnueabihf-gcc
> ...
> Target: arm-cortex_a15-linux-gnueabihf
>
> Using genext2fs I created a ram disk image from the folder that contains:
> /boot /bin/ /sbin/ /usr .....
>
> Upon boot the kernel displays the following error:
> /sbin/init exists but couldn't execute it (error -8)
> /bin/sh exists but couldn't execute it (error -8)
>
> Can you tell what can cause this error ?
> Is it possible that the ramdisk image is not propery created ?
>
> Best regards,
> Z.V
>
> ________________________________________
> From: ANDY KENNEDY [ANDY.KENNEDY@adtran.com]
> Sent: Wednesday, January 04, 2017 10:18 PM
> To: Vered Zvi; crossgcc@sourceware.org
> Subject: RE: ldd for busybox compiled for arm
>
>> -----Original Message-----
>> From: crossgcc-owner@sourceware.org [mailto:crossgcc-owner@sourceware.org] On Behalf Of Vered Zvi
>> Sent: Tuesday, January 03, 2017 3:49 PM
>> To: crossgcc@sourceware.org
>> Subject: ldd for busybox compiled for arm
>>
>>
>> Hello,
>
> Hi Vered!
>
>>
>> Using crosstool-ng 1.22.0 I created a toolchain for:  arm-cortex_a15-linux-gnueabi
>> The host is Centos 7.2.1511 (64)
>>
>> Using this toolchain I compiled busybox.
>> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
>> gnueabihf- defconfig
>> make ARCH=arm CROSS_COMPILE=../../../../toolchain/crosstool/release/bin/arm-cortex_a15-linux-
>> gnueabihf-
>
> After doing this, you should have ended up with two files in the
> local directory:  busybox busybox_unstripped.
>
> What does "file" return to you for these two files.
>
>>
>> Is it possible to use ldd from this toolchain to find out the dependencies for /bin/sh , /sbin/init
>> ?
>>
>> Strange: both /bin/sh, /sbin/init run under x86.
>
> I would hope that to be the case.  /bin/sh on the HOST should not have
> been altered by the above steps.  Now, if you mean that you attempted to
> run these two commands on the target, this is different.  On target, you
> may have to run 'busybox install' to correctly configure the system with
> the appropriate links.  The file /bin/busybox on TARGET should be your
> NEW busybox prior to executing the install.
>
> If you cannot execute your freshly built busybox on the system (busybox
> without options will display the built-ins applets for busybox), you may
> have linking issues.  The trick there is that you would many of the libs
> that come with the toolchain before this will work.  If you are looking
> to build a system without libraries, I suggest that you use BuildRoot
> with an internal toolchain to build your busybox statically.
>
>> How it is possible ?
>> They were compiled for ARM.
>>
>> Thank you,
>> Z.V
>
> HTH!
>
> Andy
>
> The information contained in this communication is proprietary to Israel Aerospace Industries Ltd. and/or third parties, may contain confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this communication in error, please notify the sender immediately and delete it from your computer.
>
>
The information contained in this communication is proprietary to Israel Aerospace Industries Ltd. and/or third parties, may contain confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this communication in error, please notify the sender immediately and delete it from your computer.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ldd for busybox compiled for arm
  2017-01-05 12:00       ` Vered Zvi
@ 2017-01-05 13:06         ` Josh Branning
  0 siblings, 0 replies; 6+ messages in thread
From: Josh Branning @ 2017-01-05 13:06 UTC (permalink / raw)
  To: crossgcc

On 05/01/17 11:59, Vered Zvi wrote:
> Hello,
>
> The cross-compile-ldd utility was downloaded from crosstool-ng I'm
> running it on the host.
>
> On the target I can not run anything because boot hangs.
>
> Thank you, Z.V

Hi,

Have you tried using an absolute path instead of a relative path to the
CROSS_COMPILE variable?

Josh



The information contained in this communication is certainly not
proprietary, because proprietary is nearing evil. It's especially not
proprietary to Israel Aerospace Industries Ltd. and/or third parties who
hopefully aren't developing rocket propelled missiles or other general 
killing devices using this software, it probably doesn't contain 
confidential or privileged information, and is intended for anyone to 
read on this list. If you are not the intended addressee, and not on 
this list, it makes me wonder ... how did you manage to read it? Any 
use, disclosure, distribution and/or copying of this communication is 
actively encouraged if deemed helpful. If you receive this communication 
in error, who cares? Don't delete anything from your computer, as you 
can just ignore the email and pretend nothing ever happened either way.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-05 13:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 21:49 ldd for busybox compiled for arm Vered Zvi
2017-01-04 20:19 ` ANDY KENNEDY
2017-01-05  3:34   ` Vered Zvi
2017-01-05  8:58     ` Yegor Yefremov
2017-01-05 12:00       ` Vered Zvi
2017-01-05 13:06         ` Josh Branning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).