From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101854 invoked by alias); 20 Jun 2018 15:22: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 101839 invoked by uid 89); 20 Jun 2018 15:22:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=*c, perfect, you! X-HELO: mail-yb0-f180.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M7bs7r2JYfO0JCxT7osSAW1bYQSIbQYiUVFSWc8P6x8=; b=HcP6fQuuZfTYFMfdQSHgKq1KA2dY30BY4Accm+wl+e9refH3DG1R80bTmOxr2S1DDb fcBhah3dFkpsR5vegEcBJUKkB47h8fsbn1E27oFFPk3t6DB5bRYc9GgV0xyLR5/uxrLM YNpVaiYYN0S86OZKXKirLdW/VuII448HoFrYln72i/kmTkc9os5SnKPogOE8qgGoCGg8 jbuIdOCy0o3UpqhgnAQ/w9ELv0VHST3nQQE+fHd6j0k40KVml1FumXfoTwWQLXH4Zc6a TUlgAl+DRx65guUn2fmoDEkZn2LMVc08KNJX80qA/H1B0tgfnsRHatyv/eCVJKRFL8j1 6FvA== X-Gm-Message-State: APt69E0gDXewA8e0rAbcacGc4tl9XiGXWVJRynf9D2yu6ZUz4xBZwNGi pE6BzHepJF60a3QvOdM5l8MCpi6v9xpHLvztSxIuPw== X-Google-Smtp-Source: ADUXVKIAE8zuKYDfDabrgZmUr1lhaBSgO9bOW5afjRVCypX0u75bF1RIEfKmKAzfBXloNyFgWYCrCWLcgITxhJu41rk= X-Received: by 2002:a25:260c:: with SMTP id m12-v6mr908385ybm.301.1529508129595; Wed, 20 Jun 2018 08:22:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Gary Benson Date: Wed, 20 Jun 2018 15:22:00 -0000 Message-ID: Subject: Re: Why GLIBC requires compiler optimizations to build To: "Carlos O'Donell" Cc: "H.J. Lu" , Adhemerval Zanella , GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-06/txt/msg00613.txt.bz2 On 20 June 2018 at 13:51, Carlos O'Donell wrote: > 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. Ok. Thanks for explaining this. > 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. I did not know about __attribute__ ((optimize ())), thank you! Gary