[Bug go/113143] Remove usage of ucontext.h

2023-12-29 Thread ian at airs dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #12 from Ian Lance Taylor --- libgo/runtime/runtime.h: #if defined(__x86_64__) && defined(__linux__) && !defined(__CET__) ... #else #define __go_context_t ucontext_t #define __go_getcontext(c) getcontext(c) #define

[Bug go/113143] Remove usage of ucontext.h

2023-12-28 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #11 from Alexander von Gluck --- Hm.. Could you point me to where Linux is using the (get/set/swap)context calls? I still haven't found them in the codebase. I don't want to miss any edge cases if I work up a patch.

[Bug go/113143] Remove usage of ucontext.h

2023-12-27 Thread ian at airs dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #10 from Ian Lance Taylor --- The makecontext/getcontext/setcontext functions are called by libgo on GNU/Linux for all targets other than x86_64. It is not the case that they are used only on *BSD systems. The default gc

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #9 from Alexander von Gluck --- Doing a little research, it looks like complaints of ucontext.h have come up before multiple times: Similar issue on OpenBSD a long time ago:

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #8 from Alexander von Gluck --- Not at all a dumb question :-) I'm working through compiling libgo / gccgo on Haiku.We have our own lovely libc which tests posix compliant. Some historic consideration behind us not having

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #7 from Andrew Pinski --- Let me ask a dumb question, are you porting GCC/gccgo to a libc which does not have ucontext.h ? If so what is the libc my I ask?

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #6 from Alexander von Gluck --- For added clairity. Searching the upstream go sources: ``` grep -R getcontext src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go:// getcontext

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #5 from Alexander von Gluck --- > I understand that makecontext/getcontext/setcontext were removed from POSIX. > However, there is no adequate replacement. Their functionality is absolutely > required for what libgo does. No

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread ian at airs dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #4 from Ian Lance Taylor --- I understand that makecontext/getcontext/setcontext were removed from POSIX. However, there is no adequate replacement. Their functionality is absolutely required for what libgo does. Fortunately

[Bug go/113143] Remove usage of ucontext.h

2023-12-26 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- 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

[Bug go/113143] Remove usage of ucontext.h

2023-12-25 Thread ian at airs dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #2 from Ian Lance Taylor --- Note that except on x86_64 GNU/Linux, libgo requires the makecontext, getcontext, and setcontext functions that are declared in ucontext.h. There is no adequate replacement for those functions on strict

[Bug go/113143] Remove usage of ucontext.h

2023-12-25 Thread kallisti5 at unixzen dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143 --- Comment #1 from Alexander von Gluck --- $ grep -R ucontext.h gcc/libgo gcc/libgo/configure:#include gcc/libgo/configure.ac:#include gcc/libgo/go/runtime/runtime2.go:// _sizeof_ucontext_t is defined by mkrsysinfo.sh from .