From: Andreas Jaeger <aj@suse.de>
To: libc-hacker@sources.redhat.com
Subject: BZ 5012: Add FAQ entry for compiling with optimization
Date: Sat, 27 Oct 2007 15:16:00 -0000 [thread overview]
Message-ID: <87abq4poyw.fsf@suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 2330 bytes --]
The following adds an entry to the FAQ to mention why optimization is
needed for compiling glibc. Ok to commit?
Andreas
2007-10-27 Andreas Jaeger <aj@suse.de>,
Carlos O'Donell <carlos@systemhalted.org>
[BZ #5012]
* FAQ.in: Describe why glibc needs to be compiled with
optimization.
============================================================
Index: FAQ.in
--- FAQ.in 8 Apr 2005 20:59:50 -0000 1.137
+++ FAQ.in 27 Oct 2007 15:14:50 -0000
@@ -387,6 +387,32 @@ yourself. Please remember that for each
patches required to get glibc HEAD into a runnable state. The best course
of action is to determine if you have all the required patches.
+?? Why do I get:
+ `#error "glibc cannot be compiled without optimization"',
+ when trying to compile GNU libc with GNU CC?
+
+{AJ,CO} There are a couple of reasons why the GNU C library will not work
+correctly if it is not complied with optimzation.
+
+In the early startup of the dynamic loader (_dl_start), before
+relocation of the PLT, you cannot make function calls. You must inline
+the functions you will use during early startup, or call compiler
+builtins (__builtin_*).
+
+Without optimizations enabled GNU CC will not inline functions. The
+early startup of the dynamic loader will make function calls via an
+unrelocated PLT and crash.
+
+Without auditing the dynamic linker code it would be difficult to remove
+this requirement.
+
+Another reason is that nested functions must be inlined in many cases to
+avoid executable stacks.
+
+In practice there is no reason to compile without optimizations, therefore
+we require that GNU libc be compiled with optimizations enabled.
+
+
? Installation and configuration issues
?? Can I replace the libc on my Linux system with GNU libc?
@@ -1685,6 +1711,7 @@ Answers were given by:
{AO} Alexandre Oliva, <aoliva@redhat.com>
{BH} Bruno Haible, <haible@clisp.cons.org>
{SM} Steven Munroe, <sjmunroe@us.ibm.com>
+{CO} Carlos O'Donell, <carlos@systemhalted.org>
\f
Local Variables:
mode:outline
--
Andreas Jaeger, Director Platform / openSUSE, aj@suse.de
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Maxfeldstr. 5, 90409 Nürnberg, Germany
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
[-- Attachment #2: Type: application/pgp-signature, Size: 193 bytes --]
next reply other threads:[~2007-10-27 15:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-27 15:16 Andreas Jaeger [this message]
2008-02-22 9:00 ` Andreas Jaeger
2008-02-22 9:09 ` Roland McGrath
2008-02-22 14:34 ` Ulrich Drepper
2008-02-22 14:46 ` Andreas Jaeger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87abq4poyw.fsf@suse.de \
--to=aj@suse.de \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).