On Tuesday 24 February 2009 01:58:03 Filippo ARCIDIACONO wrote:
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Rob Landley
> > Sent: Monday, February 23, 2009 8:10 PM
> > To: Carmelo AMOROSO
> > Cc: [email protected]
> > Subject: Re: Has anybody used 0.9.30 on sh4?
> >
> > On Monday 23 February 2009 09:49:28 Carmelo AMOROSO wrote:
> > > Rob Landley wrote:
> > > > If I enable CTOR/DTOR support, I get undefined _init and
> >
> > _fini.  I
> >
> > > > don't remember which .o file those two are in, but it's
> >
> > linking in
> >
> > > > the same group as all the other targets and those work,
> >
> > sh4 doesn't.
> >
> > > > # gcc -v thread-hello2.c -lpthread
> > > > ...
>
> Could you post the whole verbose output?

Not without kmail horribly mangling the wordwrapping, but if you think it'll 
help...

> I suspect that your native gcc is badly configured.

/ # gcc -v usr/src/thread-hello2.c -lpthread
Using built-in specs.
Target: sh-superh-linux
Configured with: /home/landley/firmware/firmware/build/temp-sh4/gcc-
core/configure --prefix=/home/landley/firmware/firmware/build/mini-native-
sh4/usr --disable-multilib --build=x86_64-walrus-linux --host=sh-superh-linux 
--target=sh-superh-linux --enable-long-long --enable-c99 --enable-shared --
enable-threads=posix --enable-__cxa_atexit --disable-nls --enable-
languages=c,c++ --disable-libstdcxx-pch --enable-sjlj-exceptions --program-
prefix=
Thread model: posix
gcc version 4.1.2
 /usr/bin/../libexec/gcc/sh-superh-linux/4.1.2/cc1 -quiet -nostdinc -v -
iprefix /usr/bin/../lib/gcc/sh-superh-linux/4.1.2/ -U__nptl__ -isystem 
/usr/bin/../include -isystem /usr/bin/../gcc/include usr/src/thread-hello2.c -
quiet -dumpbase thread-hello2.c -auxbase thread-hello2 -version -o 
/tmp/ccoGq6PC.s
#include "..." search starts here:
#include <...> search starts here:
 /usr/bin/../include
 /usr/bin/../gcc/include
End of search list.
GNU C version 4.1.2 (sh-superh-linux)
        compiled by GNU C version 4.1.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 84f18d8f2b122674259daa95d71286c4
 as --traditional-format -little -o /tmp/ccbzhbPt.o /tmp/ccoGq6PC.s
 /usr/bin/../libexec/gcc/sh-superh-linux/4.1.2/collect2 --eh-frame-hdr -m 
shlelf_linux -dynamic-linker /lib/ld-linux.so.2 -L/usr/bin/../lib -
L/usr/bin/../gcc/lib --dynamic-linker /lib/ld-uClibc.so.0 -rpath-link 
/usr/bin/../lib /usr/bin/../lib/crti.o /usr/bin/../gcc/lib/crtbegin.o 
/usr/bin/../lib/crt1.o /tmp/ccbzhbPt.o -lgcc --as-needed -lgcc_s --no-as-
needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed 
/usr/bin/../gcc/lib/crtend.o /usr/bin/../lib/crtn.o
/usr/bin/../lib/crt1.o: In function `_start':
(.text+0x24): undefined reference to `_init'
/usr/bin/../lib/crt1.o: In function `_start':
(.text+0x28): undefined reference to `_fini'
collect2: ld returned 1 exit status
distcc[826] ERROR: compile usr/src/thread-hello2.c on localhost failed
/ # 

As you can see, collect2 is linking in crti.o, crtbegin,o, crt1,o, crtend.o, 
and crtn.o.  I checked that all of those files exist at those paths.

> Anyway the _init and _fini symbols are defined in /usr/lib/crti.o.

That would be why I posted assembly dumps of crti.o at the start of this 
thread, yes.

According to objdump -d, the versions defined in those files do not seem to 
have _ at the start of their names, they have . instead.  I do not understand 
why.

Rob
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to