Fixes for Mac OSX

This commit is contained in:
jjgarcia 2005-06-06 08:38:33 +00:00
parent ba03609351
commit 15f645dba6
4 changed files with 14 additions and 8 deletions

View file

@ -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):

View file

@ -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 <mach-o/dyld.h>
# define INIT_PREFIX "_init_"
# endif
# ifdef HAVE_DLFCN_H
# include <dlfcn.h>
# define INIT_PREFIX "init_"
@ -25,10 +31,6 @@
# ifdef HAVE_LINK_H
# include <link.h>
# endif
# ifdef HAVE_MACH_O_DYLD_H
# include <mach-o/dyld.h>
# define INIT_PREFIX "_init_"
# endif
# if defined(mingw32) || defined(_MSC_VER)
# include <windows.h>
# include <windef.h>

View file

@ -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)

View file

@ -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<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
sec = getsectbynamefromheader(
hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);