This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Can't build Go support in gcc-4.8.1 on OpenBSD
- From: Ian Lance Taylor <iant at google dot com>
- To: niXman <i dot nixman at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Sat, 28 Sep 2013 12:27:17 -0700
- Subject: Re: Can't build Go support in gcc-4.8.1 on OpenBSD
- Authentication-results: sourceware.org; auth=none
- References: <CAMPTgK3hLhc3F_oyPjhGQAwAvb6mv9EVbzkP-vdVs2qwoSpjkw at mail dot gmail dot com>
On Sat, Sep 28, 2013 at 12:20 AM, niXman <i.nixman@gmail.com> wrote:
>
> I successfully build gcc-4.8.1 with c,c++,fortran support on OpenBSD
> pre-5.4 using patches from ports, but I can't build with Go support.
> Also I successfully build gcc-4.6.x with c,c++,fortran,go support.
> The problem is that OpenBSD has no ucontext.h header.
>
> Error message:
> In file included from ../../../../unpack/gcc-4.8.1/libgo/runtime/go-main.c:17:0:
> ../../../../unpack/gcc-4.8.1/libgo/runtime/runtime.h:18:22: fatal
> error: ucontext.h: No such file or directory
> #include <ucontext.h>
> ^
> compilation terminated.
The current implementation of goroutines in gccgo requires the
makecontext, getcontext, and setcontext functions. Those functions
were standardized in POSIX-1.2001 but then removed in POSIX-1.2008
with no replacement. Most systems provide them for backward
compatibility. However, it is possible that OpenBSD does not. I
really don't know.
It's possible to fix this by writing processor-dependent functions
that would serve the same purpose as the *context functions, and in
fact that would be more efficient. But I have not actually done this.
Ian