Loading ...
Sorry, an error occurred while loading the content.

io on openbsd - problems installing

Expand Messages
  • nlb0666
    Just getting started at looking at io and thought I d try installing it on my OpenBSD box (Macbook(s) running OpenBSD 4.5 beta). I downloadeded
    Message 1 of 9 , May 5, 2009
    View Source
    • 0 Attachment
      Just getting started at looking at io and thought I'd try installing it on my OpenBSD box (Macbook(s) running OpenBSD 4.5 beta).

      I downloadeded io-fd8745c00b079963c5bc8398f634cc5651b57bbc.tar.gz...

      Untarred etc, gmake'd (make fails, so it looks like a gmake to me)...

      Result is

      <...lots of compilation stuff...>
      cc -MM -MT _build/objs/IoSystem.o -MF _build/objs/IoSystem.d -DINSTALL_PREFIX=\"/usr/local\" -Os -g -Wstrict-prototypes
      -I. -I./source -I../basekit/_build/headers -I../coroutine/_build/headers -I../garbagecollector/_build/headers -DBUILDING_
      IOVM_DLL -c source/IoSystem.c -o _build/objs/IoSystem.o
      source/IoSystem.c:415:2: #error
      gmake[2]: *** [_build/objs/IoSystem.o] Error 1
      gmake[2]: Leaving directory `/tmp/io/libs/iovm'
      gmake[1]: *** [all] Error 2
      gmake[1]: Leaving directory `/tmp/io/libs/iovm'
      gmake: *** [vm] Error 2

      Anyone encountered this or have advice here? A quick look at the code suggests a missing conditional compilation for calculating number of CPUs...
    • Jeremy Tregunna
      OpenBSD should work with the same code for FreeBSD for ncpu’s (I think I wrote this code, but cannot remember now). Just add an && defined(__OpenBSD__) and
      Message 2 of 9 , May 5, 2009
      View Source
      • 0 Attachment
        OpenBSD should work with the same code for FreeBSD for ncpu’s (I think I wrote this code, but cannot remember now). Just add an && defined(__OpenBSD__) and see if that works. 

        On 5-May-09, at 12:11 PM, nlb0666 wrote:

        Just getting started at looking at io and thought I'd try installing it on my OpenBSD box (Macbook(s) running OpenBSD 4.5 beta).

        I downloadeded io-fd8745c00b079963c5bc8398f634cc5651b57bbc.tar.gz...

        Untarred etc, gmake'd (make fails, so it looks like a gmake to me)...

        Result is

        <...lots of compilation stuff...>
        cc -MM -MT _build/objs/IoSystem.o -MF _build/objs/IoSystem.d -DINSTALL_PREFIX=\"/usr/local\" -Os -g  -Wstrict-prototypes  
        -I. -I./source -I../basekit/_build/headers -I../coroutine/_build/headers -I../garbagecollector/_build/headers  -DBUILDING_
        IOVM_DLL  -c source/IoSystem.c -o _build/objs/IoSystem.o
        source/IoSystem.c:415:2: #error
        gmake[2]: *** [_build/objs/IoSystem.o] Error 1
        gmake[2]: Leaving directory `/tmp/io/libs/iovm'
        gmake[1]: *** [all] Error 2
        gmake[1]: Leaving directory `/tmp/io/libs/iovm'
        gmake: *** [vm] Error 2

        Anyone encountered this or have advice here?  A quick look at the code suggests a missing conditional compilation for calculating number of CPUs...



        ------------------------------------

        Yahoo! Groups Links

        <*> To visit your group on the web, go to:
           http://groups.yahoo.com/group/iolanguage/

        <*> Your email settings:
           Individual Email | Traditional

        <*> To change settings online go to:
           http://groups.yahoo.com/group/iolanguage/join
           (Yahoo! ID required)

        <*> To change settings via email:
           mailto:iolanguage-digest@yahoogroups.com
           mailto:iolanguage-fullfeatured@yahoogroups.com

        <*> To unsubscribe from this group, send an email to:
           iolanguage-unsubscribe@yahoogroups.com

        <*> Your use of Yahoo! Groups is subject to:
           http://docs.yahoo.com/info/terms/


        Regards,

        Jeremy Tregunna



      • nlb0666
        Jeremy - thanks for the reply. I through OpenBSD into the overall makefile on the NEEDS_M := FreeBSD etc line (line 10) and that seems to have got past
        Message 3 of 9 , May 6, 2009
        View Source
        • 0 Attachment
          Jeremy - thanks for the reply. I through "OpenBSD" into the overall makefile on the "NEEDS_M := FreeBSD" etc line (line 10) and that seems to have got past that particular problem. I'm not sure if thats what you meant... In any event, there are no specific references to FreeBSD in IoSystem.c to which I could add "or OpenBSD please!"...

          Anyway the overall make still fails, but it gets past the last failure (or fails earlier... looks like later though...)
          It seems it cannot find the coroutine library:

          <...lots of build stuff...>
          cc -shared -L../basekit/_build/dll -L../coroutine/_build/dll -L../garbagecollector/_build/dll _build/objs/*.o -o _build/dll/libiovm.so -lbasekit -lcoroutine -lgarbagecollector
          /usr/bin/ld: cannot find -lcoroutine
          collect2: ld returned 1 exit status
          gmake[2]: *** [_build/dll/libiovm.so] Error 1
          gmake[2]: Leaving directory `/tmp/io/libs/iovm'
          gmake[1]: *** [all] Error 2
          gmake[1]: Leaving directory `/tmp/io/libs/iovm'
          gmake: *** [vm] Error 2

          Trying to build the coroutine library directly yields

          /io/libs/coroutine $ gmake
          cp source/Coro.h _build/headers/Coro.h
          cp source/PortableUContext.h _build/headers/PortableUContext.h
          cp source/PortableUContext386.h _build/headers/PortableUContext386.h
          gmake _build/lib/libcoroutine.a
          gmake[1]: Entering directory `/tmp/io/libs/coroutine'
          cc -MM -MT _build/objs/Coro.o -MF _build/objs/Coro.d -DINSTALL_PREFIX=\"\" -Os -g -Wstrict-prototypes -I. -I./source -I../basekit/_build/headers -DBUILDING_CORO_DLL -c source/Coro.c -o _build/objs/Coro.o
          source/Coro.c:459:2: #error "Coro.c Error: Coro_setup() function needs to be defined for this platform."
          gmake[1]: *** [_build/objs/Coro.o] Error 1
          gmake[1]: Leaving directory `/tmp/io/libs/coroutine'
          gmake: *** [all] Error 2

          ...making me think I'm in IFDEF land again. I didn't find an immediately obvious approach to getting Coro_setup to be defined (ie I looked at the manual compiler flag settings in the overall Makefile for coroutine, but I didn't come up with something in the Coro.c code itself)....

          Advice?

          --- In iolanguage@yahoogroups.com, Jeremy Tregunna <jeremy.tregunna@...> wrote:
          >
          > OpenBSD should work with the same code for FreeBSD for ncpu's (I think
          > I wrote this code, but cannot remember now). Just add an &&
          > defined(__OpenBSD__) and see if that works.
          >
          > On 5-May-09, at 12:11 PM, nlb0666 wrote:
          >
          > > Just getting started at looking at io and thought I'd try installing
          > > it on my OpenBSD box (Macbook(s) running OpenBSD 4.5 beta).
          > >
          > > I downloadeded io-fd8745c00b079963c5bc8398f634cc5651b57bbc.tar.gz...
          > >
          > > Untarred etc, gmake'd (make fails, so it looks like a gmake to me)...
          > >
          > > Result is
          > >
          > > <...lots of compilation stuff...>
          > > cc -MM -MT _build/objs/IoSystem.o -MF _build/objs/IoSystem.d -
          > > DINSTALL_PREFIX=\"/usr/local\" -Os -g -Wstrict-prototypes
          > > -I. -I./source -I../basekit/_build/headers -I../coroutine/_build/
          > > headers -I../garbagecollector/_build/headers -DBUILDING_
          > > IOVM_DLL -c source/IoSystem.c -o _build/objs/IoSystem.o
          > > source/IoSystem.c:415:2: #error
          > > gmake[2]: *** [_build/objs/IoSystem.o] Error 1
          > > gmake[2]: Leaving directory `/tmp/io/libs/iovm'
          > > gmake[1]: *** [all] Error 2
          > > gmake[1]: Leaving directory `/tmp/io/libs/iovm'
          > > gmake: *** [vm] Error 2
          > >
          > > Anyone encountered this or have advice here? A quick look at the
          > > code suggests a missing conditional compilation for calculating
          > > number of CPUs...
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          >
          > Regards,
          >
          > Jeremy Tregunna
          > jeremy.tregunna@...
          >
        • nlb0666
          Hmmm hacked my way through a little more... Seems like OpenBSD needs to be in the same Makefile line for the tools dir as well or the math libraries won t
          Message 4 of 9 , May 6, 2009
          View Source
          • 0 Attachment
            Hmmm hacked my way through a little more... Seems like "OpenBSD" needs to be in the same Makefile line for the tools dir as well or the math libraries won't link. Its not really clear to me why this helped with the number of CPUs issue below, but anyway...

            More seriously it looks like Coro.c is really not set up to result in a compilation that will work for OpenBSD. I tried a rather savage hack - essentially uncommenting the "Coro_Start" function and reusing the old code for Coro_setup for NetBSD as the OpenBSD Coro_Setup function. This compiled (obviously) but since I'm basically guessing here I'm doubtful that its healthy.

            Sure enough, the resultant io binary instantly seg faults....

            Guidance here would be welcome - at least on how to get a reasonably probably workable Coro.c....

            --- In iolanguage@yahoogroups.com, "nlb0666" <me@...> wrote:
            >
            > Jeremy - thanks for the reply. I through "OpenBSD" into the overall makefile on the "NEEDS_M := FreeBSD" etc line (line 10) and that seems to have got past that particular problem. I'm not sure if thats what you meant... In any event, there are no specific references to FreeBSD in IoSystem.c to which I could add "or OpenBSD please!"...
            >
            > Anyway the overall make still fails, but it gets past the last failure (or fails earlier... looks like later though...)
            > It seems it cannot find the coroutine library:
            >
            > <...lots of build stuff...>
            > cc -shared -L../basekit/_build/dll -L../coroutine/_build/dll -L../garbagecollector/_build/dll _build/objs/*.o -o _build/dll/libiovm.so -lbasekit -lcoroutine -lgarbagecollector
            > /usr/bin/ld: cannot find -lcoroutine
            > collect2: ld returned 1 exit status
            > gmake[2]: *** [_build/dll/libiovm.so] Error 1
            > gmake[2]: Leaving directory `/tmp/io/libs/iovm'
            > gmake[1]: *** [all] Error 2
            > gmake[1]: Leaving directory `/tmp/io/libs/iovm'
            > gmake: *** [vm] Error 2
            >
            > Trying to build the coroutine library directly yields
            >
            > /io/libs/coroutine $ gmake
            > cp source/Coro.h _build/headers/Coro.h
            > cp source/PortableUContext.h _build/headers/PortableUContext.h
            > cp source/PortableUContext386.h _build/headers/PortableUContext386.h
            > gmake _build/lib/libcoroutine.a
            > gmake[1]: Entering directory `/tmp/io/libs/coroutine'
            > cc -MM -MT _build/objs/Coro.o -MF _build/objs/Coro.d -DINSTALL_PREFIX=\"\" -Os -g -Wstrict-prototypes -I. -I./source -I../basekit/_build/headers -DBUILDING_CORO_DLL -c source/Coro.c -o _build/objs/Coro.o
            > source/Coro.c:459:2: #error "Coro.c Error: Coro_setup() function needs to be defined for this platform."
            > gmake[1]: *** [_build/objs/Coro.o] Error 1
            > gmake[1]: Leaving directory `/tmp/io/libs/coroutine'
            > gmake: *** [all] Error 2
            >
            > ...making me think I'm in IFDEF land again. I didn't find an immediately obvious approach to getting Coro_setup to be defined (ie I looked at the manual compiler flag settings in the overall Makefile for coroutine, but I didn't come up with something in the Coro.c code itself)....
            >
            > Advice?
            >
            > --- In iolanguage@yahoogroups.com, Jeremy Tregunna <jeremy.tregunna@> wrote:
            > >
            > > OpenBSD should work with the same code for FreeBSD for ncpu's (I think
            > > I wrote this code, but cannot remember now). Just add an &&
            > > defined(__OpenBSD__) and see if that works.
            > >
            > > On 5-May-09, at 12:11 PM, nlb0666 wrote:
            > >
            > > > Just getting started at looking at io and thought I'd try installing
            > > > it on my OpenBSD box (Macbook(s) running OpenBSD 4.5 beta).
            > > >
            > > > I downloadeded io-fd8745c00b079963c5bc8398f634cc5651b57bbc.tar.gz...
            > > >
            > > > Untarred etc, gmake'd (make fails, so it looks like a gmake to me)...
            > > >
            > > > Result is
            > > >
            > > > <...lots of compilation stuff...>
            > > > cc -MM -MT _build/objs/IoSystem.o -MF _build/objs/IoSystem.d -
            > > > DINSTALL_PREFIX=\"/usr/local\" -Os -g -Wstrict-prototypes
            > > > -I. -I./source -I../basekit/_build/headers -I../coroutine/_build/
            > > > headers -I../garbagecollector/_build/headers -DBUILDING_
            > > > IOVM_DLL -c source/IoSystem.c -o _build/objs/IoSystem.o
            > > > source/IoSystem.c:415:2: #error
            > > > gmake[2]: *** [_build/objs/IoSystem.o] Error 1
            > > > gmake[2]: Leaving directory `/tmp/io/libs/iovm'
            > > > gmake[1]: *** [all] Error 2
            > > > gmake[1]: Leaving directory `/tmp/io/libs/iovm'
            > > > gmake: *** [vm] Error 2
            > > >
            > > > Anyone encountered this or have advice here? A quick look at the
            > > > code suggests a missing conditional compilation for calculating
            > > > number of CPUs...
            > > >
            > > >
            > > >
            > > > ------------------------------------
            > > >
            > > > Yahoo! Groups Links
            > > >
            > > >
            > > >
            > >
            > > Regards,
            > >
            > > Jeremy Tregunna
            > > jeremy.tregunna@
            > >
            >
          • Steve Dekorte
            ... If the ucontext is both available and working on OpenBSD, we can just tell the libcoroutine to use it.
            Message 5 of 9 , May 7, 2009
            View Source
            • 0 Attachment
              On 2009-05-06, at 9:01 PM, nlb0666 wrote:
              > Guidance here would be welcome - at least on how to get a reasonably
              > probably workable Coro.c....

              If the ucontext is both available and working on OpenBSD, we can just
              tell the libcoroutine to use it.
            • nlb0666
              As far as I can tell, ucontext is not available on OpenBSD. I tried using a version of libtask from here http://swtch.com/libtask/ but it appears that there
              Message 6 of 9 , May 7, 2009
              View Source
              • 0 Attachment
                As far as I can tell, ucontext is not available on OpenBSD. I tried using a version of libtask from here http://swtch.com/libtask/ but it appears that there are version differences between that and what io expects (ie struct members have different names etc)

                --- In iolanguage@yahoogroups.com, Steve Dekorte <steve@...> wrote:
                >
                >
                > On 2009-05-06, at 9:01 PM, nlb0666 wrote:
                > > Guidance here would be welcome - at least on how to get a reasonably
                > > probably workable Coro.c....
                >
                > If the ucontext is both available and working on OpenBSD, we can just
                > tell the libcoroutine to use it.
                >
              • nlb0666
                I finally got back to this... Below is the diff that got it working on OpenBSD on the latest build. I haven t attacked the addons yet, and but gmake test
                Message 7 of 9 , Sep 4, 2009
                View Source
                • 0 Attachment
                  I finally got back to this... Below is the diff that got it working on OpenBSD on the latest build. I haven't attacked the addons yet, and but "gmake test" does appear to give the same output on OpenBSD as on my mac.

                  Salient changes:
                  1) Add "OpenBSD" to the Makefile and the tools Makefile where FreeBSD is
                  2) Change the line for the tests from "make test" to "($MAKE) test" (it should be this anyway I believe.
                  3) Add "OpenBSD" to PortableStdint.h where FreeBSD is
                  4) Hack #1 - force USE_SETJMP in the coroutine/Makefile. This should be done with proper platform pragmas but there ya go.
                  5) Hack #2 - hardwire the number of CPUs to 1 in IoSystem.c. This should also be done with proper pragmas
                  6) Add a Coro_setup routine for OpenBSD in Coro.c. I copied the one from DragonFly BSD, but it looks obsolete - there needs (beyond the correct offsets) to be the right elements set up in globalCallbackBlock.

                  So, it ain't pretty (yet), but here it is. I'll post and play with addons as appropriate, and welcome comments/corrections....



                  diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/Makefile io/Makefile
                  10c10
                  < NEEDS_M := FreeBSD Linux NetBSD DragonFly
                  ---
                  > NEEDS_M := FreeBSD Linux NetBSD DragonFly OpenBSD
                  180c180
                  < cd tools; make test
                  ---
                  > cd tools; $(MAKE) test

                  diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/basekit/source/PortableStdint.h io/libs/basekit/source/PortableStdint.h
                  193c193
                  < #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED) || defined(__FreeBSD__)
                  ---
                  > #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED) || defined(__FreeBSD__) || defined(__OpenBSD__)
                  diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/coroutine/Makefile io/libs/coroutine/Makefile
                  7c7
                  < #CFLAGS += -DUSE_SETJMP # method of last resort
                  ---
                  > CFLAGS += -DUSE_SETJMP # method of last resort

                  diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/coroutine/source/Coro.c io/libs/coroutine/source/Coro.c
                  468a469,496
                  > // NLB ... guessing. Check data from here http://state-threads.sourceforge.net/docs/notes.html
                  > // It appears 2 is the SP and probably 0 is the PC just like on DragonFly
                  > // /usr/src/lib/libc/arch/i386/gen/setjmp.S appears to confirm this...
                  > // but I'm segfaulting to an address of 0000, so obviously I'm a but wrong somewhere...
                  > // Current problem looks like "func" is off by 143 bytes/whatever, and I'm landing in the
                  > // wrong spot after the return! So my structure is right, but somehow I have the wrong *func
                  > #elif defined(__OpenBSD__)
                  >
                  > #define buf (self->env)
                  >
                  > void Coro_setup(Coro *self, void *arg)
                  > {
                  > void *stack = Coro_stack(self);
                  > size_t stacksize = Coro_stackSize(self);
                  > void *func = (void *)Coro_Start;
                  >
                  > setjmp(buf);
                  >
                  > buf[2] = (long)(stack + stacksize);
                  > buf[0] = (long)Coro_Start;
                  > // it would seem this needs to have some value??
                  > globalCallbackBlock.context=((CallbackBlock*)arg)->context;
                  > globalCallbackBlock.func=((CallbackBlock*)arg)->func;
                  >
                  > return;
                  > }
                  >
                  >

                  diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/iovm/source/IoSystem.c io/libs/iovm/source/IoSystem.c
                  437,438c437,439
                  < #else
                  < #error
                  ---
                  > // NLB Why give an error? Just let CPUs default to one, no?
                  > // #else
                  > // #error

                  diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/tools/Makefile io/tools/Makefile
                  46c46
                  < NEEDS_M := FreeBSD Linux NetBSD DragonFly
                  ---
                  > NEEDS_M := FreeBSD Linux NetBSD DragonFly OpenBSD


                  --- In iolanguage@yahoogroups.com, "nlb0666" <me@...> wrote:
                  >
                  > As far as I can tell, ucontext is not available on OpenBSD. I tried using a version of libtask from here http://swtch.com/libtask/ but it appears that there are version differences between that and what io expects (ie struct members have different names etc)
                  >
                  > --- In iolanguage@yahoogroups.com, Steve Dekorte <steve@> wrote:
                  > >
                  > >
                  > > On 2009-05-06, at 9:01 PM, nlb0666 wrote:
                  > > > Guidance here would be welcome - at least on how to get a reasonably
                  > > > probably workable Coro.c....
                  > >
                  > > If the ucontext is both available and working on OpenBSD, we can just
                  > > tell the libcoroutine to use it.
                  > >
                  >
                • nlb0666
                  Ooops sorry for the stream of consciousness comments in the Coro.c patch... Obviously I m no longer segfaulting or jumping to the wrong place or I wouldn t
                  Message 8 of 9 , Sep 9, 2009
                  View Source
                  • 0 Attachment
                    Ooops sorry for the stream of consciousness comments in the Coro.c patch... Obviously I'm no longer segfaulting or jumping to the wrong place or I wouldn't have posted the patch!

                    --- In iolanguage@yahoogroups.com, "nlb0666" <me@...> wrote:
                    >
                    > I finally got back to this... Below is the diff that got it working on OpenBSD on the latest build. I haven't attacked the addons yet, and but "gmake test" does appear to give the same output on OpenBSD as on my mac.
                    >
                    > Salient changes:
                    > 1) Add "OpenBSD" to the Makefile and the tools Makefile where FreeBSD is
                    > 2) Change the line for the tests from "make test" to "($MAKE) test" (it should be this anyway I believe.
                    > 3) Add "OpenBSD" to PortableStdint.h where FreeBSD is
                    > 4) Hack #1 - force USE_SETJMP in the coroutine/Makefile. This should be done with proper platform pragmas but there ya go.
                    > 5) Hack #2 - hardwire the number of CPUs to 1 in IoSystem.c. This should also be done with proper pragmas
                    > 6) Add a Coro_setup routine for OpenBSD in Coro.c. I copied the one from DragonFly BSD, but it looks obsolete - there needs (beyond the correct offsets) to be the right elements set up in globalCallbackBlock.
                    >
                    > So, it ain't pretty (yet), but here it is. I'll post and play with addons as appropriate, and welcome comments/corrections....
                    >
                    >
                    >
                    > diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/Makefile io/Makefile
                    > 10c10
                    > < NEEDS_M := FreeBSD Linux NetBSD DragonFly
                    > ---
                    > > NEEDS_M := FreeBSD Linux NetBSD DragonFly OpenBSD
                    > 180c180
                    > < cd tools; make test
                    > ---
                    > > cd tools; $(MAKE) test
                    >
                    > diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/basekit/source/PortableStdint.h io/libs/basekit/source/PortableStdint.h
                    > 193c193
                    > < #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED) || defined(__FreeBSD__)
                    > ---
                    > > #if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED) || defined(__FreeBSD__) || defined(__OpenBSD__)
                    > diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/coroutine/Makefile io/libs/coroutine/Makefile
                    > 7c7
                    > < #CFLAGS += -DUSE_SETJMP # method of last resort
                    > ---
                    > > CFLAGS += -DUSE_SETJMP # method of last resort
                    >
                    > diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/coroutine/source/Coro.c io/libs/coroutine/source/Coro.c
                    > 468a469,496
                    > > // NLB ... guessing. Check data from here http://state-threads.sourceforge.net/docs/notes.html
                    > > // It appears 2 is the SP and probably 0 is the PC just like on DragonFly
                    > > // /usr/src/lib/libc/arch/i386/gen/setjmp.S appears to confirm this...
                    > > // but I'm segfaulting to an address of 0000, so obviously I'm a but wrong somewhere...
                    > > // Current problem looks like "func" is off by 143 bytes/whatever, and I'm landing in the
                    > > // wrong spot after the return! So my structure is right, but somehow I have the wrong *func
                    > > #elif defined(__OpenBSD__)
                    > >
                    > > #define buf (self->env)
                    > >
                    > > void Coro_setup(Coro *self, void *arg)
                    > > {
                    > > void *stack = Coro_stack(self);
                    > > size_t stacksize = Coro_stackSize(self);
                    > > void *func = (void *)Coro_Start;
                    > >
                    > > setjmp(buf);
                    > >
                    > > buf[2] = (long)(stack + stacksize);
                    > > buf[0] = (long)Coro_Start;
                    > > // it would seem this needs to have some value??
                    > > globalCallbackBlock.context=((CallbackBlock*)arg)->context;
                    > > globalCallbackBlock.func=((CallbackBlock*)arg)->func;
                    > >
                    > > return;
                    > > }
                    > >
                    > >
                    >
                    > diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/libs/iovm/source/IoSystem.c io/libs/iovm/source/IoSystem.c
                    > 437,438c437,439
                    > < #else
                    > < #error
                    > ---
                    > > // NLB Why give an error? Just let CPUs default to one, no?
                    > > // #else
                    > > // #error
                    >
                    > diff -r /tmp/stevedekorte-io-d301d39e0d20266d9617624881ef351e4c6a0cb1/tools/Makefile io/tools/Makefile
                    > 46c46
                    > < NEEDS_M := FreeBSD Linux NetBSD DragonFly
                    > ---
                    > > NEEDS_M := FreeBSD Linux NetBSD DragonFly OpenBSD
                    >
                    >
                    > --- In iolanguage@yahoogroups.com, "nlb0666" <me@> wrote:
                    > >
                    > > As far as I can tell, ucontext is not available on OpenBSD. I tried using a version of libtask from here http://swtch.com/libtask/ but it appears that there are version differences between that and what io expects (ie struct members have different names etc)
                    > >
                    > > --- In iolanguage@yahoogroups.com, Steve Dekorte <steve@> wrote:
                    > > >
                    > > >
                    > > > On 2009-05-06, at 9:01 PM, nlb0666 wrote:
                    > > > > Guidance here would be welcome - at least on how to get a reasonably
                    > > > > probably workable Coro.c....
                    > > >
                    > > > If the ucontext is both available and working on OpenBSD, we can just
                    > > > tell the libcoroutine to use it.
                    > > >
                    > >
                    >
                  • Steve Dekorte
                    ... Thanks for the patches! If it s not too much trouble, could create a git repo on github that I could pull them from? Thanks, Steve
                    Message 9 of 9 , Sep 9, 2009
                    View Source
                    • 0 Attachment
                      On 2009-09-09, at 12:36 PM, nlb0666 wrote:
                      > Ooops sorry for the stream of consciousness comments in the Coro.c
                      > patch... Obviously I'm no longer segfaulting or jumping to the wrong
                      > place or I wouldn't have posted the patch!

                      Thanks for the patches! If it's not too much trouble, could create a
                      git repo on github that I could pull them from?

                      Thanks,
                      Steve
                    Your message has been successfully submitted and would be delivered to recipients shortly.