From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.rbg.tum.de (mailout2.rbg.tum.de [IPv6:2a09:80c0::202]) by sourceware.org (Postfix) with ESMTPS id 4E4983858CDA for ; Mon, 26 Sep 2022 13:15:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E4983858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=in.tum.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=in.tum.de Received: from mailrelay1.rbg.tum.de (mailrelay1.in.tum.de [IPv6:2a09:80c0:254::14]) by mailout2.rbg.tum.de (Postfix) with ESMTPS id C62384C0268; Mon, 26 Sep 2022 15:14:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=in.tum.de; s=20220209; t=1664198098; bh=eI4/ZkDVjsSJGnuubEUyo4cIaihqxj542+RlyEWZL2E=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Priln//yeU7spmZt1ESdBd2fzxQiZUMGCJe6ymBmXGk75q9YKh0665oNjCqaYRZI+ RNvC/VqEB18uE4TBq4FLRxeyzAmyxfi7n1agIeipcCvU4kSQQdIG60D0X1Kzw0LnwJ vIX673FAONu5NEhg80aLZgWB+QgshVRvCJr7q9TslUVx81HSJ6I/jXAqfU49hWnRLU OOVJp6gB42QkL4iuhvr9mlq+7mxtRGUXutm/P1rdldtZvBJWiyCbNgbzhDLv21QWPM 4iBGKT/BeN4ActvVu0b1DS+R1fjDLvZqCRzZO4gNSfqeYqEYucmZ9DcrORogdhurd1 YE3+M5VvEAqWQ== Received: by mailrelay1.rbg.tum.de (Postfix, from userid 112) id BEEA31AA; Mon, 26 Sep 2022 15:14:58 +0200 (CEST) Received: from mailrelay1.rbg.tum.de (localhost [127.0.0.1]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id 8756C1A8; Mon, 26 Sep 2022 15:14:58 +0200 (CEST) Received: from mail.in.tum.de (vmrbg426.in.tum.de [131.159.0.73]) by mailrelay1.rbg.tum.de (Postfix) with ESMTPS id 84776CD; Mon, 26 Sep 2022 15:14:58 +0200 (CEST) Received: by mail.in.tum.de (Postfix, from userid 112) id 808224A02FA; Mon, 26 Sep 2022 15:14:58 +0200 (CEST) Received: (Authenticated sender: neumann) by mail.in.tum.de (Postfix) with ESMTPSA id 43B2B4A0065; Mon, 26 Sep 2022 15:14:58 +0200 (CEST) (Extended-Queue-bit xtech_js@fff.in.tum.de) Message-ID: Date: Mon, 26 Sep 2022 15:14:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] Avoid depending on destructor order Content-Language: en-US To: Iain Sandoe Cc: Claudiu Zissulescu Ianculescu , GCC Patches References: <5aba5553-ed71-50a8-e934-6e94f3a1057e@in.tum.de> <89073F47-E4C1-40A2-B735-9F28764E6EE2@googlemail.com> From: Thomas Neumann In-Reply-To: <89073F47-E4C1-40A2-B735-9F28764E6EE2@googlemail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Iain, > You might also want to include Rainer’s patch, > > AFAIR patches to fix bootstrap are allowed to proceed as an exception to > the usual rules, I was not aware of that. I have pushed the patch below now (including Rainer's change), I will update the code if requested. Best Thomas fix assert in __deregister_frame_info_bases When using the atomic fast path deregistering can fail during program shutdown if the lookup structures are already destroyed. The assert in __deregister_frame_info_bases takes that into account. In the non-fast-path case however is not aware of program shutdown, which caused a compiler error on such platforms. We fix that by introducing a constant for in_shutdown in non-fast-path builds. We also drop the destructor priority, as it is not supported on all platforms and we no longer rely upon the priority anyway. libgcc/ChangeLog: * unwind-dw2-fde.c: Introduce a constant for in_shutdown for the non-fast-path case. Drop destructor priority. diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c index d237179f4ea..3c0cc654ec0 100644 --- a/libgcc/unwind-dw2-fde.c +++ b/libgcc/unwind-dw2-fde.c @@ -51,7 +51,7 @@ static struct btree registered_frames; static bool in_shutdown; static void -release_registered_frames (void) __attribute__ ((destructor (110))); +release_registered_frames (void) __attribute__ ((destructor)); static void release_registered_frames (void) { @@ -67,6 +67,8 @@ static void init_object (struct object *ob); #else +/* Without fast path frame deregistration must always succeed. */ +static const int in_shutdown = 0; /* The unseen_objects list contains objects that have been registered but not yet categorized in any way. The seen_objects list has had