Re: [SOLVED] dlopen failure on sbcl/macosx

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]>
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
In the latest version of CLSQL, I made the default for 64-bit linux to build the 64-bit library
(named like clsql_uffi64.so) as well as attempt to build a 32-bit library (named like clsql_uffi.so).
For 64-bit lisps, the clsql_uffi64.so is given precedence for over clsql_uffi.so.
So, both 32-bit and 64-bit lisps should work with the same build. The big issues are to have
gcc-multiarch installed as well as 32-bit versions of zlib and mysqlclient in /usr/lib32/

For MacOSX, I could do something similar. But, having both 32-bit and 64-bit versions of zlib and mysqlclient
dependent libraries are not available on most systems.. Though, using MacPorts with the +universal variant
might well do the trick.

Kevinck

On Nov 3, 2009, at 5:46 PM, Harald Hanche-Olsen wrote:

> 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
> _______________________________________________
> CLSQL mailing list
> [email protected]
> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
>
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.