[Clfs-support] Linkage error when making uClibc-0.9.31

Andrew Bradford bradfa at gmail.com
Wed Mar 30 03:39:17 PDT 2011


On Wed, Mar 30, 2011 at 5:28 AM, Angel Ivan Castell Rovira <
al004140 at gmail.com> wrote:

> but the uClibc compilation with 'make' fails at some linking stage.
>
> * Target architecture:
> $ cat /proc/cpuinfo
> Processor    : ARM920T rev 0 (v4l)
> BogoMIPS    : 199.47
> Features    : swp half thumb
> CPU implementer    : 0x41
> CPU architecture: 4T
> CPU variant    : 0x1
> CPU part    : 0x920
> CPU revision    : 0
>
> * Environ variables for the 'clfs' user:
>
> $ env | grep CLFS
> CLFS_HOST=i486-cross-linux-gnu
> CLFS_TARGET=armv4-linux-uclibc
> CLFS_ARM_ARCH=armv4t
> CLFS_ARM_MODE=arm
> CLFS=/opt/GNU-CPT/
> CLFS_ARCH=arm
> CLFS_ABI=apcs-gnu
> CLFS_ENDIAN=little
> CLFS_FLOAT=soft
>
>
> * Package or section in which the problem was encountered: section 6.11.
> uClibc-0.9.31
>
> * Steps to reproduce the problem (following all the steps in the previous
> book section):
>
> $ wget http://www.uclibc.org/downloads/uClibc-0.9.31.tar.bz2
> $ wget
> http://patches.cross-lfs.org/embedded-dev/uClibc-0.9.31-configs-2.patch
> $ tar xvfj uClibc-0.9.31.tar.bz2
> $ cd uClibc-0.9.31
> $ patch -Np1 -i ../uClibc-0.9.31-configs-2.patch
> $ cp -v clfs/config.${CLFS_ARCH}.${CLFS_ENDIAN} .config
> $ if [ "${CLFS_ABI}" == "aapcs" ] || [ "${CLFS_ABI}" == "aapcs-linux" ];
> then
>       sed -i s/CONFIG_ARM_OABI/CONFIG_ARM_EABI/g .config;
> fi
> $ make oldconfig
> $ make
>
> [...]
> In file included from ./ldso/include/dl-string.h:11:0,
>                  from ./ldso/include/ldso.h:40,
>                  from libc/misc/elf/dl-iterate-phdr.c:16:
> ./ldso/ldso/arm/dl-sysdep.h: In function 'elf_machine_load_address':
> ./ldso/ldso/arm/dl-sysdep.h:119:37: warning: taking address of expression
> of type 'void'
>   CC libc/misc/internals/__uClibc_main.os
>   CC libc/inet/rpc/rpc_thread.os
>   CC libc/stdlib/atexit.os
>   AR cr lib/libc.a
>   STRIP -x -R .note -R .comment lib/libc.a
>   AR cr lib/uclibc_nonshared.a
>   STRIP -x -R .note -R .comment lib/uclibc_nonshared.a
>   AR cr libc/libc_so.a
>   STRIP -x -R .note -R .comment libc/libc_so.a
>   LD libuClibc-0.9.31.so
> libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
> _fpmaxtostr.c:(.text+0xbc): undefined reference to `__nedf2'
> _fpmaxtostr.c:(.text+0xe0): undefined reference to `__eqdf2'
> _fpmaxtostr.c:(.text+0xfc): undefined reference to `__divdf3'
> _fpmaxtostr.c:(.text+0x108): undefined reference to `__ltdf2'
> _fpmaxtostr.c:(.text+0x17c): undefined reference to `__muldf3'
> _fpmaxtostr.c:(.text+0x348): undefined reference to `__gedf2'
> _fpmaxtostr.c:(.text+0x40c): undefined reference to `__fixunsdfsi'
> libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
> __psfs_do_numeric.c:(.text+0x53c): undefined reference to `__truncdfsf2'
> collect2: ld returned 1 exit status
> make: *** [lib/libc.so] Error 1
>
> But that does not fix the problem for me (still the same problem).
>

Ivan,

That's the best problem report I've ever seen!  Thank you for taking the
time to include all the information asked for in the book. :)

When you built GCC-Static, at the bottom of the page, did you do both the:
 make all-gcc all-target-libgcc
and
 make install-gcc install-target-libgcc
?

If so, can you delete your uClibc directories and untar it again, start from
the beginning of the uClibc instructions.  But when you get to the "make
oldconfig" step, instead run "make menuconfig" and go to "Target
Architecture Features and Options" section and deselect "Target CPU has a
floating point unit (FPU)".  Then continue with the "make" step to build
uClibc.  I believe this will force uClibc to perform soft floating point for
you rather than rely on the kernel or a hard FPU.  This might prevent
attempting to link against the f2 and f3 parts of libgcc.

The default config for uClibc in the book right now somewhat assumes that an
FPU is present.  I hadn't realized this.  This might be your issue.  I
believe the undefined references to things ending in f2 or f3 are floating
point items in libgcc (according to: http://embdev.net/topic/129076).

-Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-support-clfs.org/attachments/20110330/92ac896a/attachment-0001.htm>


More information about the Clfs-support mailing list