Re: [SOLVED] dlopen failure on sbcl/macosx

Carlos Konstanski <[email protected]>
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
On Tue, 3 Nov 2009, Harald Hanche-Olsen wrote:

> Date: Tue, 03 Nov 2009 19:46:50 -0500 (EST)
> From: Harald Hanche-Olsen <[email protected]>
> To: [email protected]
> Subject: [CLSQL] [SOLVED] dlopen failure on sbcl/macosx
> 
> I found the reason for my problem: My SBCL is built for 64 bits, but
> cc builds for 32 bits on this machine unless I specify -arch x86_64 on
> the command line.
>
> The change below fixed the problem for me. Of course, I would need a
> similar fix for any dynamic library I wish to load; but that will be a
> battle for another day. At least, I now know wherein the problem lay.
>
> (This is of course not the correct fix in general, since it will break
> on 32 bit lisps. I am not sure how to deal with that little problem.)
>
> diff --git a/uffi/Makefile b/uffi/Makefile
> index c1af3f8..4670dd2 100644
> --- a/uffi/Makefile
> +++ b/uffi/Makefile
> @@ -36,7 +36,7 @@ else
> 	cc -G $(object) -o $(shared_lib)
>   else
>     ifneq ($(OS_DARWIN),0)
> -	cc -dynamic -c $(source) -o $(object)
> +	cc -dynamic -arch x86_64 -c $(source) -o $(object)
> 	ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $(base).dylib $(object)
> 	ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
>     else
>
> - Harald

Build a 32-bit chroot if you want such an environment on a 64-bit
machine.

Carlos Konstanski
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.