[Vm-dev] Cog FreeBSD patches

Igor Stasenko siguctua at gmail.com
Mon Mar 21 14:03:26 UTC 2011


On 21 March 2011 14:50, David Graham <dgraham at unthinkable.org> wrote:
>
> Hello,
>
> I've noticed a few emails about running Cog on FreeBSD on some of the other mailing lists and was wondering if it would be possible to get a few patches integrated into the main repository?  Sorry if I'm not following protocol for patch submission or style, I couldn't find any guidelines.  I'd be happy to resubmit if this isn't the place.
>

Hello, David.

You could make things much easier if you could register at gitorious.org and
clone cogvm repository (http://gitorious.org/cogvm)

Then you can have own copy of sources and publish your changes there.
So, then its extremely easy to pick them up and integrate them in a
couple of minutes.

And more important, in a longer perspective it will serve much better:
 - your changes will be recorded (and not lost in mailing list)
 - if you find another bug or two, you already have a place where to
put it and its much easier for others to pick them up..

In addition we can create a separate FreeBSD configuration which could
build VM out of the box (see CMakeVMMaker package).

Another thing which could be done is , if you (or someone else) having
FreeBSD box where you could install Hudson slave software,
then we could add it to our continuous integration setup (see
https://pharo-ic.lille.inria.fr/hudson/view/Cog/), and then you will
have freshly built VMs each time we posting changes to VM.



> With the following patches, Cog r2372 will compile and run on FreeBSD (and PCBSD) 8.2 i386.  I've been able to use Squeak, Pharo, and Seaside images.  Here is the configure line:
>
> ../../platforms/unix/config/configure CFLAGS="-g -O2 -msse2 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DNOEXECINFO -DDEBUGVM=0" LIBS=-lpthread --without-npsqueak
>
> Here is the diff.
> Index: platforms/unix/plugins/SqueakFFIPrims/ffi-config
> ===================================================================
> --- platforms/unix/plugins/SqueakFFIPrims/ffi-config    (revision 2372)
> +++ platforms/unix/plugins/SqueakFFIPrims/ffi-config    (working copy)
> @@ -39,6 +39,7 @@
>
>  case ${abi} in
>     linux)             abi=sysv;;
> +    freebsd)           abi=sysv;;
>     darwin*)           abi=darwin;;
>     *)                 abi=libffi; lib="-lffi";;
>  esac
> Index: platforms/unix/vm/sqUnixMain.c
> ===================================================================
> --- platforms/unix/vm/sqUnixMain.c      (revision 2372)
> +++ platforms/unix/vm/sqUnixMain.c      (working copy)
> @@ -60,6 +60,9 @@
>  # include <execinfo.h>
>  # define BACKTRACE_DEPTH 64
>  #endif
> +#if __FreeBSD__
> +# include <sys/ucontext.h>
> +#endif
>
>  #if defined(__alpha__) && defined(__osf__)
>  # include <sys/sysinfo.h>
> @@ -777,6 +780,9 @@
>  # elif __linux__ && __i386__
>                        void *fp = (void *)(uap ? uap->uc_mcontext.gregs[REG_EBP]: 0);
>                        void *sp = (void *)(uap ? uap->uc_mcontext.gregs[REG_ESP]: 0);
> +# elif __FreeBSD__ && __i386__
> +                       void *fp = (void *)(uap ? uap->uc_mcontext.mc_ebp: 0);
> +                       void *sp = (void *)(uap ? uap->uc_mcontext.mc_esp: 0);
>  # else
>  #      error need to implement extracting pc from a ucontext_t on this system
>  # endif
> Index: platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c
> ===================================================================
> --- platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c        (revision 2372)
> +++ platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c        (working copy)
> @@ -10,7 +10,7 @@
>  *****************************************************************************/
>
>  #include <stdio.h>
> -#if !WIN32
> +#if !WIN32 && !__FreeBSD__
>  # include <alloca.h>
>  #endif
>  #include <string.h>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list