Sorry for slacking on this, this has been fixed upstream for a short
while now, and just needs a version bump. The only wrinkle is there's
now an "optional" dependency on gmp at build time, and at runtime if
one wishes to use the sb-gmp contrib module.

On Sun, Sep 15, 2013 at 04:54:19PM +0200, Jérémie Courrèges-Anglas wrote:
> 
> Hi folks,
> 
> here's a diff to correct sbcl's assumptions about struct timeval on
> OpenBSD i386.  The second build just ended, quick testing shows no
> regression.  I've refreshed the existing patches while here.
> 
> ok?
> 
> Questions:
> - is someone here already dealing with upstream?  If no one steps up
>   I'll send them the patch soon (if they fix their DNS problems...)

Fixed upstream already, and in a fairly portable and futureproof way
that avoids those hardcoded struct definitions.

> - I see subdirectories in the source code, named like "mips" or "alpha".
>   Has anyone analyzed the work that should be done to make this port
>   available on more architectures?

It will be a bit of work, I think. The easiest port to start with
would be hppa, I think. Possibly sparc if you can squeeze sbcl into
the virtual address space there. The alpha port of is somewhat
special, and I think would be more work to bring up on openbsd. The
mips port is 32-bit, so it's out unless we get a 32-bit mips platform.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/sbcl/Makefile,v
> retrieving revision 1.19
> diff -u -p -r1.19 Makefile
> --- Makefile  6 Sep 2013 22:16:24 -0000       1.19
> +++ Makefile  15 Sep 2013 11:06:08 -0000
> @@ -2,12 +2,11 @@
>  
>  # not yet ported to other arches
>  ONLY_FOR_ARCHS =     amd64 i386 powerpc
> -BROKEN-i386=         build fails post-64-bit time_t
> -# ^^ logs: http://rhaalovely.net/build-failures/i386/20130901/lang/sbcl.log
>  
>  COMMENT=             compiler and runtime system for ANSI Common Lisp
>  
>  V =                  1.1.8
> +REVISION=            0
>  DISTNAME=            sbcl-${V}-source
>  PKGNAME=             sbcl-${V}
>  WRKDIST=             ${WRKDIR}/sbcl-${V}
> Index: patches/patch-contrib_asdf-module_mk
> ===================================================================
> RCS file: /cvs/ports/lang/sbcl/patches/patch-contrib_asdf-module_mk,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-contrib_asdf-module_mk
> --- patches/patch-contrib_asdf-module_mk      8 Jul 2011 11:42:09 -0000       
> 1.1
> +++ patches/patch-contrib_asdf-module_mk      15 Sep 2013 12:11:41 -0000
> @@ -5,9 +5,9 @@ Fix 'all' target to allow building witho
>  Don't copy every single file when installing the contribs, only the
>  ones that are actually needed to load the system.
>  
> ---- contrib/asdf-module.mk.orig      Mon May  9 04:49:39 2011
> -+++ contrib/asdf-module.mk   Fri Jul  8 13:39:44 2011
> -@@ -25,7 +25,8 @@ endif
> +--- contrib/asdf-module.mk.orig      Sun Jun  2 15:12:39 2013
> ++++ contrib/asdf-module.mk   Sun Sep 15 14:11:33 2013
> +@@ -27,7 +27,8 @@ endif
>   
>   export CC SBCL EXTRA_CFLAGS EXTRA_LDFLAGS
>   
> @@ -15,9 +15,9 @@ ones that are actually needed to load th
>  +all: $(EXTRA_ALL_TARGETS) $(SYSTEM).fasl
>  +$(SYSTEM).fasl:
>       $(MAKE) -C ../asdf
> -     $(SBCL) --eval '(defvar *system* "$(SYSTEM)")' --load ../asdf-stub.lisp 
> --eval '(quit)'
> +     $(SBCL) --eval '(defvar *system* "$(SYSTEM)")' --load ../asdf-stub.lisp 
> --eval '(exit)'
>   
> -@@ -37,5 +38,4 @@ test: all
> +@@ -40,5 +41,4 @@ test: all
>   # KLUDGE: There seems to be no portable way to tell tar to not to
>   # preserve owner, so chown after installing for the current user.
>   install: $(EXTRA_INSTALL_TARGETS)
> Index: patches/patch-make-target-contrib_sh
> ===================================================================
> RCS file: /cvs/ports/lang/sbcl/patches/patch-make-target-contrib_sh,v
> retrieving revision 1.2
> diff -u -p -r1.2 patch-make-target-contrib_sh
> --- patches/patch-make-target-contrib_sh      11 Aug 2012 23:02:23 -0000      
> 1.2
> +++ patches/patch-make-target-contrib_sh      15 Sep 2013 01:47:04 -0000
> @@ -4,9 +4,9 @@ Only run the contrib tests if $RUN_CONTR
>  allows the contribs to be build when USE_SYSTRACE=Yes, and the tests
>  to be run later in do-regress.
>  
> ---- make-target-contrib.sh.orig      Mon Dec  5 00:09:01 2011
> -+++ make-target-contrib.sh   Sat Aug 11 16:55:34 2012
> -@@ -43,6 +43,7 @@ export SBCL SBCL_BUILDING_CONTRIB
> +--- make-target-contrib.sh.orig      Sun Jun  2 15:12:40 2013
> ++++ make-target-contrib.sh   Sun Sep 15 03:26:47 2013
> +@@ -44,6 +44,7 @@ export SBCL SBCL_BUILDING_CONTRIB
>   # as SB-RT and SB-GROVEL, but FIXME: there's probably a better
>   # solution.  -- CSR, 2003-05-30
>   
> @@ -14,7 +14,7 @@ to be run later in do-regress.
>   find contrib/ \( -name '*.fasl' -o \
>                    -name '*.FASL' -o \
>                    -name 'foo.c' -o \
> -@@ -57,6 +58,11 @@ find contrib/ \( -name '*.fasl' -o \
> +@@ -58,6 +59,11 @@ find contrib/ \( -name '*.fasl' -o \
>   
>   find output -name 'building-contrib.*' -print | xargs rm -f
>   
> @@ -26,7 +26,7 @@ to be run later in do-regress.
>   # Ignore all source registries.
>   CL_SOURCE_REGISTRY='(:source-registry :ignore-inherited-configuration)'
>   export CL_SOURCE_REGISTRY
> -@@ -74,7 +80,7 @@ for i in $contribs_to_build; do
> +@@ -75,7 +81,7 @@ for i in $contribs_to_build; do
>       # export INSTALL_DIR=$SBCL_HOME/`basename $i `
>       test -f $i/test-passed && rm $i/test-passed
>       # hack to get exit codes right.
> Index: patches/patch-src_code_unix_lisp
> ===================================================================
> RCS file: patches/patch-src_code_unix_lisp
> diff -N patches/patch-src_code_unix_lisp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_code_unix_lisp  15 Sep 2013 12:18:20 -0000
> @@ -0,0 +1,40 @@
> +$OpenBSD$
> +
> +Cope with 64-bit time_t.
> +
> +--- src/code/unix.lisp.orig  Sun Jun  2 15:12:40 2013
> ++++ src/code/unix.lisp       Sun Sep 15 14:17:59 2013
> +@@ -215,16 +215,19 @@ corresponds to NAME, or NIL if there is none."
> +           (tv-sec time-t)           ; seconds
> +           (tv-usec suseconds-t)))   ; and microseconds
> + 
> +-;; The above definition doesn't work on 64-bit OpenBSD platforms.
> +-;; Both tv_sec and tv_usec are declared as long instead of time_t, and
> +-;; time_t is a typedef for int.
> +-#!+(or openbsd netbsd)
> ++;; The following definition was used on OpenBSD pre-5.5.
> ++;; Both tv_sec and tv_usec were declared as long instead of time_t, and
> ++;; time_t was a typedef for int.
> ++;; Note: time_t is 64-bit on all architectures, starting from OpenBSD 5.5.
> ++;; FIXME: it seems recent NetBSD releases use a 64-bit time_t too.
> ++#!+netbsd
> + (define-alien-type nil
> +   (struct timeval
> +           (tv-sec long)             ; seconds
> +           (tv-usec long)))          ; and microseconds
> + 
> +-#!+win32
> ++;; OpenBSD 5.5 uses this struct layout.
> ++#!+(or win32 openbsd)
> + (define-alien-type nil
> +   (struct timeval
> +           (tv-sec time-t)           ; seconds
> +@@ -948,6 +951,8 @@ avoiding atexit(3) hooks, etc. Otherwise exit(2) is ca
> + ;; Just as with struct timeval, 64-bit OpenBSD has problems with the
> + ;; above definition.  tv_sec is declared as time_t instead of long,
> + ;; and time_t is a typedef for int.
> ++;; Note: time_t is 64-bit on all architectures, starting from OpenBSD 5.5
> ++;; FIXME: it seems recent NetBSD releases use a 64-bit time_t too.
> + #!+(or openbsd netbsd)
> + (define-alien-type nil
> +     (struct timespec

Reply via email to