logo       

ld problem (BUG?): msg#00060

linux.ports.h2200

Subject: ld problem (BUG?)

Hello all!
I`m installed familiar on my h2210 and always work, BUT:

With http://handhelds.org/moin/moin.cgi/DevelopOnFamiliar howto I`m make devel
system (all installed on 128 SDCard, booting with LAB -- perfect! Great
thanks for your work!)

well, when I`m try to compile hello.c
---
root@h2200:~/test# gcc hello.c -o hello
/usr/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot
find /lib/libc.so.6 inside /usr/bin/../../usr
collect2: ld returned 1 exit status
---

so i do:

--
root@h2200:~/test# gcc hello.c -o hello -v -Wl,--verbose
Reading specs from /usr/lib/gcc/arm-linux/3.4.4/specs
Configured
with:
/data/build/koen/OE/build/tmp/familiar/work/arm-linux/gcc-3.4.4-r5/gcc-3.4.4/configure

--build=i686-linux --host=arm-linux --target=arm-linux --prefix=/usr
--exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc
--sharedstatedir=/usr/com --localstatedir=/var --libdir=/usr/lib
--includedir=/usr/include --oldincludedir=/usr/include
--infodir=/usr/share/info --mandir=/usr/share/man --with-gnu-ld
--enable-shared --enable-target-optspace --enable-languages=c,c++,f77
--enable-threads=posix --enable-multilib --enable-c99 --enable-long-long
--enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-linux-
--with-local-prefix=/usr/local --with-gxx-include-dir=/usr/include/c++/3.4.4
--enable-__cxa_atexit
Thread model: posix
gcc version 3.4.4
/usr/libexec/gcc/arm-linux/3.4.4/cc1 -quiet -v -D__ARM_ARCH_3__ hello.c
-quiet -dumpbase hello.c -auxbase hello -version -o /tmp/cccT72BD.s
ignoring nonexistent directory
"/usr/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/arm-linux/3.4.4/include
/usr/include
End of search list.
GNU C version 3.4.4 (arm-linux)
compiled by GNU C version 3.4.4.
GGC heuristics: --param ggc-min-expand=34 --param ggc-min-heapsize=7814
/usr/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/as
-o /tmp/ccIB9XJH.o /tmp/cccT72BD.s
/usr/libexec/gcc/arm-linux/3.4.4/collect2 --eh-frame-hdr
-dynamic-linker /lib/ld-linux.so.2 -X -m armelf_linux -p -o
hello /usr/lib/gcc/arm-linux/3.4.4/../../../crt1.o
/usr/lib/gcc/arm-linux/3.4.4/../../../crti.o
/usr/lib/gcc/arm-linux/3.4.4/crtbegin.o
-L/usr/lib/gcc/arm-linux/3.4.4 -L/usr/lib/gcc/arm-linux/3.4.4
-L/usr/lib/gcc/arm-linux/3.4.4/../../.. /tmp/ccIB9XJH.o --verbose -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/arm-linux/3.4.4/crtend.o
/usr/lib/gcc/arm-linux/3.4.4/../../../crtn.o
GNU ld version 2.15.96 20050323
Supported emulations:
armelf_linux
armelf
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
"elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
/* Do we need any of these for elf?
__DYNAMIC = 0; */
SECTIONS
...
[skipped script listing]
...
==================================================
attempt to open /usr/lib/gcc/arm-linux/3.4.4/../../../crt1.o succeeded
/usr/lib/gcc/arm-linux/3.4.4/../../../crt1.o
attempt to open /usr/lib/gcc/arm-linux/3.4.4/../../../crti.o succeeded
/usr/lib/gcc/arm-linux/3.4.4/../../../crti.o
attempt to open /usr/lib/gcc/arm-linux/3.4.4/crtbegin.o succeeded
/usr/lib/gcc/arm-linux/3.4.4/crtbegin.o
attempt to open /tmp/ccIB9XJH.o succeeded
/tmp/ccIB9XJH.o
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libgcc.so failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libgcc.a succeeded
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/arm-linux/3.4.4/libgcc_s.so)
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.so failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.a failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.so failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.a failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/../../../libc.so succeeded
opened script file /usr/lib/gcc/arm-linux/3.4.4/../../../libc.so
opened script fil/usr/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:
cannot find /lib/libc.so.6 inside /usr/bin/../../usr
e /usr/lib/gcc/arm-linux/3.4.4/../../../libc.so
attempt to open /usr/bin/../../usr/lib/libc.so.6 failed
collect2: ld returned 1 exit status
--

i see ld found script /usr/lib/libc.so, get from it /lib/libc.so.6 and try`ed
to find it in /usr/bin/../../usr ??? but it is /usr !!!

BTW, I`m make symlinks for libc.so.6, libpthread.so.0 (ld script
libpthread.so) and ld-linux.so.2 to /usr/lib .... and get next error:
---
root@h2200:~/test# gcc hello.c -o hello -v -Wl,--verbose
...
[bla-bla-bla... skipped]
...
==================================================
attempt to open /usr/lib/gcc/arm-linux/3.4.4/../../../crt1.o succeeded
/usr/lib/gcc/arm-linux/3.4.4/../../../crt1.o
attempt to open /usr/lib/gcc/arm-linux/3.4.4/../../../crti.o succeeded
/usr/lib/gcc/arm-linux/3.4.4/../../../crti.o
attempt to open /usr/lib/gcc/arm-linux/3.4.4/crtbegin.o succeeded
/usr/lib/gcc/arm-linux/3.4.4/crtbegin.o
attempt to open /tmp/ccIvagL5.o succeeded
/tmp/ccIvagL5.o
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libgcc.so failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libgcc.a succeeded
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libgcc_s.so succeeded
-lgcc_s (/usr/lib/gcc/arm-linux/3.4.4/libgcc_s.so)
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.so failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.a failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.so failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/libc.a failed
attempt to open /usr/lib/gcc/arm-linux/3.4.4/../../../libc.so succeeded
opened script file /usr/lib/gcc/arm-linux/3.4.4/../../../libc.so
opened script fil/usr/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:
cannot find /usr/lib/libc_nonshared.a inside /usr/bin/../../usr
e /usr/lib/gcc/arm-linux/3.4.4/../../../libc.so
attempt to open /usr/bin/../../usr/lib/libc.so.6 succeeded
/lib/libc.so.6 (/usr/bin/../../usr/lib/libc.so.6)
attempt to open /usr/bin/../../usr/usr/lib/libc_nonshared.a failed
collect2: ld returned 1 exit status

Now hi can not find libc_nonshared.a in the /usr/lib ! Becouse
attempt /usr/bin/../../usr/usr/lib/libc_nonshared.a

Urgh....!

So, I`m pathed in /usr/lib/libc.so:
---
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
/* GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED
( /lib/ld-linux.so.2 ) ) */
GROUP ( /lib/libc.so.6 /lib/libc_nonshared.a AS_NEEDED
( /lib/ld-linux.so.2 ) )
---

... and libpthread.so too.

It`s worked. hello.c compiled perfectly, but it is ugly hack...



--versions--
root@h2200:~/chmlib-0.37# ipkg list_installed |grep binutils
binutils - 2.15.99+csl-arm+cvs20050416-r0 -
binutils-symlinks - 2.15.99+csl-arm+cvs20050416-r0 -

root@h2200:~/chmlib-0.37# ipkg list_installed |grep gcc
gcc - 3.4.4-r5 -
gcc-symlinks - 3.4.4-r5 -
libgcc1 - 3.4.4-r3 -

root@h2200:~/chmlib-0.37# ipkg list_installed |grep cpp
cpp - 3.4.4-r5 -
cpp-symlinks - 3.4.4-r5 -

root@h2200:~/chmlib-0.37# ipkg list_installed |grep g++
g++ - 3.4.4-r5 -
g++-symlinks - 3.4.4-r5 -

root@h2200:~/chmlib-0.37# ipkg list_installed |grep libc6
libc6 - 2.3.5+cvs20050627-r0 -
libc6-dev - 2.3.5+cvs20050627-r0 -


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise