From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id E0710383F876 for ; Tue, 1 Sep 2020 18:04:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0710383F876 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sebastian.huber@embedded-brains.de Received: from sslproxy03.your-server.de ([88.198.220.132]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1kDAdf-0005dz-H1; Tue, 01 Sep 2020 20:04:11 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy03.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1kDAdf-0001DW-Du; Tue, 01 Sep 2020 20:04:11 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id E04EF2A1610; Tue, 1 Sep 2020 20:04:12 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RpoHoxaEIcaa; Tue, 1 Sep 2020 20:04:12 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id DA78C2A165B; Tue, 1 Sep 2020 20:04:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kCfmZT58Q1-8; Tue, 1 Sep 2020 20:04:11 +0200 (CEST) Received: from shuber-nb-linux.eb.localhost (unknown [10.10.171.22]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 6B1842A1610; Tue, 1 Sep 2020 20:04:11 +0200 (CEST) Subject: Re: [PATCH 0/3] ARM with only 32-bit floats do not have fast 64-bit FMA From: Sebastian Huber To: Keith Packard , newlib@sourceware.org References: <20200808223413.4015633-1-keithp@keithp.com> <1fc07c90-694b-01ea-cedc-0656eccdd827@embedded-brains.de> Message-ID: Date: Tue, 1 Sep 2020 20:04:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.102.4/25917/Tue Sep 1 15:24:01 2020) X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, NICE_REPLY_A, 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 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: Tue, 01 Sep 2020 18:04:14 -0000 On 01/09/2020 19:21, Sebastian Huber wrote: > On 01/09/2020 18:32, Sebastian Huber wrote: > >> Hello, >> >> with the latest Newlib, I get a linker error in the RTEMS test suite: >> >> >> undefined reference to `fma' >> undefined reference to `fmaf' >> >> The following machine flags are used: >> >> '-march=3Darmv7-a', '-mthumb', '-mfpu=3Dneon', '-mfloat-abi=3Dhard',=20 >> '-mtune=3Dcortex-a9' >> >> It seems to be missing in the corresponding multilib: >> >> nm /build/rtems/6/arm-rtems6/lib/thumb/armv7-a+simd/hard/libm.a |=20 >> grep fma >> lib_a-fmal.o: >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 U fma >> 00000000 T fmal >> lib_a-fmaxl.o: >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 U fmax >> 00000000 T fmaxl >> lib_a-s_fma.o: >> lib_a-s_fmax.o: >> 00000000 T fmax >> lib_a-sf_fma.o: >> lib_a-sf_fmax.o: >> 00000000 T fmaxf >> > It seems to be present in only some multilibs: > > for i in $(find /build/rtems/6/arm-rtems6/lib -name libm.a); do echo=20 > $i ; nm --defined-only $i | grep 'T.*\'; done > /build/rtems/6/arm-rtems6/lib/eb/thumb/armv7-r+fp/hard/libm.a > /build/rtems/6/arm-rtems6/lib/eb/thumb/armv7-r/libm.a > /build/rtems/6/arm-rtems6/lib/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m4/hard/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m3/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m7/hard/libm.a > 00000000 T fma > /build/rtems/6/arm-rtems6/lib/thumb/armv6-m/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-r+fp/hard/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-r/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m4+nofp/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-a+simd/hard/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-a/libm.a > /build/rtems/6/arm-rtems6/lib/armv5te+fp/hard/libm.a > > for i in $(find /build/rtems/6/arm-rtems6/lib -name libm.a); do echo=20 > $i ; nm --defined-only $i | grep 'T.*\'; done > /build/rtems/6/arm-rtems6/lib/eb/thumb/armv7-r+fp/hard/libm.a > /build/rtems/6/arm-rtems6/lib/eb/thumb/armv7-r/libm.a > /build/rtems/6/arm-rtems6/lib/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m4/hard/libm.a > 00000000 T fmaf > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m3/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m7/hard/libm.a > 00000000 T fmaf > /build/rtems/6/arm-rtems6/lib/thumb/armv6-m/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-r+fp/hard/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-r/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/cortex-m4+nofp/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-a+simd/hard/libm.a > /build/rtems/6/arm-rtems6/lib/thumb/armv7-a/libm.a > /build/rtems/6/arm-rtems6/lib/armv5te+fp/hard/libm.a I think the problem is somewhere in the build system: find -name s_fma.c ./newlib/libm/machine/arm/s_fma.c ./newlib/libm/machine/aarch64/s_fma.c ./newlib/libm/machine/riscv/s_fma.c ./newlib/libm/machine/spu/s_fma.c ./newlib/libm/common/s_fma.c I guess the machine-specific file overrides the common file. If the=20 machine-specific file is empty due to pre-processor magic, then the=20 default implementation is still not present.