From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id C56A33858CDA for ; Mon, 26 Sep 2022 07:55:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C56A33858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id BED7CB4B7A; Mon, 26 Sep 2022 09:55:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qkalnAW3_6n0; Mon, 26 Sep 2022 09:55:06 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p5085519d.dip0.t-ipconnect.de [80.133.81.157]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 0F0B2B5213; Mon, 26 Sep 2022 09:55:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1664178906; bh=EOjK+o+4sgP72fB6bSN+KhWrzSma/LOnkoX/iyJe48Q=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lrL1P1OlJ8lyaz6GX4DgK+Q4xJuvxvijzRu8GHtnYwhIfruydqYCS/AVzoMMrBles 8SJj2gUi7MvB1xtYlWozQ8Gnnz0aqv+KkelCIXL02gm5CbZ4sZIFXCoRRm7QhvfmEj k3mZ0nCTL2pbldAtkT7ZlFRSqMUHKY79ZQFQrCwDgwM+bZFB8MvUY0SSHCcEIT48gI ZdCkxgeuPBZDt/m0Dt/aGDRn6UZZ7gGWsoVdJpJ7a3cOhBzZiI+TYrTnWHkgq6QV/j pRcHGrYhGYZRafAS48h3X/b+pU1CdTvB0kDBSkpgWaYQCzvo0QKyA5HQF/o+hngZOg 92E9MOVCiDpxw== From: Rainer Orth To: Jeff Law via Gcc-patches Cc: Jeff Law Subject: Re: [PATCH] Avoid depending on destructor order References: <88e489d8-4248-75de-6e8e-af6f152da61b@in.tum.de> <81a56a51-6f1b-2150-a7bd-1d7d07095b24@gmail.com> Date: Mon, 26 Sep 2022 09:55:05 +0200 In-Reply-To: <81a56a51-6f1b-2150-a7bd-1d7d07095b24@gmail.com> (Jeff Law via Gcc-patches's message of "Sun, 25 Sep 2022 09:29:44 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-3794.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_ASCII_DIVIDERS,SPF_HELO_NONE,SPF_NONE,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: --=-=-= Content-Type: text/plain Hi Jeff, >>> Thanks for the patch. I'll let you and Jason decide which style solution >>> is preferred. >> This also breaks bootstrap on Darwin at least, so an early solution would be >> welcome (the fix here allows bootstrap to continue, testing on-going). >> thanks, > > I'm using it in the automated tester as well -- without all the *-elf > targets would fail to build libgcc. things are even worse on targets that lack constructor priority support, like Solaris 11.3 and Mac OS X 10.7/Darwin 11: In file included from /vol/gcc/src/hg/master/local/libgcc/unwind-dw2-fde-dip.c:97: /vol/gcc/src/hg/master/local/libgcc/unwind-dw2-fde.c:54:1: error: destructor priorities are not supported 54 | release_registered_frames (void) __attribute__ ((destructor (110))); | ^~~~~~~~~~~~~~~~~~~~~~~~~ This is already checked for in libgcc/configure, and the situation handled in libgcc/config/i386/cpuinfo.c. The following patch unbroke bootstrap on both affected targets and I saw no apparent regressions. However, I cannot tell if the destructor priority is actually required for correctness. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=udf.patch diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c --- a/libgcc/unwind-dw2-fde.c +++ b/libgcc/unwind-dw2-fde.c @@ -47,11 +47,17 @@ typedef __UINTPTR_TYPE__ uintptr_type; #ifdef ATOMIC_FDE_FAST_PATH #include "unwind-dw2-btree.h" +#ifdef HAVE_INIT_PRIORITY +#define DESTRUCTOR_PRIORITY (110) +#else +#define DESTRUCTOR_PRIORITY +#endif + static struct btree registered_frames; static bool in_shutdown; static void -release_registered_frames (void) __attribute__ ((destructor (110))); +release_registered_frames (void) __attribute__ ((destructor DESTRUCTOR_PRIORITY)); static void release_registered_frames (void) { --=-=-=--