Bug 20845 - Unable to build GLIBC with --disable-shared
Summary: Unable to build GLIBC with --disable-shared
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 20846 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-20 06:27 UTC by Alec Ari
Modified: 2019-02-20 08:11 UTC (History)
3 users (show)

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


Attachments
libc-modules.h: No such file or directory (2.50 KB, text/plain)
2016-11-20 06:27 UTC, Alec Ari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Ari 2016-11-20 06:27:53 UTC
Hello everyone, sorry if this is a duplicate bug, the search function wouldn't load for me and "possible duplicates" is showing "data error."

Adding --disable-shared (to make a static C library for sysroot) breaks the build of GLIBC very early on as it fails to generate the libc-modules.h file.

I have looked over commit 130ac68ca25c9aa65e027e3e37337bc048205c69 but was unable to fix the issue. Master branch and gentoo/2.24 both fail for me (haven't tried others.) In the mean time I have built GLIBC for my custom build environment without that option.

Full configure line:

../configure --prefix=/home/<scrubbed>/git-toolchain-bin/usr --with-binutils=/home/<scrubbed>/git-toolchain-bin/usr/bin --with-headers=/home/<scrubbed>/git-toolchain-bin/usr/include --disable-shared

Thank you, and again, sorry for the possible duplicate! Build log attached.

Alec Ari
Comment 1 Florian Weimer 2016-11-22 18:53:04 UTC
*** Bug 20846 has been marked as a duplicate of this bug. ***
Comment 2 rmtaliancich 2019-02-15 04:20:40 UTC
I have this problem aswell.
Comment 3 Alec Ari 2019-02-15 23:21:31 UTC
(In reply to rmtaliancich from comment #2)
> I have this problem aswell.

I'd use musl if you need a static build for now. It's the most stable, working approach. Smaller, designed for static linking, more portable, etc.
Comment 4 Carlos O'Donell 2019-02-20 08:11:56 UTC
We don't have much testing to cover the esoteric build configurations.

Your best bet is to try investigate this yourself and post patches to libc-alpha@sourceware.org for review.

Once you get --disable-shared working cleanly, you should suggest that scripts/build-many-glibcs.py be improved to include at least one x86_64 build configuration with --disable-shared so we can ensure that breakage is detected early.