build fails on OSX 10.6 (snow leopard)

Bug #393845 reported by Beef
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
High
Cyrus Harmon

Bug Description

sh make.sh on the current latest cvs revision returns an error on the backtrace.c compilation with gcc i686-apple-darwin10-gcc-4.2.1.
I am working on the latest beta version of Snow Leopard OSX (June 8th).

uname -a:

Darwin ******.vub.ac.be 10.0.0b1 Darwin Kernel Version 10.0.0b1: Fri May 29 00:02:02 PDT 2009; root:xnu-1456~1/RELEASE_I386 i386

The current working revision for backtrace.c is 1.45

gcc version:

Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10

make output:

//entering make-target-1.sh
//building runtime system and symbol table file
rm -f *.[do] sbcl sbcl.nm sbcl.h core *.tmp
echo '#include "genesis/config.h"' >sbcl.h
echo '#include "genesis/constants.h"' >>sbcl.h
In file included from darwin-os.c:21:
/usr/include/ucontext.h:42:2: error: #error ucontext routines are deprecated, and require _XOPEN_SOURCE to be defined
gcc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4 -I. -no-cpp-precomp -c -o alloc.o alloc.c
In file included from alloc.c:21:
runtime.h: In function 'CONS':
runtime.h:151: warning: cast to pointer from integer of different size
runtime.h: In function 'SYMBOL':
runtime.h:157: warning: cast to pointer from integer of different size
runtime.h: In function 'FDEFN':
runtime.h:163: warning: cast to pointer from integer of different size
gcc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4 -I. -no-cpp-precomp -c -o backtrace.o backtrace.c
In file included from backtrace.c:19:
runtime.h: In function 'CONS':
runtime.h:151: warning: cast to pointer from integer of different size
runtime.h: In function 'SYMBOL':
runtime.h:157: warning: cast to pointer from integer of different size
runtime.h: In function 'FDEFN':
runtime.h:163: warning: cast to pointer from integer of different size
/var/folders/Xl/XlQeJ38BFsitkLrLLB5-OU+++TI/-Tmp-//ccy8ZPrF.s:851:suffix or operands invalid for `mov'
make: *** [backtrace.o] Error 1

I tried adding the -D_XOPEN_SOURCE, -D_XOPEN_SOURCE=600 and -m32 flags to the CFLAGS

-D_XOPEN_SOURCE changes nothing to the above error.

-D_XOPEN_SOURCE=600 changes the output to:

produces the following output:
//entering make-target-1.sh
//building runtime system and symbol table file
rm -f *.[do] sbcl sbcl.nm sbcl.h core *.tmp
echo '#include "genesis/config.h"' >sbcl.h
echo '#include "genesis/constants.h"' >>sbcl.h
In file included from darwin-os.c:21:
/usr/include/ucontext.h:42:2: error: #error ucontext routines are deprecated, and require _XOPEN_SOURCE to be defined
gcc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4 -D_XOPEN_SOURCE=600 -I. -no-cpp-precomp -c -o alloc.o alloc.c
In file included from alloc.c:21:
runtime.h: In function 'CONS':
runtime.h:151: warning: cast to pointer from integer of different size
runtime.h: In function 'SYMBOL':
runtime.h:157: warning: cast to pointer from integer of different size
runtime.h: In function 'FDEFN':
runtime.h:163: warning: cast to pointer from integer of different size
In file included from thread.h:20,
                 from alloc.c:26:
interrupt.h: In function 'sigcopyset':
interrupt.h:32: error: 'NSIG' undeclared (first use in this function)
interrupt.h:32: error: (Each undeclared identifier is reported only once
interrupt.h:32: error: for each function it appears in.)
interrupt.h: At top level:
interrupt.h:102: error: 'NSIG' undeclared here (not in a function)
make: *** [alloc.o] Error 1

Adding -m32 changes nothing to the above:

//entering make-target-1.sh
//building runtime system and symbol table file
rm -f *.[do] sbcl sbcl.nm sbcl.h core *.tmp
echo '#include "genesis/config.h"' >sbcl.h
echo '#include "genesis/constants.h"' >>sbcl.h
In file included from darwin-os.c:21:
/usr/include/ucontext.h:42:2: error: #error ucontext routines are deprecated, and require _XOPEN_SOURCE to be defined
gcc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4 -D_XOPEN_SOURCE=600 -m32 -I. -no-cpp-precomp -c -o alloc.o alloc.c
In file included from thread.h:20,
                 from alloc.c:26:
interrupt.h: In function 'sigcopyset':
interrupt.h:32: error: 'NSIG' undeclared (first use in this function)
interrupt.h:32: error: (Each undeclared identifier is reported only once
interrupt.h:32: error: for each function it appears in.)
interrupt.h: At top level:
interrupt.h:102: error: 'NSIG' undeclared here (not in a function)

Beef (yvdriess)
description: updated
tags: added: build
description: updated
description: updated
Beef (yvdriess)
description: updated
summary: - source build error in backtrace.c on OSX
+ build fails on OSX 10.6 (snow leopard)
Beef (yvdriess)
description: updated
Changed in sbcl:
status: New → Confirmed
importance: Undecided → High
tags: added: os-darwin
Revision history for this message
Luís Oliveira (luismbo) wrote :
Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :

So there are a few problems:

1. #include <ucontext.h> should go away
2. need -arch i386 in Config.x86-darwin

these are fixed in the patch.

also, the following problems still exist:

3. build failures in sb-posix
4. sb-bsd-socket memory fault errors when calling sb-bsd-sockets:get-address-info

Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :

Here's a backtrace for the sb-bsd-socket:get-address-info error. perhaps this should be moved to its own bug.

debugger invoked on a SB-SYS:MEMORY-FAULT-ERROR in thread #<THREAD "initial thread" RUNNING {119D1CA9}>:
  Unhandled memory fault at #xB.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-SYS:MEMORY-FAULT-ERROR)
0] :backtrace

0: (SB-SYS:MEMORY-FAULT-ERROR)
1: ("foreign function: call_into_lisp")
2: ("foreign function: call_into_lisp_tramp")
3: (SB-SYS:SAP-REF-8
    :INVALID-VALUE-FOR-UNESCAPED-REGISTER-STORAGE
    :INVALID-VALUE-FOR-UNESCAPED-REGISTER-STORAGE)
4: (SB-EVAL::EVAL-ARGS
    ((SB-SYS:SAP-REF-8 SB-ALIEN::SAP (/ SB-ALIEN::OFFSET SB-VM:N-BYTE-BITS))
     '#<SB-ALIEN-INTERNALS:ALIEN-INTEGER-TYPE (UNSIGNED 8)>)
    #<SB-EVAL::ENV {12522A31}>)
5: (SB-EVAL::%EVAL
    (SB-ALIEN-INTERNALS:NATURALIZE
     (SB-SYS:SAP-REF-8 SB-ALIEN::SAP (/ SB-ALIEN::OFFSET SB-VM:N-BYTE-BITS))
     '#<SB-ALIEN-INTERNALS:ALIEN-INTEGER-TYPE (UNSIGNED 8)>)
    #<SB-EVAL::ENV {12522A31}>)
6: (SB-ALIEN-INTERNALS:EXTRACT-ALIEN-VALUE
    #.(SB-SYS:INT-SAP #X0000000B)
    0
    #<SB-ALIEN-INTERNALS:ALIEN-INTEGER-TYPE (UNSIGNED 8)>)
7: (SB-BSD-SOCKETS::NATURALIZE-UNSIGNED-BYTE-8-ARRAY
    #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X0000000B :TYPE (ARRAY (UNSIGNED 8)
                                                            4)>
    4)
8: (SB-BSD-SOCKETS::GET-ADDRESS-INFO "127.0.0.1")
9: (SWANK-BACKEND::RESOLVE-HOSTNAME "127.0.0.1")
10: ((LAMBDA (SWANK-BACKEND::HOST SWANK-BACKEND::PORT)) "127.0.0.1" 0)
11: (SWANK::SETUP-SERVER 0 #<CLOSURE (LAMBDA #) {1245FC95}> :SPAWN NIL :UTF-8)
12: (SB-INT:SIMPLE-EVAL-IN-LEXENV
     (FUNCALL (READ-FROM-STRING "swank:start-server")
              "/var/folders/bF/bFw21j1PEYOaj7H8Xz3snk+++TI/-Tmp-/slime.7840"
              :CODING-SYSTEM "utf-8-unix")
     #<NULL-LEXENV>)

Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :

An initial fix is in 1.0.31.2, but the sb-posix test failures are still troubling, but this has been moved to bug 421779: https://bugs.launchpad.net/sbcl/+bug/421779

Changed in sbcl:
assignee: nobody → Cyrus Harmon (ch-launchpad)
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.