From: Stas B. <sta...@gm...> - 2016-12-04 08:37:15
|
Can you try diff --git a/src/runtime/darwin-os.c b/src/runtime/darwin-os.c index 1be6636..f0f202d 100644 --- a/src/runtime/darwin-os.c +++ b/src/runtime/darwin-os.c @@ -29,6 +29,7 @@ #include <mach/clock.h> #include <stdlib.h> #include <time.h> +#include <sys/syscall.h> #ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER #include <libkern/OSAtomic.h> @@ -52,7 +53,6 @@ os_get_runtime_executable_path(int external) return copied_string(path); } -extern int __semwait_signal(int, int, int, int, __int64_t, __int32_t); semaphore_t clock_sem = MACH_PORT_NULL; mach_port_t clock_port = MACH_PORT_NULL; @@ -362,7 +362,10 @@ sb_nanosleep(time_t sec, int nsec) { } for (;;) { - ret = __semwait_signal(clock_sem, MACH_PORT_NULL, 1, 1, sec, nsec); + + + ret = syscall(SYS___semwait_signal, (int)clock_sem, (int)MACH_PORT_NULL, (int)1, (int)1, + (__int64_t)sec, (__int32_t)nsec); if (ret < 0) { if (errno == ETIMEDOUT) { return 0; On Sun, Dec 4, 2016 at 9:00 AM, 有坂富雄 <ari...@ic...> wrote: > Hello, > > SBCL-1.3.12 fails to build on MacOSX-10.6.8, because of the following > commit. > (1) > <https://sourceforge.net/p/sbcl/sbcl/ci/2fd854b3b20fc95db33012b04d20dc27bdac0f91/> > (2) > <https://sourceforge.net/p/sbcl/sbcl/ci/6d28b641b659b2be6ad7b329ae09cb592c1162a1/> > > I made the patch to solve the problem of commit (1). > But I cannot solve the problem of commit (2). > > My error log is the following. > > -------------------------------------------------------------------------------- > $ xcodebuild -version > Xcode 3.2.6 > Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 > BuildVersion: 10M2518 > $ > $ sbcl --version > SBCL 1.2.11 > $ > $ bzip2 -dc /Volumes/SBCL/1.3.12/sbcl-1.3.12-source.tar.bz2 | tar xf - > $ > $ cd ./sbcl-1.3.12 > $ > $ patch -p1 < /sw/fink/dists/stable/main/finkinfo/languages/sbcl.patch > patching file customize-target-features.lisp > $ perl -pi -e 's|\(deftest readdir.1|#-darwin\n$&|' > contrib/sb-posix/posix-tests.lisp > $ perl -pi -e 's|makeinfo|/usr/bin/makeinfo|g' doc/internals/Makefile > doc/manual/Makefile > $ > $ SBCL_ARCH="x86-64" sh make.sh "sbcl --disable-debugger --sysinit /dev/null > --userinit /dev/null" > . . . > . . . > . . . > cc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.6 > -D_DARWIN_USE_64_BIT_INODE -arch x86_64 -fno-omit-frame-pointer > -pagezero_size 0x100000 -I. -DSBCL_PREFIX=\"'/usr/local'\" -c -o > darwin-os.o darwin-os.c > darwin-os.c: In function 'mach_exception_handler': > darwin-os.c:84: warning: cast from pointer to integer of different size > darwin-os.c: In function 'mach_lisp_thread_init': > darwin-os.c:140: error: 'mach_port_context_t' undeclared (first use in this > function) > darwin-os.c:140: error: (Each undeclared identifier is reported only once > darwin-os.c:140: error: for each function it appears in.) > darwin-os.c:140: error: expected ')' before 'thread' > make: *** [darwin-os.o] Error 1 > $ > -------------------------------------------------------------------------------- > I got the above error. > > So that, I made the three patches as follows: > -------------------------------------------------------------------------------- > $ diff -u ./src/runtime/darwin-os.c.orig ./src/runtime/darwin-os.c > --- ./src/runtime/darwin-os.c.orig 2016-11-30 06:07:36.000000000 +0900 > +++ ./src/runtime/darwin-os.c 2016-12-04 02:34:28.000000000 +0900 > @@ -137,7 +137,7 @@ > } > > if (mach_port_set_context(mach_task_self(), thread_exception_port, > - (mach_port_context_t)thread) > + (mach_vm_address_t)thread) > != KERN_SUCCESS) { > lose("Cannot set thread_exception_port context"); > } > $ > $ diff -u ./src/runtime/x86-darwin-os.c.orig ./src/runtime/x86-darwin-os.c > --- ./src/runtime/x86-darwin-os.c.orig 2016-11-30 06:07:36.000000000 > +0900 > +++ ./src/runtime/x86-darwin-os.c 2016-12-04 02:34:31.000000000 +0900 > @@ -384,7 +384,7 @@ > > FSHOW((stderr,"/entering catch_exception_raise with exception: %d\n", > exception)); > > - if (mach_port_get_context(mach_task_self(), exception_port, > (mach_port_context_t *)&th) > + if (mach_port_get_context(mach_task_self(), exception_port, > (mach_vm_address_t *)&th) > != KERN_SUCCESS) { > lose("Can't find the thread for an exception %p", exception_port); > } > $ > $ diff -u ./src/runtime/x86-64-darwin-os.c.orig > ./src/runtime/x86-64-darwin-os.c > --- ./src/runtime/x86-64-darwin-os.c.orig 2016-11-30 06:07:36.000000000 > +0900 > +++ ./src/runtime/x86-64-darwin-os.c 2016-12-04 02:34:30.000000000 +0900 > @@ -309,7 +309,7 @@ > struct thread *th; > > FSHOW((stderr,"/entering catch_exception_raise with exception: %d\n", > exception)); > - if (mach_port_get_context(mach_task_self(), exception_port, > (mach_port_context_t *)&th) > + if (mach_port_get_context(mach_task_self(), exception_port, > (mach_vm_address_t *)&th) > != KERN_SUCCESS) { > lose("Can't find the thread for an exception %p", exception_port); > } > $ > -------------------------------------------------------------------------------- > > I tried to make SBCL again after I applied these patches. > -------------------------------------------------------------------------------- > $ SBCL_ARCH="x86-64" sh make.sh "sbcl --disable-debugger --sysinit /dev/null > --userinit /dev/null" > . . . > . . . > . . . > cc -g -mmacosx-version-min=10.6 -Wl,-no_pie -arch x86_64 -dynamic > -twolevel_namespace -bind_at_load -pagezero_size 0x100000 -o sbcl alloc.o > backtrace.o breakpoint.o coreparse.o dynbind.o funcall.o gc-common.o > globals.o interr.o interrupt.o largefile.o monitor.o os-common.o parse.o > print.o purify.o pthread-futex.o regnames.o run-program.o runtime.o > safepoint.o save.o sc-offset.o search.o thread.o time.o validate.o var-io.o > vars.o wrap.o x86-64-arch.o bsd-os.o x86-64-bsd-os.o darwin-os.o > x86-64-darwin-os.o gencgc.o marknsweepgc.o x86-64-assem.o ldso-stubs.o > -lSystem -lc -ldl -lpthread -lm > Undefined symbols: > "___semwait_signal", referenced from: > _sb_nanosleep in darwin-os.o > ld: symbol(s) not found > collect2: ld returned 1 exit status > make: *** [sbcl] Error 1 > $ > -------------------------------------------------------------------------------- > I got the above error. > > Do you have any suggestions? > > Thanks, > > Tomio Arisaka > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Sbcl-devel mailing list > Sbc...@li... > https://lists.sourceforge.net/lists/listinfo/sbcl-devel > -- With best regards, Stas. |