_dl_app_init_array and _dl_app_fini_array problems

Kevin Day thekevinday at gmail.com
Mon Oct 2 21:11:09 UTC 2006


On 10/2/06, Mike Frysinger <vapier at gentoo.org> wrote:
> On Saturday 30 September 2006 12:10, Kevin Day wrote:
> > On 9/29/06, Mike Frysinger <vapier at gentoo.org> wrote:
> > > On Thursday 28 September 2006 17:41, Kevin Day wrote:
> > > > 1)  libc.so is not a file, but the following:
> > >
> > > as it should be
> >
> > btw, the word "file", I left out the word ELF. ( I had meant to say
> > that it was not an ELF file)
>
> so ?  it's a linker script which is perfectly valid when it comes to linking
Well, the linker is ignoring this script and grabbing the host
libc.so.  Which is my problem with it.

>
> > Why is it set as this?  it is causing my toolchain to improperly link
> > to the host libc instead of the toolchain that I am trying to build.
> > Thus, polluting my entire toolchain.
>
> sounds more like you configured uClibc with incorrect paths ... or you're
> trying to mix development and runtime at the sametime ... i'm just guessing
> though as you've presented a "bug", not the actual problem ...
> -mike

This is a toolchain install so everything is installed in /tools.
So, the files are in /tools/lib.

here are the steps I did:
1) build the basic toolchain files, all with --prefix=/tools
- Thse are the environment variables:
 set +h
 umask 022
 export TO=/tools
 export TA=/mnt/hda/2/
 export LC_ALL=POSIX
 export PATH=$TO/bin:$PATH
 export ldso=$TO/lib/ld-uClibc.so.0
 export target=i686-pc-linux-uclibc
- Installation Order:
 linux-headers
 uClibc (install_dev)
   - make DEVEL_PREFIX=$TO/ RUNTIME_PREFIX=$TO/
SHARED_LIB_LOADER_PREFIX=$TO/lib KERNEL_SOURCE=$TA/usr/include
OPTIMIZATIONS="$CFLAGS"
LIBGCC_DIR=/toolchain/lib/gcc/$target/$VERSION/ install_dev
 gettext
 binutils
 gcc bootstrap 1
 binutils bootstrap 1
 gcc bootstrap 2
 binutils bootstrap 2
 gcc bootstrap 3
 binutils bootstrap 3
- uClibc compiled with the /tools/bin/gcc and installed to PREFIX=/tools
 - make DEVEL_PREFIX=$TO/ RUNTIME_PREFIX=$TO/
SHARED_LIB_LOADER_PREFIX=$TO/lib KERNEL_SOURCE=$TA/usr/include
OPTIMIZATIONS="$CFLAGS" LIBGCC_DIR=$TO/lib/gcc/$target/$VERSION/
CROSS=$target- all
- install gettext again
- adjust toolchain:
 mv -v $TO/bin/ld{-new,}
 ln -vf $TO/bin/$target-ld $TO/$target/bin/ld
- Test for proper toolchain paths:
 echo 'main(){}' | $target-gcc -x c -
 readelf -l a.out | grep ": $TO"
 rm -v a.out
- Attempt to install from adjusted toolchain:
 tcl
 expect
 binutils
 gcc
 gawk
 uClibc
 gettext


This works in 0.9.28.
But not in svn for me.
When I install uClibc, and then remove the "libc.so script" and
replace with a symlink, it then works just as it did in 0.9.28.
(/tools/libc.so -> /tools/libc.so.0)

But I this still leaves me with the _dl_app_init_array and
_dl_app_fini_array problems  that are not getting linked at any point
to the libc.so, thus all apps linking to the libc.so will break when
trying to link due to unitiliazed data: _dl_app_init_array and
_dl_app_fini_array problems.



More information about the uClibc mailing list