link error to uClibc

Kevin Day thekevinday at gmail.com
Mon Aug 4 13:44:34 UTC 2008


On Mon, Aug 4, 2008 at 5:03 AM, yinjia jia <jiayinjia1983116 at gmail.com> wrote:
> hi,everyone;I am a new commer to uClibc. I have a problem to link to uClibc.
> I used to use snapgear tools to devolop my embedded Linux. originally I use
> uClibc-0.9.27. Now for some reason ,I updated it to 0.9.29, I can
> successfully compile it,but when I build my root file system, there are
> error to link uClibc. I can build root file system successfully with old
> uClibc. any advice will be  appreciated.
>
> My cross compiler is arm-linux-gcc. It have the follow information
>
> root at axa-yinjia:/home/project/tpc66/snapgear# arm-linux-gcc -v
> Reading specs from /usr/local/lib/gcc/arm-linux/3.4.4/specs
> Configured with: ../configure --target=arm-linux --disable-shared
> --prefix=/usr/local
> --with-headers=/home/gerg/new-wave.ixdp425/linux-2.4.x/include --with-gnu-as
> --with-gnu-ld --enable-multilib
> Thread model: posix
> gcc version 3.4.4
>
> this is the error message:
>
> make[4]: Entering directory
> `/home/project/tpc66/snapgear/user/bash/lib/malloc'
> ucfront-gcc arm-linux-gcc -mlittle-endian  -I. -I../.. -I../..
> -I../../include -I../../lib -DHAVE_CONFIG_H -DSHELL  -O1 -pipe -fno-common
> -fno-builtin -Wall  -Dlinux -D__linux__ -Dunix  -DEMBED -I./lib/termcap
> -I../../lib/termcap -DRCHECK -Dbotch=programming_error  -c stub.c
> rm -f libmalloc.a
> arm-linux-ar cr libmalloc.a  stub.o
> test -n "arm-linux-ranlib" && arm-linux-ranlib libmalloc.a
> make[4]: Leaving directory
> `/home/project/tpc66/snapgear/user/bash/lib/malloc'
> rm -f bash
> ucfront-gcc arm-linux-gcc -mlittle-endian -L./builtins -L./lib/readline
> -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -g
> -fno-common -fno-builtin -L./lib/termcap  -rdynamic  -O1 -pipe -fno-common
> -fno-builtin -Wall  -Dlinux -D__linux__ -Dunix  -DEMBED -I./lib/termcap -o
> bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o  dispose_cmd.o
> execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o
> hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o
> test.o version.o alias.o array.o braces.o bracecomp.o bashhist.o bashline.o
> siglist.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o
> pcomplib.o syntax.o xmalloc.o -lbuiltins -lsh -lreadline -lhistory
> ./lib/termcap/libtermcap.a -lglob -ltilde -lmalloc
> /home/project/tpc66/snapgear/uClibc/lib/libc.so.0: undefined reference to
> `_dl_app_init_array'
> /home/project/tpc66/snapgear/uClibc/lib/libc.so.0: undefined reference to
> `dl_iterate_phdr'
> /home/project/tpc66/snapgear/uClibc/lib/libc.so.0: undefined reference to
> `_dl_app_fini_array'
> collect2: ld returned 1 exit status
> make[3]: *** [bash] Error 1
> make[3]: Leaving directory `/home/project/tpc66/snapgear/user/bash'
> make[2]: *** [bash] Error 2
> make[2]: Leaving directory `/home/project/tpc66/snapgear/user'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/project/tpc66/snapgear/user'
> make: *** [subdirs] Error 1
>
>
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://busybox.net/cgi-bin/mailman/listinfo/uclibc
>


Here is a _work_around_:

--- uClibc-20070114/libc/misc/internals/__uClibc_main.c.orig
2007-01-14 12:51:59 -0600
+++ uClibc-20070114/libc/misc/internals/__uClibc_main.c 2007-01-14
12:54:48 -0600
@@ -91,8 +91,8 @@
 /* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation and finalisation
  * is handled by the routines passed to __uClibc_main().  */
 #if defined (__UCLIBC_CTOR_DTOR__) && !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
-extern void _dl_app_init_array(void);
-extern void _dl_app_fini_array(void);
+extern void weak_function _dl_app_init_array(void) attribute_hidden;
+extern void weak_function _dl_app_fini_array(void) attribute_hidden;
 # ifndef SHARED
 /* These magic symbols are provided by the linker.  */
 extern void (*__preinit_array_start []) (void) attribute_hidden;


-- 
Kevin Day



More information about the uClibc mailing list