From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9AD543858420; Fri, 12 Nov 2021 12:31:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AD543858420 From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/102992] fortran: redirecting standard out to a file does not work on macOS 12.0 Date: Fri, 12 Nov 2021 12:31:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2021 12:31:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102992 --- Comment #29 from Iain Sandoe --- (In reply to Francois-Xavier Coudert from comment #28) > > Well, unless there's a good reason to have it in a DTOR, it makes for a= more > > robust solution to call it directly (there are various other differences > > that could occur in mixed code bases esp. c++ + fortran even without the > > Darwin21.1 bug). >=20 > Mixed code is in fact the reason why it's in a DTOR and not called at the > end of Fortran main program. We need this clean-up routine to run even wh= en > the main code is not in Fortran, and but Fortran routines are called by > other means (Fortran object files linked, or Fortran-based library loaded= at > run-time). I've posted a fix for this (it is the fix for darwin21 DTORs in general) however CAVEAT : there is No guarantee given by the GCC DTOR machinery about the relative ordering of DTORs between different TUs, my fix will not solve that.=