diff --git a/src/CHANGELOG b/src/CHANGELOG index 20c374dcd..f10457383 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -3,7 +3,7 @@ ECL 0.9g * Platforms: - - Fixed the flags used when linking ECL against the shared library on Mac OSX. + - Fixed the broken port for MacOSX. It should work with any release >= 10.2 * Foreign function interface (FFI): diff --git a/src/c/load.d b/src/c/load.d index 0e57cca44..3216480ac 100644 --- a/src/c/load.d +++ b/src/c/load.d @@ -18,6 +18,12 @@ #include "internal.h" #ifdef ENABLE_DLOPEN +# ifdef HAVE_MACH_O_DYLD_H +# undef HAVE_DLFCN_H +# undef HAVE_LINK_H +# include +# define INIT_PREFIX "_init_" +# endif # ifdef HAVE_DLFCN_H # include # define INIT_PREFIX "init_" @@ -25,10 +31,6 @@ # ifdef HAVE_LINK_H # include # endif -# ifdef HAVE_MACH_O_DYLD_H -# include -# define INIT_PREFIX "_init_" -# endif # if defined(mingw32) || defined(_MSC_VER) # include # include diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index c1a0c0256..aac21bb20 100644 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -249,8 +249,8 @@ main(int argc, char **argv) (push (init-function-name item) submodules)))) (setq c-file (open c-name :direction :output)) (format c-file +lisp-program-header+ - #-(or :win32 :mingw32) (if (eq :fasl target) nil submodules) - #+(or :win32 :mingw32) submodules) + #-(or :win32 :mingw32 :darwin) (if (eq :fasl target) nil submodules) + #+(or :win32 :mingw32 :darwin) submodules) (cond (shared-data-file (data-init shared-data-file) (format c-file " @@ -323,11 +323,12 @@ static cl_object VV[VM]; (apply #'shared-cc output-name o-name ld-flags)) #+dlopen (:fasl + (print init-name) (when (or (symbolp output-name) (stringp output-name)) (setf output-name (compile-file-pathname output-name :type :fasl))) (unless init-name (setf init-name (init-function-name "CODE" nil))) - #-(or :win32 :mingw32) + #-(or :win32 :mingw32 :darwin) (setf submodules (mapcar #'(lambda (sm) (format nil "((ecl_init_function_t) ecl_library_symbol(Cblock, \"~A\"))" sm)) @@ -335,6 +336,7 @@ static cl_object VV[VM]; (format c-file +lisp-program-init+ init-name prologue-code shared-data-file submodules epilogue-code) (close c-file) + (si:system (format nil "cat ~s" c-file)) (compiler-cc c-name o-name) (apply #'bundle-cc output-name o-name ld-flags))) (cmp-delete-file c-name) diff --git a/src/gc/dyn_load.c b/src/gc/dyn_load.c index fdb6b3045..43a8a6c47 100644 --- a/src/gc/dyn_load.c +++ b/src/gc/dyn_load.c @@ -1140,6 +1140,8 @@ static const char *GC_dyld_name_for_hdr(struct mach_header *hdr) { static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) { unsigned long start,end,i; const struct section *sec; + if (GC_no_dls) + return; for(i=0;i