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 3AF0A383B401 for ; Mon, 16 Aug 2021 13:50:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3AF0A383B401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mFd0V-000G2r-Tz; Mon, 16 Aug 2021 15:50:27 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFd0V-000FGJ-Qv; Mon, 16 Aug 2021 15:50:27 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 82A852A1610; Mon, 16 Aug 2021 15:50:27 +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 KdwrXmpXk6IC; Mon, 16 Aug 2021 15:50:27 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3A4D12A165B; Mon, 16 Aug 2021 15:50:27 +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 M5kBs9KtGvZV; Mon, 16 Aug 2021 15:50:27 +0200 (CEST) Received: from shuber-nb-linux.eb.localhost (unknown [10.10.171.10]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 10B672A1610; Mon, 16 Aug 2021 15:50:27 +0200 (CEST) Subject: Re: gcc_assert() and inhibit_libc To: =?UTF-8?Q?Martin_Li=c5=a1ka?= , GCC Development References: <7a2725f1-5f72-f0e6-15a4-84ba31e4d527@embedded-brains.de> <5ccb584d-67b1-67f8-c2ad-72ee1421b146@embedded-brains.de> <95100b45-f2e6-58cd-e77c-ba2026660a45@suse.cz> From: Sebastian Huber Message-ID: <0ef0799c-141a-726e-b467-fcb9cd8aa348@embedded-brains.de> Date: Mon, 16 Aug 2021 15:50:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.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.103.2/26265/Mon Aug 16 10:19:47 2021) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 13:50:39 -0000 On 16/08/2021 14:33, Martin Li=C5=A1ka wrote: > On 8/12/21 4:31 PM, Sebastian Huber wrote: >> This would be suitable for me, however, I am not sure if you want such= =20 >> a customization=C2=A0feature=C2=A0just=C2=A0for=C2=A0a=C2=A0niche=C2=A0= operating=C2=A0system. >=20 > I don't see a reason why not. > Please send a patch. Ok, good. I will try to figure out what can be done. One problem is that=20 tsystem.h is included before tm.h. Independent of this Joseph S. Myers=20 said in the recent patch review with respect to the gcov_type size that=20 removing tm.h from the target libraries is a development goal. I guess we have a couple of options. 1. Detect the presence of __assert_func and add the result to tconfig.h.=20 This can't be a link time check, since libgcc is build before Newlib. 2. Use __builtin_trap() instead of abort() if inhibit_libc is defined.=20 The trap builtin is target-specific. Making this system-specific (in=20 this case RTEMS) could be an issue. 3. Add a new target hook for the gcc_assert() failure. This has the same=20 problem as 2. with respect to customization by system and not architectur= e. 4. Disable gcc_assert() if inhibit_libc is defined. 5. Use builtin __rtems__ define in tsystem.h as a hack. --=20 embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/