From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 1BEEC3894438 for ; Thu, 12 Aug 2021 14:08:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1BEEC3894438 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 14101221FB; Thu, 12 Aug 2021 14:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628777306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kOjC8oOkQzbgLSlNmrfTcOlnFGiSBAX5zoul9CHRhNo=; b=tIPR/1TtXES9Gtp6AmKxtkXgDQ/OplZpLvMpi3oOModJ8WXZArW1x0FmUEqFURNaklAIlN 38bFavW5X6r/eI3ktBfD56g7115WJ6LsdwEmy03ybVD40rkKkqG/IfJsPQIydBAc0KusF8 xGAVDKv9bmNpTwQ8/jbm4y4GybyHnWE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628777306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kOjC8oOkQzbgLSlNmrfTcOlnFGiSBAX5zoul9CHRhNo=; b=Y3lsoYSRcZ6m17bsiyTsS9LGH5VtCP44btpgBtE81wJflM81eVwh3OSmQ9VeLHSCjV2ncb 7dewxqccL2aAjoAQ== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 02A0C13A90; Thu, 12 Aug 2021 14:08:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id uR2mNlkrFWGwXgAAGKfGzw (envelope-from ); Thu, 12 Aug 2021 14:08:25 +0000 Subject: Re: gcc_assert() and inhibit_libc To: Sebastian Huber , GCC Development References: <7a2725f1-5f72-f0e6-15a4-84ba31e4d527@embedded-brains.de> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Thu, 12 Aug 2021 16:08:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <7a2725f1-5f72-f0e6-15a4-84ba31e4d527@embedded-brains.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, 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: Thu, 12 Aug 2021 14:08:37 -0000 On 7/21/21 2:44 PM, Sebastian Huber wrote: > Hello, > > while testing this patch > > https://www.google.com/search?client=firefox-b-e&q=gcc+enable_runtime_checking > > I noticed that __gcov_info_to_gcda() uses abort(). This is due to (from tsystem.h): > > #ifdef ENABLE_RUNTIME_CHECKING > #define gcc_assert(EXPR) ((void)(!(EXPR) ? abort (), 0 : 0)) > #else > /* Include EXPR, so that unused variable warnings do not occur.  */ > #define gcc_assert(EXPR) ((void)(0 && (EXPR))) > #endif > > In tsystem.h there is this if inhibit_libc is defined: > > #ifndef abort > extern void abort (void) __attribute__ ((__noreturn__)); > #endif > > Who is supposed to define abort here optionally? Can this be defined for example by a target configuration header like gcc/config/rtems.h? > Apparently, it's a hairy revision: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=7e7de68b8938 What happens now on RTERM where you have inhibit_libc set to true? Do you end up with an undefined symbol? Cheers, Martin