public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* BZ 5012: Add FAQ entry for compiling with optimization
@ 2007-10-27 15:16 Andreas Jaeger
  2008-02-22  9:00 ` Andreas Jaeger
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Jaeger @ 2007-10-27 15:16 UTC (permalink / raw)
  To: libc-hacker

[-- 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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-22 14:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-27 15:16 BZ 5012: Add FAQ entry for compiling with optimization Andreas Jaeger
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

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).