From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B6673858D32; Tue, 26 Dec 2023 13:13:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B6673858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703596408; bh=a0QynkKLdfhxyusGTXJp/lwiVsEoBW+ZiShe4Ec/c7Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EeNSE1R6UjSomOC0IE1EofCtyusAZjeTZdkZN2Mvc85vmVZ2HgobAgIVTToOlIc2+ EVIuxKdnmliGiDJkD/eZFkJi0UehqKtVQVT6uKvIJtKntiZtSJz4WkF8cIay8lJ1j/ W+y2CrmXGVJ40lMMnOvuMngaBertfbAENn/7A3yw= From: "kallisti5 at unixzen dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug go/113143] Remove usage of ucontext.h Date: Tue, 26 Dec 2023 13:13:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: go X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kallisti5 at unixzen dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ian at airs dot com X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113143 --- Comment #3 from Alexander von Gluck --- Good call out. It looks like in 2004 these functions were flagged as obsolescent though: https://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html Here's the note on it in the linux man page for getcontext: " glibc 2.1. SUSv2, POSIX.1-2001. Removed in POSIX.1-2008, citing portability issues, and recommending that applications be rewritten to use POSIX threads instead. " upstream go usage: * makecontext: no code matches as of go 1.22 (main) * getcontext: netbsd,solaris,freebsd code usage as of go 1.22 (main) * setcontext: netbsd,freebsd code usages as of go 1.22 (main) * swapcontext: freebsd code usages as of go 1.22 (main) Per the 2004 spec: "The obsolescent functions getcontext(), makecontext(), and swapcontext() c= an be replaced using POSIX threads functions." Essentially, for quite some time, (get|make|set)context are only used on the BSD's and Solaris... thus invocation of include should be guard= ed / masked off on all other platforms.=