Bug 46104 - Linker error "cannot find -liberty"
Summary: Linker error "cannot find -liberty"
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.1.2
: P3 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-20 21:10 UTC by Enrico Miglino (aka Alicemirror)
Modified: 2010-10-21 21:30 UTC (History)
3 users (show)

See Also:
Host: Ubuntu 10.04 LT
Target: ARM LPC32xx
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enrico Miglino (aka Alicemirror) 2010-10-20 21:10:53 UTC
This error was received trying to compile sourced for the ARM EABI firmware from Embedded Artists using the gnu toolchain of CodeSourcery G++ Lite for ARM EABI.

The toolchain compile correctly the sources, generate libraries and create object files, but at link time linker reports the following error:

/home/tech/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/bin/ld: cannot find -liberty

The specific linker command from the toolchain commands sequence is the following:

arm-none-eabi-gcc timer_example.o   ../common/crt0_gnu.o  -static -Wl,--start-group /home/tech/CodeSourcery/software/csps/lpc32xx/lib/liblpc32xxgnu.a /home/tech/CodeSourcery/software/csps/lpc32xx/bsps/ea3250/lib/libea3250gnu.a /home/tech/CodeSourcery/software/lpc/lib/liblpcarm926ej-sgnu.a -lgcc -lc -lg -lm -liberty -lstdc++ -lsupc++  -Wl,--end-group  -Xlinker -Map -Xlinker \
	timer.map -Xlinker -T   ../linker/ldscript_ram_gnu.ld   \
	-o timer.elf

After investigations and tests, the problem concerns libiberty library, that is installed in the toolchain of CodeSourcery only as static library and not shared.

Trying to find the library in the host, the result is the following:

$ find / -name *libiberty* -print

/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/lib/libiberty.a
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/sysroot/vfp/lib/libiberty.a
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/lib/libiberty.a
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/arm-none-linux-gnueabi/lib/vfp/libiberty.a
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/lib/libiberty.a
Comment 1 Mark Mitchell 2010-10-21 21:30:39 UTC
This is a packaging question about CodeSourcery's products; it has no relevance to FSF GCC.