From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1693 invoked by alias); 27 Oct 2007 15:16:46 -0000 Received: (qmail 1665 invoked by uid 22791); 27 Oct 2007 15:16:46 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 27 Oct 2007 15:16:43 +0000 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 1560822DCD for ; Sat, 27 Oct 2007 17:16:41 +0200 (CEST) From: Andreas Jaeger To: libc-hacker@sources.redhat.com Subject: BZ 5012: Add FAQ entry for compiling with optimization OpenPGP: id=C272A126; url=http://www.suse.de/~aj/keys.txt Date: Sat, 27 Oct 2007 15:16:00 -0000 Message-ID: <87abq4poyw.fsf@suse.de> User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00023.txt.bz2 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2410 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 , Carlos O'Donell [BZ #5012] * FAQ.in: Describe why glibc needs to be compiled with optimization. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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=20 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. =20 +?? 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.=20 + +Without auditing the dynamic linker code it would be difficult to remove +this requirement.=20 + +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 =20 ?? Can I replace the libc on my Linux system with GNU libc? @@ -1685,6 +1711,7 @@ Answers were given by: {AO} Alexandre Oliva, {BH} Bruno Haible, {SM} Steven Munroe, +{CO} Carlos O'Donell, =0C Local Variables: mode:outline --=20 Andreas Jaeger, Director Platform / openSUSE, aj@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N=FCrnberg) Maxfeldstr. 5, 90409 N=FCrnberg, Germany GPG fingerprint =3D 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 --=-=-= Content-Type: application/pgp-signature Content-length: 193 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHI1ZXOJpWPMJyoSYRAiAYAKCB+nT61QtVLa9SbcWCnkS4Xx6iEgCfejN+ mgSsT270vedeqPXBxGqgO6c= =jbcr -----END PGP SIGNATURE----- --=-=-=--