From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16497 invoked by alias); 22 Feb 2008 09:00:45 -0000 Received: (qmail 16480 invoked by uid 22791); 22 Feb 2008 09:00:45 -0000 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Feb 2008 09:00:14 +0000 Received: from Relay1.suse.de (relay-ext.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 4732C3750A for ; Fri, 22 Feb 2008 10:00:11 +0100 (CET) Received: from aj by arthur.inka.de with local (Exim 4.63) (envelope-from ) id 1JSTlI-0006cM-Lo for libc-hacker@sources.redhat.com; Fri, 22 Feb 2008 10:00:08 +0100 From: Andreas Jaeger To: libc-hacker@sources.redhat.com Subject: Re: BZ 5012: Add FAQ entry for compiling with optimization References: <87abq4poyw.fsf@suse.de> OpenPGP: id=C272A126; url=http://www.suse.de/~aj/keys.txt Date: Fri, 22 Feb 2008 09:00:00 -0000 In-Reply-To: <87abq4poyw.fsf@suse.de> (Andreas Jaeger's message of "Sat, 27 Oct 2007 17:16:39 +0200") Message-ID: 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: 2008-02/txt/msg00000.txt.bz2 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2606 Andreas Jaeger writes: > The following adds an entry to the FAQ to mention why optimization is > needed for compiling glibc. Ok to commit? Is it ok to commit this one? Andreas > 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=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, therefo= re > +we require that GNU libc be compiled with optimizations enabled. > + > + > ? Installation and configuration issues >=20=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 Andreas --=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: 188 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFHvo8XOJpWPMJyoSYRAjzxAJ44cKPKehw0TkCEIWBK6fN0hJ+4TgCfcMUZ cc7D6s/ZQgatGbA7ajQ2rDY= =QMWN -----END PGP SIGNATURE----- --=-=-=--