From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150082.outbound.protection.outlook.com [40.107.15.82]) by sourceware.org (Postfix) with ESMTPS id 8705E3858D34 for ; Fri, 3 Jul 2020 09:14:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8705E3858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n751xrJOxFLEkqMVXrlNGPUib/Tp/bO9NnFGC5fQthc=; b=nN3uIazpEqP+nchb9orXifiMyukU+5kLcELMwhHhYRKftLvBbl/TZgZVY1T/NsvM6MA0nIe7eyeqT1kIhtdP6Q7dKRCUF4NX6wROhwmI8DJpjW9qcUfXqoYCxIYo3fqF/j+77N9NLliQ2hhNPNQRj53ZZpkvU7fjTOBhGMv/0J0= Received: from AM5PR1001CA0015.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::28) by AM0PR08MB3154.eurprd08.prod.outlook.com (2603:10a6:208:5d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23; Fri, 3 Jul 2020 09:14:28 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:2:cafe::50) by AM5PR1001CA0015.outlook.office365.com (2603:10a6:206:2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23 via Frontend Transport; Fri, 3 Jul 2020 09:14:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Fri, 3 Jul 2020 09:14:26 +0000 Received: ("Tessian outbound 114f46c34313:v62"); Fri, 03 Jul 2020 09:14:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 889ac9bd72b9a4a9 X-CR-MTA-TID: 64aa7808 Received: from 154afc0d0864.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 977F789F-C999-4A03-9DE1-712707CCC788.1; Fri, 03 Jul 2020 09:14:20 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 154afc0d0864.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Jul 2020 09:14:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDZNvQnIjhO/vq60YVPShsy0jDXXALAlZbrkO9VizUAwNErxB+TClDCXFv2uOdXpFGRHZPllmhbqI52YU+NLmWbtqS7SUb2nkr9N6e0Qjk7n5mrVg51ZuU5zMk0dL6dpUvaLnB9z125az1ciS6M2Hdxm0M/8WAAwg9/rgs3Ihdmp/qPKSiyECGN8g1vrS7SqslcOtEF+S0UT85ELf91ThXSoHQVsPLwJdzX0nRa2cSRLut4uVzWOg6psfaZEXBWP0mwt79QCkxr1foe9so3sPbUzrrqivhXtRr1Kzkp5INPxaF1U1mJV31XbVHPFhBlAL4VnWJ2bv1SlmWUNrz4T/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n751xrJOxFLEkqMVXrlNGPUib/Tp/bO9NnFGC5fQthc=; b=BjRbmFp3Gk0Xh9CKqk9bvERKDsgz2UQsDvq6+r3EGNwBHY1Iu84mJfIuwqLWtXWBpgdyu1cZ2P6ZrRv+quMECcl8Fh9bgKkOwkrbbSCjGeTXrQV4Y0lNEMAyuGS0QooyzveDezI6VidbhkE0cMDr3wHec8zeniyoh+DuX6AXj+MYUFUXfxcJMlwUS/ipOQPu5rbSN7qSgjD1ag7NIh2B3ds1JLw6tVDNIc0mE3cvGY6M53WwT4OKOV+FZ2znR4coF668D8+Fu0TgVje0N0UgzW4pJl8aImIzHf6ItzMFAbpcPWxiUr4SluWIMV636dC1AKrGPivoNPel2ketv9Y4Pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n751xrJOxFLEkqMVXrlNGPUib/Tp/bO9NnFGC5fQthc=; b=nN3uIazpEqP+nchb9orXifiMyukU+5kLcELMwhHhYRKftLvBbl/TZgZVY1T/NsvM6MA0nIe7eyeqT1kIhtdP6Q7dKRCUF4NX6wROhwmI8DJpjW9qcUfXqoYCxIYo3fqF/j+77N9NLliQ2hhNPNQRj53ZZpkvU7fjTOBhGMv/0J0= Authentication-Results-Original: rtems.org; dkim=none (message not signed) header.d=none;rtems.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB5000.eurprd08.prod.outlook.com (2603:10a6:20b:e6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Fri, 3 Jul 2020 09:14:19 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::2404:de9f:78c0:313c]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::2404:de9f:78c0:313c%6]) with mapi id 15.20.3153.024; Fri, 3 Jul 2020 09:14:19 +0000 Date: Fri, 3 Jul 2020 10:14:12 +0100 From: Szabolcs Nagy To: Joel Sherrill Cc: Eshan dhawan , Newlib , jeol@rtems.org Subject: Re: [PATCH 1/1] fenv support arm Message-ID: <20200703091411.GA14424@arm.com> References: <20200603174509.18606-1-eshandhawan51@gmail.com> <20200603174509.18606-2-eshandhawan51@gmail.com> <20200702121131.GE22681@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: DM3PR12CA0063.namprd12.prod.outlook.com (2603:10b6:0:56::31) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.53) by DM3PR12CA0063.namprd12.prod.outlook.com (2603:10b6:0:56::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Fri, 3 Jul 2020 09:14:18 +0000 X-Originating-IP: [217.140.106.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 608e3348-3dc6-456f-435b-08d81f317c2e X-MS-TrafficTypeDiagnostic: AM6PR08MB5000:|AM0PR08MB3154: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 045315E1EE X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vLhHfhrcYwO3edV9jlL35pE/zOOXxIh2TSNTGZZzbkIWPIr1wBHPgLNHBCbrlD8t+VSbzrihyXs/khdnmT0/kpnXjDbDgcVXOUqdlvqnh2F76p/rtMPoQIPZM1jPpfYFIkT/o7teY9wHD947yr9mhs3PPqXznKqM23oEDICYdAqR90CpycKEIfk1xJp/giJPWPkS4bn4JZWenXKcVxr6l8j1pwbQ8T/9C1nnl0grgiSFBNG/fkVD8kWU9CmmrZn34YGYeKsmqCLkdno8RjwdgJDlyetVGqFdxl/ipNe+9gaxd9yK0TkcsQ+tV1SmRjE+ X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(396003)(366004)(136003)(346002)(39860400002)(8936002)(2616005)(16526019)(186003)(44832011)(956004)(7696005)(53546011)(52116002)(2906002)(6916009)(8676002)(26005)(316002)(33656002)(5660300002)(66556008)(66476007)(66946007)(36756003)(6666004)(86362001)(1076003)(8886007)(4326008)(83380400001)(54906003)(55016002)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xKaDmtEnhAOWh9JfxJ0J1fgBKcdtKwDT/Iw/mXS7JIFLIQtj2ENsyhzcxdGU+KCZZ1PkKC0w0kol3h6uNAx9ArEu8Awp05Q/eTxeOcanvq3JA8J6JlfafDDfE/AKIvB00SZ9xkrWvdeHvf4t96ToLmnr2lWaEjWpuLkmfIJ3YUguHAjUnSMKKaKViXJhVJ5kZ+Y3XRFPNzbljJLg9e5lAzSLb/R7idHrPilnOEhlhlilju+eLA6KauFJ9FwlAMlWsSwApHVEaxw6X39YIxMxv4N9b35TwwmilwBxatxUgw7ckJ71QRjD4FjLD1RYCwhVoo3y9nZE43rSIUIxbFIotISIwag4Yx5hSrJnhV40r6UlnPVLjmvCiphARPY92eI5ER4ulhyhPULEhXuz/9d+AoNQsNKrQlD/R7KWFN1Y5CxRHDqhhw2r6fih9F1qkSX7JnIef/zIRkniJRHeTbNgbUHMJ4jbmyp7OJcuWonpZGMAYVNsAk32Xd/T1nuLDQk4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5000 Original-Authentication-Results: rtems.org; dkim=none (message not signed) header.d=none;rtems.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(39860400002)(396003)(136003)(46966005)(36906005)(6862004)(7696005)(8676002)(4326008)(82310400002)(356005)(8936002)(81166007)(82740400003)(316002)(2906002)(6666004)(54906003)(55016002)(83380400001)(336012)(107886003)(47076004)(1076003)(44832011)(478600001)(70206006)(33656002)(186003)(70586007)(36756003)(53546011)(86362001)(8886007)(26005)(2616005)(5660300002)(956004)(16526019); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 1e5d4d0c-78ad-4add-d8af-08d81f3177b4 X-Forefront-PRVS: 045315E1EE X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pVmAeV0cL5xA+/gr5qyfCHrO+l53uH+09Vn5LP5q7LFZbpUjcOZ0BIKD5/1iZwBLE6Qe2AvafyQ/SwQ0Ar7wapa7Rfz5d+CL6AqK61sAbjtlNiTGond31lZhMbvRr0rxCaE012p9lB3nhcpI429jwxkTUSjnIxDY5VDjyEKfGJkQdzraWyEGpJt+ltzMEmFLmZ3kHZv86kcNMsRrahkPzw15xjroBm1D3JVCYBZPQKj9cReVyCjb/0gjCCNbay8VzaHCl1EfxcpXmTKddyDfb3Z5Wo3BopRthyDCpxs6OPFQV0X4C/+nKbDwkxKYArkYvnskeFfQaaCAxndDJVM/CVSZ1LZBLkl5G2PBjmf5Nm8BSIQH6Iv7Y8StIF8TZso4a0A27el12hNgNtcjH6TmRQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2020 09:14:26.9370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 608e3348-3dc6-456f-435b-08d81f317c2e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3154 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 03 Jul 2020 09:14:34 -0000 The 07/02/2020 17:33, Joel Sherrill wrote: > Szabolcs, is the code in question compiled with any feature flags set? feature flags are not relevant to my issue. > > I see on Linux that the prototypes would be triggered by _GNU_SOURCE while > in newlib, it is _BSD_SOURCE. Is that possibly contributing? (feenableexcept should be hidden when compiling in standard conform mode, _BSD_VISIBLE is a bit misleading as it is historically a gnu extension not BSD, but it does not matter: _GNU_SOURCE exposes _BSD_VISISBLE code.) > > Can you post a test case? The command line that is failing would also help. the problem is simply that sys/fenv.h has no function declarations at all with hard float abi. (fenv.h still has declarations but only the standard apis) e.g. echo '#include void *p = (void*)feenableexcept;' | \ arm-none-eabi-gcc -march=armv5te+fp -mfloat-abi=hard -include fenv.h -xc -c - :2:16: error: 'feenableexcept' undeclared here (not in a function); did you mean 'feraiseexcept'? echo '#include void *p = (void*)feraiseexcept;' | \ arm-none-eabi-gcc -march=armv5te+fp -mfloat-abi=hard -include fenv.h -xc -c - :2:16: error: 'feraiseexcept' undeclared here (not in a function) > > I'd like to not guess at what's wrong. i can submit a patch for removing the VFP ifndef but i wanted to understand why is it there? > > --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 > > --