[uClibc]crtbegin.o/crtend.o?

Erik Andersen andersen at codepoet.org
Fri Oct 11 10:46:58 UTC 2002


On Fri Oct 11, 2002 at 04:03:31PM +0900, Miles Bader wrote:
> I recently tried installing a new uClibc and now my builds are failing
> with error messages like this:
> 
>    flatgcc -o maltest-sbrk maltest.o maltest-linear.o maltest-sbrk-malloc.o maltest-sbrk-free.o maltest-sbrk-realloc.o maltest-sbrk-memalign.o maltest-sbrk-heap_alloc.o maltest-sbrk-heap_free.o maltest-sbrk-heap_alloc_at.o maltest-sbrk-heap_debug.o
>    v850e-elf-gcc: /proj/soft2/uclinux/i386-pc-linux-gnu/lib/gcc-lib/v850e-elf/2.9-v850ice-000414/crtbegin.o: No such file or directory
>    v850e-elf-gcc: /proj/soft2/uclinux/i386-pc-linux-gnu/lib/gcc-lib/v850e-elf/2.9-v850ice-000414/crtend.o: No such file or directory

Hi Miles.

> 
> I can avoid this by specifying `--uclibc-no-ctors', but I wonder:
> 
>   * Am I supposed to have a crtbegin.o and crtend.o somewhere?
>
>   * If so, where (and who's supposed to be installing them)?

crtbegin.o and crtend.o are for constructors and destructor
support, and are provided by gcc.  For some reason your system is
not including the gcc objects into the link.

>   * If not, why isn't --uclibc-no-ctors the default?

It used to be, but I have begun converting architectures over to
properly support ctors/dtors run from ELF shared libs (such as
the need constructor in the pthreads lib), which has necessitated
a change to crt0.S for all arches (but so far the change has only
been made in crt0.S for x86, arm, sh, and mips).  Basically,
arches should be converted to call __uClibc_start_main() from
crt0.S instead of __uClibc_main().  This requires a couple of
extra arguments, but lets the Right Thing(tm) happen when doing
ctors/ctors in the shared lib loader.

Now in your care, where v850e isn't likely to be doing shared
libs soon, you may choose to leave things as-is.  Perhaps then we
need a flag to specify if an arch is going to be doing ELF shared
libs and needs proper ctors/dtor support.   In your case, where
you probably don't need that, --uclibc-no-ctors is going to be
a better default...

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list