From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by sourceware.org (Postfix) with ESMTPS id 9B4E83858D34 for ; Thu, 2 Jul 2020 22:33:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9B4E83858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joel.sherrill@gmail.com Received: by mail-ej1-f67.google.com with SMTP id a1so31678809ejg.12 for ; Thu, 02 Jul 2020 15:33:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=ty2kPF2os7fH0ztL1iGOIaBbrqbSg9pF38PXaxWwhpI=; b=ZekBMw/FzNOTQxBRcUxD8Ti6+8KgDfOJxddooQ21epHC2ot5AtkERf0G7pk2Aw3+5P bKzxP88SDZDYnAu7IZlnJRDu8eT26nykPwjOADHL0mfbBbdQO+sVWTL5qanKDKymuQiV YPWvgROjKbcjLsZgFYt05ijtnpXIrrA9fRUtZfLXUrfgnGsHRD15JkrVM1GbveRephNU pXGOXHXS971uKmfC6zGN7teHCkLREl/jeOoCk1QYNM2Ew7mP4K1zkjPdyxGdkIDVmuQE QtShc1bkRciNv9yk1H5ztbhq06eMU26rlYUhfpOGzhPYqrXtKHZQ0FbABhZhXM9ZSBTr /P0Q== X-Gm-Message-State: AOAM5335NErj2Ge81NlGyQ5NO8WqequwrEC+iHzrMWG2PZ8Dqbfe/mRP JTmUVdydiR8Z86gN9IjrCVgIo0aG X-Google-Smtp-Source: ABdhPJyw0xX8HlCdFuzoX8+BEbwhLYob0UbASMa7BF/6XUUehPSlM4lXUwGdoGXdK7ICoyQBQLEbkA== X-Received: by 2002:a17:906:2ccf:: with SMTP id r15mr30617073ejr.277.1593729213343; Thu, 02 Jul 2020 15:33:33 -0700 (PDT) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com. [209.85.218.42]) by smtp.gmail.com with ESMTPSA id t20sm7734986ejd.124.2020.07.02.15.33.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 15:33:32 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id a1so31678773ejg.12 for ; Thu, 02 Jul 2020 15:33:32 -0700 (PDT) X-Received: by 2002:a17:906:5418:: with SMTP id q24mr29121376ejo.266.1593729212795; Thu, 02 Jul 2020 15:33:32 -0700 (PDT) MIME-Version: 1.0 References: <20200603174509.18606-1-eshandhawan51@gmail.com> <20200603174509.18606-2-eshandhawan51@gmail.com> <20200702121131.GE22681@arm.com> In-Reply-To: Reply-To: joel@rtems.org From: Joel Sherrill Date: Thu, 2 Jul 2020 17:33:21 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] fenv support arm To: Szabolcs Nagy Cc: Eshan dhawan , Newlib , jeol@rtems.org X-Spam-Status: No, score=-3032.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 02 Jul 2020 22:33:36 -0000 Szabolcs, is the code in question compiled with any feature flags set? I see on Linux that the prototypes would be triggered by _GNU_SOURCE while in newlib, it is _BSD_SOURCE. Is that possibly contributing? Can you post a test case? The command line that is failing would also help. I'd like to not guess at what's wrong. --joel On Thu, Jul 2, 2020 at 10:48 AM Joel Sherrill wrote: > > > On Thu, Jul 2, 2020 at 7:11 AM Szabolcs Nagy > wrote: > >> The 06/03/2020 23:15, Eshan dhawan via Newlib wrote: >> > --- /dev/null >> > +++ b/newlib/libc/machine/arm/sys/fenv.h >> ... >> > +#ifndef __ARM_PCS_VFP >> > + >> > +int feclearexcept(int excepts); >> > +int fegetexceptflag(fexcept_t *flagp, int excepts); >> > +int fesetexceptflag(const fexcept_t *flagp, int excepts); >> > +int feraiseexcept(int excepts); >> > +int fetestexcept(int excepts); >> > +int fegetround(void); >> > +int fesetround(int round); >> > +int fegetenv(fenv_t *envp); >> > +int feholdexcept(fenv_t *envp); >> > +int fesetenv(const fenv_t *envp); >> > +int feupdateenv(const fenv_t *envp); >> > +#if __BSD_VISIBLE >> > +int feenableexcept(int __mask); >> > +int fedisableexcept(int __mask); >> > +int fegetexcept(void); >> > +#endif /* __BSD_VISIBLE */ >> > + >> > +#endif /* __ARM_PCS_VFP */ >> >> why are these declarations conditional? >> > > The prototypes for the POSIX methods are in the shared fenv.h. > > Since the ARM has the BSD_VISIBLE extras, those should be left in the arm > specific sys/fenv.h. > > But (I don't think) they need a ARM_PCS_VFP wrapper since there should be > an implementation for all multilibs. We could discuss the BSD_VISIBLE > prototypes being moved to and removed from all the architecture > > but that was also how the code I moved from Cygwin to newlib libm was done > so > maybe there is a reason that I don't know to leave it here. > >> >> i get build failures e.g. in libgfortran >> because configure detects the availability >> of feenableexcept in libm.a so it starts >> using it but then fenv.h does not have the >> declaration so compilation fails. >> >> it seems there is vfp code for all this >> so why are the declarations removed? >> > > The FreeBSD headers rely on the architecture sys/fenv.h prototypes > even for POSIX standard methods. Most of the block of code is removed > because the prototypes were in which is where this file is > included > from. > > Eshan... re-add the BSD_VISIBLE block please and resubmit. It also > looks like the test code isn't exercising those methods so that should > be updated after this patch is updated. We don't want libfortran broken > for longer than neccessary. > > --joel >