From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62730 invoked by alias); 20 Jun 2018 12:51:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 62717 invoked by uid 89); 20 Jun 2018 12:51:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=Benson, benson, *c, perfect X-HELO: mail-oi0-f65.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=miPz0AqD5BAAyaI5iwN/LQo9L5kT3O2F4beEBXSaHj0=; b=pfVTDWIjnGvWGwRgv9cN+REe8YhU/A5CqEjyt9LRy8WrF5gCUJTMFJF1Zjbj/98WZI EyopRN6rJUWWWD2IYZf78/QKvgvBgf3yEWHzysliJIK8M2oysHl1FWdEnvalhamDTGnp rJn9TK80e+y6WwjtixqxODvNOx6BHX6SwGTGsWKHyFbPl7kLLTDEzUb3cjfPf9QvbT9Z wBB4VtG7OdI3wjPxffAmek940M38DvFRZ100bSDCPMgLdtzcPDefNvx4Sng+mjdkvCTu OOfyaaa0DmslcunQ0vkvoInhq2HezPr5auUcYd2N9E7q64LwSquELoEIh8r5nfJUhvEs CTaw== X-Gm-Message-State: APt69E0EqcwcQ9GBJddr4FSCR3aSk6keXcnPIFd2s1rfYkiZLDVRillu ezeBjNdXijjzbGLIJGjjYAkOyFxwpIE= X-Google-Smtp-Source: ADUXVKKlr5LJJjhwtJwu9RAuyRDsKZ/3Ms3SFY/Z5uEZTsT7x5LGCIyCm1W90+j8jeu68UCY0TIO0w== X-Received: by 2002:aca:50d2:: with SMTP id e201-v6mr12472238oib.89.1529499069795; Wed, 20 Jun 2018 05:51:09 -0700 (PDT) Subject: Re: Why GLIBC requires compiler optimizations to build To: Gary Benson , "H.J. Lu" Cc: Adhemerval Zanella , GNU C Library References: From: Carlos O'Donell Message-ID: Date: Wed, 20 Jun 2018 12:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-06/txt/msg00606.txt.bz2 On 06/20/2018 06:35 AM, Gary Benson wrote: > On 11 June 2018 at 22:48, H.J. Lu wrote: >> On Mon, Jun 11, 2018 at 2:38 PM, Adhemerval Zanella wrote: >>> It has been some time since I tried to build glibc without optimization >>> as an exercise and I can't really recall what exactly has prevented me >>> to accomplish it. So the question is if it is make sense to add such >>> requirement and if it is the case whether it would be a useful options >>> and what prevents us to do so? >> >> The main issue is to bootstrap ld.so to prevent dynamic relocations >> before it is ready. > > Is it only really elf/rtld.c that specifically requires optimization then? No. The dynamic loader has many functions it needs to execute the early startup. So there are a lot of dependencies on other *.c files here and there, which must be callable directly and not through the PLT. The perfect solution is a refactored build system that can distinguish what is going into rtld that needs optimizations and what is not. Then apply optimizations only to rtld. Even then, for debugging purposes, I have gotten away with using gcc's function attributes to mark some function as -O0 to debug them more easily, otherwise it's very hard to debug and _dl_debug_printf() is your highest value tool. Cheers, Carlos.