Bug#438641: /usr/bin/ld: cannot find -lgcc_s
tag 438641 + moreinfo
reassign 438641 gcc
thanks
please recheck with gcc-4.3 and provide a use case for the request
(using libtool and explicitely specifying -lgcc? why?)
=?UTF-8?Q?Lo=C3=AFc?= Minier writes:
> Package: gcc-4.1
> Version: 4.1.2-15
> Severity: normal
>
> Hi,
>
> I'm trying to build a shared library which is linked statically against
> any lib it needs; the -Wl,-static flag there seems to trigger the
> following error when the -Wl,-z,defs is in place:
> /usr/bin/ld: cannot find -lgcc_s
> collect2: ld returned 1 exit status
>
> Here's a simple C file, foo.c, to reproduce the problem:
> void foo(void) {
> return;
> }
>
> Build with:
> cc -c -o foo.o foo.c
> cc -shared -Wl,-z,defs -o libfoo.so foo.o -Wl,-static
>
> There's no package in the archive providing libgcc_s.a, and I checked
> an old gcc-4.1 build log for i386, and only libgcc_s.so seems to be
> built.
> However, I looked in /usr/lib/gcc/i486-linux-gnu/4.1.3 and found the
> symbol in libgcc_eh.a. After I ran "ln -s libgcc_eh.a libgcc_s.a", I
> could build the above simple program.
>
> I don't know which signification "libgcc_eh" and "libgcc_s" have, but
> it seems to me either gcc should look for libgcc_eh in the above case,
> or that it should build libgcc_s.a, or that it shoud symlink libgcc_s.a
> towards libgcc_eh.a.
Reply to: