From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by sourceware.org (Postfix) with ESMTPS id 28C50385843E for ; Thu, 10 Feb 2022 19:53:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28C50385843E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f170.google.com with SMTP id e17so9579092ljk.5 for ; Thu, 10 Feb 2022 11:53:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Cq3L5jScy+8c3RgIq/6D64c/ECaE3+wo95hVImJg8Kw=; b=zrrPtQtulPtfWwRskV2WeGr82Rjt2Vp8N5wrMPY+4iyVBx5F0zO2zCUFa9jyU+ikfM pEdvfASnr60J3Xv1nCA5Z/3tLvSLLBvSY/BUyUbaaf8zPm1FO234H++Em2rvIZ6BhVkU d64qu/4gc3Oskj+/J9i7n7Wug9XxyvOsqIvRgCl8h8ENAOReRrtEOvxpXEVdBg5PNN9E 4hnitzJwlTOFI6Qy91lJoF9xTWpwmQv9NdoeotSls4dEdnBxFZZfXOW//qSlBUJ9/V6V vsvxSoVh4fWiYmeUtXvSMObrwVJPAyRWLtA2OIqOS9M86nC0wI4PfFfEmm0WmWY88GIy APTw== X-Gm-Message-State: AOAM530BBm2/7pDG9N8ii8Qbn8IBgGIR/ExaXsYQlsaIVvEaQ/aK50pr BPHeGZxsY/I+PzlV56pUi70e3i6/k+Hc+w== X-Google-Smtp-Source: ABdhPJwLoSY3vQdBDNqjLDs1dajJfu/K5rFMjjUuY8yisG0jeL/LAMg7ZF2tvEV1LeXWIH2G57UATg== X-Received: by 2002:a05:651c:39e:: with SMTP id e30mr6112008ljp.60.1644522810509; Thu, 10 Feb 2022 11:53:30 -0800 (PST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id z15sm2889986lfe.89.2022.02.10.11.53.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Feb 2022 11:53:30 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id u6so12477457lfc.3 for ; Thu, 10 Feb 2022 11:53:29 -0800 (PST) X-Received: by 2002:a05:6512:696:: with SMTP id t22mr4729526lfe.633.1644522809762; Thu, 10 Feb 2022 11:53:29 -0800 (PST) MIME-Version: 1.0 References: <20220210055347.24825-1-vapier@gentoo.org> In-Reply-To: Reply-To: joel@rtems.org From: Joel Sherrill Date: Thu, 10 Feb 2022 13:53:18 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] newlib: remove unused fenv flags To: C Howland Cc: Newlib Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3037.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 19:53:34 -0000 On Thu, Feb 10, 2022 at 1:18 PM C Howland wrote: > > On Thu, 10 Feb 2022 at 13:41, Mike Frysinger wrote: > > > On 10 Feb 2022 13:02, C Howland wrote: > > > > On Feb 10 00:53, Mike Frysinger wrote: > > > > > These look like they were just copied & pasted from > > common/Makefile.am. > > > > > The funcs in this dir are all stubs that don't actually call any math > > > > > or builtin functions, and a simple compile shows they produce > > identical > > > > > object code. So delete to simplify the build rules. > > > > > --- > > > > > newlib/libm/fenv/Makefile.am | 3 -- > > > > > newlib/libm/fenv/Makefile.in | 90 > > +++--------------------------------- > > > > > 2 files changed, 6 insertions(+), 87 deletions(-) > > > > > > > > > > diff --git a/newlib/libm/fenv/Makefile.am > > b/newlib/libm/fenv/Makefile.am > > > > > index 50b59004c17e..66755e394cb7 100644 > > > > > --- a/newlib/libm/fenv/Makefile.am > > > > > +++ b/newlib/libm/fenv/Makefile.am > > > > > @@ -6,11 +6,8 @@ src = feclearexcept.c fe_dfl_env.c fegetenv.c > > > > fegetexceptflag.c \ > > > > > fegetround.c feholdexcept.c feraiseexcept.c fesetenv.c \ > > > > > fesetexceptflag.c fesetround.c fetestexcept.c feupdateenv.c > > > > > > > > > > -lib_a_CFLAGS = -fbuiltin -fno-math-errno > > > > > - > > > > > noinst_LIBRARIES = lib.a > > > > > lib_a_SOURCES = $(src) > > > > > -lib_a_CFLAGS += $(AM_CFLAGS) > > > > > > > > > > # A partial dependency list. > > > > > > > > > > -- > > > > > 2.34.1 > > > > > > > > Ok. > > > > > > No, not OK, it doesn't sound like. The fenv functions are all > > > machine-specific and the files in the libm/fenv directory are all stubs > > > (which they clearly state internally). Unless all targets were checked > > > (and it doesn't sound like they were), the conclusion is faulty that no > > > difference happens. Taking away -fbuiltin would definitely break any > > > machine source relying on it, but not the stubs. > > > > you seemed to be confused as to how this works. there is no machine code > > here. there are only stubs. machine code lives under libm/machine/$arch/, > > not under libm/fenv/. compiler flags in one directory only affects files > > in that one directory, they don't propagate out to every other directory in > > the build. > > > > i'll also note that none of the machine code explicitly uses -fno-builtin. > > there is a configure option for it that affects all newlib files instead. > > > > so either cite exactly what doesn't work, or withdraw your objection > > please. > > -mike > > > > Granted, I might be confused as to how this works. I am aware of the > code in the machine directories. What I am not familiar with is whether > the flags in the main tree propagate to the machine directories in any way, > and I thought it would, in possibly 2 ways. > First, would be if a machine directory can override just some files > from the main--as if viewpathed--and this can also apply to the makefile. > (Does the machine directory totally replace the main branch directory, or > can it be supplemental? My impression was a viewpath model, which can be > supplementary or replace all.) If I'm wrong about this, no problem, no > objection for this specific reason. > The second is if the main branch is intended to also be a template for > new machine directories. The C part of it definitely is, but the makefile > does not necessarily fall into that category. So I'll turn that into a > question: if the main branch makefile does not serve as a template for the > machine directories, where would that be? That is, while these arguments > are superfluous in the main dir, should they remain in comments as an aid > to machine developers, in the same manner in which the source code is > annotated? (It's not so much these specific arguments, themselves, but > having an example how ones like this would be added. These particular ones > are reasonable for serving that purpose, however.) The real makefile seems > the best place for this. We could have Makefile.template, or something > along those lines, but the real one is forced to be valid by being used, > while maintaining a separate template would be additional maintenance work. > So if I'm wrong about the viewpathing model, a suggestion: rather > than deleting the lines, comment them out and add some comment text > suitable for a template. If you're amenable to this approach and would > like, I (or possibly Joel if he's interested) could contribute suggested > comments for you to use. One significant purpose for the files in libm/fenv is that is where the documentation for the fenv.h methods comes from. They are not just implementation templates. And I still think they are the default implementation for targets which do not have target specific implementations. All of the architectures that were added by RTEMS GSoC students came from other projects (FreeBSD, NetBSD, etc) and did not use these as templates. --joel > Craig