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 813B53858D34 for ; Wed, 8 Jul 2020 17:41:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 813B53858D34 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.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jtE46-0004ZP-Cp for newlib@sourceware.org; Wed, 08 Jul 2020 19:41:02 +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 1jtE46-0004rY-8Y for newlib@sourceware.org; Wed, 08 Jul 2020 19:41:02 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id A57822A1610 for ; Wed, 8 Jul 2020 19:41:25 +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 feC9pnFLqDUw for ; Wed, 8 Jul 2020 19:41:25 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 46B492A165B for ; Wed, 8 Jul 2020 19:41:25 +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 F-3ly69_9x_r for ; Wed, 8 Jul 2020 19:41:25 +0200 (CEST) Received: from shuber-nb-linux.eb.localhost (unknown [10.10.171.22]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 1F70C2A1610 for ; Wed, 8 Jul 2020 19:41:25 +0200 (CEST) Subject: Re: fenv() support broken with GCC 10 on ARM From: Sebastian Huber To: Newlib References: <43f454a5-b427-bdcf-b58e-698917f1c290@embedded-brains.de> Message-ID: Date: Wed, 8 Jul 2020 19:41:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.102.3/25867/Wed Jul 8 15:50:39 2020) X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Wed, 08 Jul 2020 17:41:04 -0000 On 08/07/2020 19:26, Sebastian Huber wrote: > On 08/07/2020 15:00, Sebastian Huber wrote: > >> Hello, >> >> I get the following linker errors with GCC and the latest Newlib on ARM: >> >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/bin/ld: >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/lib/thumb/cortex-m3/libm.a(lib_a-fenv-vfp.o):/scratch/git-rtems-source-builder/rtems/build/arm-rtems6-gcc-50666d2-newlib-f095752-x86_64-linux-gnu-1/build/arm-rtems6/thumb/cortex-m3/newlib/targ-include/machine/fenv-softfloat.h:61: >> multiple definition of `__softfloat_float_rounding_mode'; >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/lib/thumb/cortex-m3/libm.a(lib_a-fenv-softfp.o):/scratch/git-rtems-source-builder/rtems/build/arm-rtems6-gcc-50666d2-newlib-f095752-x86_64-linux-gnu-1/build/arm-rtems6/thumb/cortex-m3/newlib/targ-include/machine/fenv-softfloat.h:61: >> first defined here >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/bin/ld: >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/lib/thumb/cortex-m3/libm.a(lib_a-fenv-vfp.o):/scratch/git-rtems-source-builder/rtems/build/arm-rtems6-gcc-50666d2-newlib-f095752-x86_64-linux-gnu-1/build/arm-rtems6/thumb/cortex-m3/newlib/targ-include/machine/fenv-softfloat.h:60: >> multiple definition of `__softfloat_float_exception_mask'; >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/lib/thumb/cortex-m3/libm.a(lib_a-fenv-softfp.o):/scratch/git-rtems-source-builder/rtems/build/arm-rtems6-gcc-50666d2-newlib-f095752-x86_64-linux-gnu-1/build/arm-rtems6/thumb/cortex-m3/newlib/targ-include/machine/fenv-softfloat.h:60: >> first defined here >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/bin/ld: >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/lib/thumb/cortex-m3/libm.a(lib_a-fenv-vfp.o):/scratch/git-rtems-source-builder/rtems/build/arm-rtems6-gcc-50666d2-newlib-f095752-x86_64-linux-gnu-1/build/arm-rtems6/thumb/cortex-m3/newlib/targ-include/machine/fenv-softfloat.h:59: >> multiple definition of `__softfloat_float_exception_flags'; >> /build/rtems/6/lib/gcc/arm-rtems6/10.1.1/../../../../arm-rtems6/lib/thumb/cortex-m3/libm.a(lib_a-fenv-softfp.o):/scratch/git-rtems-source-builder/rtems/build/arm-rtems6-gcc-50666d2-newlib-f095752-x86_64-linux-gnu-1/build/arm-rtems6/thumb/cortex-m3/newlib/targ-include/machine/fenv-softfloat.h:59: >> first defined here > > Affected are ARM and MIPS: > > grep -r 'int __softfloat_float_' . > newlib/libc/machine/arm/machine/fenv-softfloat.h:int > __softfloat_float_exception_flags; > newlib/libc/machine/arm/machine/fenv-softfloat.h:int > __softfloat_float_exception_mask; > newlib/libc/machine/arm/machine/fenv-softfloat.h:int > __softfloat_float_rounding_mode; > newlib/libc/machine/mips/machine/fenv-softfloat.h:int > __softfloat_float_exception_flags; > newlib/libc/machine/mips/machine/fenv-softfloat.h:int > __softfloat_float_exception_mask; > newlib/libc/machine/mips/machine/fenv-softfloat.h:int > __softfloat_float_rounding_mode; > > There needs to be a declaration only in the header file and a > definition somewhere else. No, this is a different issue. These header files are only included in source files: newlib/libm/machine/arm/fenv.c:#include newlib/libm/machine/mips/fenv.c:#include On ARM (not in MIPS) this source file is included in two source files: newlib/libm/machine/arm/fenv-vfp.c:#include "fenv.c" newlib/libm/machine/arm/fenv-softfp.c:#include "fenv.c" Does this make sense? I am not sure what the overall logic is supposed to be.