Bug 13679 - --disable-shared no longer works
Summary: --disable-shared no longer works
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: 2.17
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-10 00:16 UTC by burek021
Modified: 2014-06-27 07:26 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description burek021 2012-02-10 00:16:33 UTC
Hi,

I used the latest git for the source code for glibc (2.15.90) and I used this configure line:

~/glibc-build # ../glibc/configure --enable-static --disable-shared --prefix=/usr/local/glibc-static

(it complained about not recognizing ld, because I'm on debian and using binutils-gold, so I downloaded/compiled gnu binutils and solved that error)

after a successful configure, I ran 'make' and it compiled a lot of stuff and finally gave me this error:

...
gcc -nostdlib -nostartfiles -o /root/git/glibc-build/iconv/iconvconfig      -Wl,-z,relro -Wl,--hash-style=both /root/git/glibc-build/csu/crt1.o /root/git/glibc-build/csu/crti.o `gcc  --print-file-name=crtbegin.o` /root/git/glibc-build/iconv/iconvconfig.o /root/git/glibc-build/iconv/strtab.o /root/git/glibc-build/iconv/xmalloc.o /root/git/glibc-build/iconv/hash-string.o  /root/git/glibc-build/libc.a  -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed /root/git/glibc-build/libc.a -lgcc -Wl,--as-needed -lgcc_s  -Wl,--no-as-needed `gcc  --print-file-name=crtend.o` /root/git/glibc-build/csu/crtn.o
/usr/local/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/root/git/glibc-build/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
make[2]: *** [/root/git/glibc-build/iconv/iconvconfig] Error 1
make[2]: Leaving directory `/root/git/glibc/iconv'
make[1]: *** [iconv/others] Error 2
make[1]: Leaving directory `/root/git/glibc'
make: *** [all] Error 2
glibc-build # 


I'm not sure is it a bug or I'm doing something wrong here. I need to build the static glibc so that I could build static ffmpeg with it, that's my goal.

Anyway, if this is not a bug, I really apologize.
Comment 1 Paul Pluzhnikov 2012-02-11 02:55:10 UTC
FWIW,

1. Glibc developers consider fully-static linking a "step child", and your bug will likely be ignored ...

2. For your stated goal of "static ffmpeg", you don't need to build a --disable-shared glibc.

The regular build already supplies libc.a. Just do "gcc -static ... -o ffmpeg" and be done with it.
Comment 2 burek021 2012-02-13 00:49:56 UTC
Thanks a lot :)
I'll try that :)
Comment 3 H.J. Lu 2012-09-04 23:39:54 UTC
--disable-shared may be useful for porting purpose.