From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3040 invoked by alias); 9 Jun 2009 22:17:08 -0000 Received: (qmail 3031 invoked by uid 22791); 9 Jun 2009 22:17:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53,J_CHICKENPOX_54 X-Spam-Check-By: sourceware.org Received: from 42.mail-out.ovh.net (HELO 42.mail-out.ovh.net) (213.251.189.42) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 09 Jun 2009 22:17:00 +0000 Received: (qmail 1553 invoked by uid 503); 9 Jun 2009 22:17:10 -0000 Received: from b9.ovh.net (HELO mail419.ha.ovh.net) (213.186.33.59) by 42.mail-out.ovh.net with SMTP; 9 Jun 2009 22:17:10 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 9 Jun 2009 22:16:56 -0000 Received: from amontpellier-156-1-152-224.w90-15.abo.wanadoo.fr (HELO ?192.168.1.20?) (piments%piments.com@90.15.79.224) by ns0.ovh.net with SMTP; 9 Jun 2009 22:16:54 -0000 Message-ID: <4A2EDF5A.9080404@piments.com> Date: Tue, 09 Jun 2009 22:17:00 -0000 From: ng@piments.com User-Agent: Thunderbird 2.0.0.19 (X11/20090308) MIME-Version: 1.0 To: "Yann E. MORIN" CC: crossgcc@sourceware.org Subject: Re: how to get target ldd ? References: <4A2A160E.7090400@piments.com> <200906071856.48287.yann.morin.1998@anciens.enib.fr> In-Reply-To: <200906071856.48287.yann.morin.1998@anciens.enib.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 16093050319788614246 X-Ovh-Remote: 90.15.79.224 (amontpellier-156-1-152-224.w90-15.abo.wanadoo.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00013.txt.bz2 Yann E. MORIN wrote: > Peter, > All, > > On Saturday 06 June 2009 09:09:02 peter wrote: >> I am having problems with a busybox ARM target I have build using ct-ng. >> None of the executables , including busybox, seem to work unless I >> build them static. > > What's the symptom ? > Do they segfault ? > Can you run a statically linked hello world ? A dynamic one ? > What does it say on the console? > Using glibc or uClibc ? > ... > > You did not give enough info to diagnose the problem... > >> Is there a way to get ldd for the target system out of ct-ng? > > Look in the archives, this has already been discussed... > > The /problem/ with ldd (the one in glibc, at least) is that it tries to > _run_ the dynamic linker /lib/ld-xxx.so with some environment variables > set, and this will print the libraries it finds _at_runtime_. > > Obviously, you don't want to run your ARM dynamic linker on your dev > machine, as this most probably is some kind os x86. > > If using populate as per your previous posts, what does populate -v says? > > Regards, > Yann E. MORIN. > Thanks Yann, Dan, I did not give more details of the problem because I thought ldd would enable me to see where the problem lay. Sadly not. I copied the sys-root copy of ldd and it gives me the same silliness as the other commands. # which ldd /usr/bin/ldd # ldd -sh: ldd: not found # ls -ail `which ldd` 3273877 -r-xr-xr-x 1 root root 5583 Jun 8 2009 /usr/bin/ldd So it's there, it's found by which, but "not found". Clearly this is just busybox's challenged error handling spewing garbage. The question is how to debug what is really happending. This error is helpful in itself since it's not even a binary, it's a script. Binaries give : -sh: gnuplot: Permission denied even though they have x permissions and are being invoked by root. # which gnuplot /usr/bin/gnuplot # `which gnuplot` -sh: /usr/bin/gnuplot: Permission denied # ls -ail `which gnuplot` 3272843 -rwxr-xr-x 1 root root 2074273 Jun 2 2009 /usr/bin/gnuplot Following Dan's suggestion got not more information: (unless getting the same output with the trace IS more information) # LD_TRACE_LOADED_OBJECTS=1 gnuplot -sh: gnuplot: Permission denied Busybox static works , bb with normal dyn linking : permission denied. > If using populate as per your previous posts, what does populate -v says? Tar bleats about some files in /etc having "improbable" datestamp, circa 1/1/1970. This does not seem to be an error though. After that it finds the expected libs , oopies them , then starts "looping". This just reports libs to be already present. This seems to be in order. LD_TRACE_LOADED_OBJECTS=1 hello.stat Hello world! # LD_TRACE_LOADED_OBJECTS=1 hello.dyn -sh: hello.dyn: Permission denied So either ld loads but can't link or there is a broken lib... bash-4.0#file /back/ts/root-image/lib/libc.so.6 /back/ts/root-image/lib/libc.so.6: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.29, not stripped # readelf -a /back/ts/root-image/lib/libc.so.6 ... Version needs section '.gnu.version_r' contains 1 entries: Addr: 0x0000000000012520 Offset: 0x012520 Link: 4 (.dynstr) 000000: Version: 1 File: ld-linux.so.3 Cnt: 2 0x0010: Name: GLIBC_2.4 Flags: none Version: 10 0x0020: Name: GLIBC_PRIVATE Flags: none Version: 9 Notes at offset 0x00000194 with length 0x00000020: Owner Data size Description GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag) Attribute Section: aeabi File Attributes Tag_CPU_name: "4T" Tag_CPU_arch: v4T Tag_ARM_ISA_use: Yes Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align8_needed: Yes Tag_ABI_align8_preserved: Yes, except leaf SP Tag_ABI_enum_size: int I'm short on ideas now. Thx -- For unsubscribe information see http://sourceware.org/lists.html#faq