From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by sourceware.org (Postfix) with ESMTPS id 148D43858D37 for ; Tue, 14 Jul 2020 09:35:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 148D43858D37 IronPort-SDR: 6GB5EHVApNsBQ19D7FnzyGmJBDsgj1318RR21gEbVThEFKYyNkbhRk72WrEaMAt998aUvHveMK 2fD9Si2Nu21PokEa8jv3qatBR2bttRp/+go4tznyjNEebxQfmz8tx607MBh8FwRvNPalNJ+3+y tlqr0RD/eU45m7p50GbDiedRWpTC936UM+Ee64a5eVRtw7KeRQNyw8a9QlZEmQk1Wz517Bu6zV zbrU+o41Ko20MtB6zHdyRF0wDX7sRnVTwhmJ6LOjpQXsByK7shNqWg+FC8njZHwQP3FCaiqPQY wdg= X-IronPort-AV: E=Sophos;i="5.75,350,1589212800"; d="scan'208";a="251666859" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 14 Jul 2020 17:35:19 +0800 IronPort-SDR: jP8dejc/gvwijLVWiF15Jf9dmradIwi/YxnekodQaAmsNainpvHT56IpEF174asN/Iqr46bBLO cMQJvWRXecg8sS+q1o28610lnh48u5byw= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 02:23:14 -0700 IronPort-SDR: DUB2iD7zrEs5PXKwte8fCvATtgS3EtOmfdG+hSx/PQ0vjOaukmuuycWr8IxstH0jHQTDyvuRCf X+akYyfPlMtQ== WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 02:35:19 -0700 Date: Tue, 14 Jul 2020 10:35:16 +0100 (BST) From: "Maciej W. Rozycki" To: Richard Biener cc: Andreas Schwab , Florian Weimer , GCC Development , GNU C Library , Alistair Francis , Alistair Francis Subject: Re: RISC-V: `ld.so' fails linking against `libgcc.a' built at `-O0' In-Reply-To: Message-ID: References: <20200622211034.659739-1-alistair.francis@wdc.com> <87366dx35x.fsf@oldenburg2.str.redhat.com> <87sgedvnq3.fsf@oldenburg2.str.redhat.com> <87o8p1vnb9.fsf@oldenburg2.str.redhat.com> <87ftadvmnv.fsf@oldenburg2.str.redhat.com> <87r1txyfew.fsf@igel.home> <87a70lvm48.fsf@oldenburg2.str.redhat.com> <87zh824qom.fsf@igel.home> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 09:35:22 -0000 On Tue, 14 Jul 2020, Richard Biener wrote: > > > Arguably this might probably be called a deficiency in libgcc, however > > > the objects are built with `-fexceptions -fnon-call-exceptions' > > > > I consider that broken. It doesn't make any sense to build a lowlevel > > runtime library like libgcc with exceptions. > > Indeed - you only need to be able to unwind through those, so > -fasynchronous-unwind-tables should be used. This is libgcc's default however, only overridden for a couple of ARM targets, for the very reason to avoid pulling in the unwinder, according to the associated comments. This was added with commit fc6aa0a98a0c some 3 months before commit b932f770f70d added `-fasynchronous-unwind-tables' as a supported compiler option, all back in 2001, so we've had it for quite a while now. The RISC-V target doesn't appear to produce any division overflow traps, which would necessarily have to be arranged by a software convention like with, say, the MIPS target, as the relevant hardware instructions do not trigger an exception under any conditions. By switching to `-fasynchronous-unwind-tables' the ARM override can also go presumably, right? Maciej