1

I'm building an LFS system ( refering to LFS 7.2 )

I got this make error while building glibc-2.16.0:

/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make[2]: *** [/mnt/lfs/sources/glibc-build/iconv/iconvconfig] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.16.0/iconv'
make[1]: *** [iconv/others] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.16.0'
make: *** [all] Error 2
lfs:/mnt/lfs/sources/glibc-build$ 

I located the libgcc_s file in three different places:

/usr/lib/libgcc_s-4.7.0-20120507.so.1
/usr/lib/libgcc_s.so.1
/usr/lib/gcc/i686-redhat-linux/4.7.0/libgcc_s.so

I tried overiding the LDFLAGS variable but no success. Can any one please help me with this problem. Or am I missing something? I don't know. Please help guys,

My host system is Fedora 17.

Rikesh
  • 26,156
  • 14
  • 79
  • 87
AniketGM
  • 901
  • 1
  • 9
  • 17

1 Answers1

0

You need to set the LD_LIBRARY_PATH variable. LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories. LDFLAGS would contain options to pass to the linker.

The likely problem is that you don't have /usr/lib/gcc/i686-redhat-linux/4.7.0 in the LD_LIBRARY_PATH. The other two libraries mentioned in /usr/lib/ shall not be picked unless you have a symlink libgcc_s.so in your LD_LIBRARY_PATH that points to one of those.

devnull
  • 118,548
  • 33
  • 236
  • 227