Changeset 4823


Ignore:
Timestamp:
Jun 27, 2006, 3:33:00 AM (18 years ago)
Author:
Gary Byers
Message:

Lots of FreeBSD conditionalization, changes.

MAY HAVE BROKEN LINUX PORTS; need to recompile on those platforms
and test.

Now depends on an imported lisp-kernel function on ELF platforms
(Linux/FreeBSD), and therefore depends on recent kernel changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-cfm-support.lisp

    r4542 r4823  
    2727
    2828
    29 ; Bootstrapping. Real version is in l1-aprims.
    30 ; Called by expansion of with-pstrs
     29;;; Bootstrapping. Real version is in l1-aprims.
     30;;; Called by expansion of with-pstrs
    3131
    3232(defun byte-length (string &optional script start end)
     
    7878(defvar *rtld-default*)
    7979(setq *rtld-next* (%incf-ptr (%null-ptr) -1)
    80       *rtld-default* (%int-to-ptr 0))
    81 
    82 #+linux-target
     80      *rtld-default* (%int-to-ptr #+linux-target 0
     81                                  #-linux-target -2))
     82
     83#+(or linux-target freebsd-target)
    8384(progn
    8485
     
    129130(defvar *shared-libraries* nil)
    130131
    131 #+linux-target
     132#+(or linux-target freebsd-target)
    132133(progn
    133134
     
    136137                 (dynamic-entries (pref map :link_map.l_ld)))
    137138    (let* ((soname-offset nil))
    138       ;;; Walk over the entries in the file's dynamic segment;
    139       ;;; the last such entry will have a tag of #$DT_NULL.
    140       ;;; Note the (loaded) address of the dynamic string table
    141       ;;; and the offset of the #$DT_SONAME string in that string
    142       ;;; table.
     139      ;;; Walk over the entries in the file's dynamic segment; the
     140      ;;; last such entry will have a tag of #$DT_NULL.  Note the
     141      ;;; (loaded,on Linux; relative to link_map.l_addr on FreeBSD)
     142      ;;; address of the dynamic string table and the offset of the
     143      ;;; #$DT_SONAME string in that string table.
    143144      (loop
    144145          (case #+32-bit-target (pref dynamic-entries :<E>lf32_<D>yn.d_tag)
     
    157158                                    :<E>lf32_<D>yn.d_un.d_ptr)
    158159                              #+64-bit-target
     160                              #+linux-target
    159161                              (pref dynamic-entries
    160                                     :<E>lf64_<D>yn.d_un.d_ptr))))
     162                                    :<E>lf64_<D>yn.d_un.d_ptr)
     163                              #+freebsd-target
     164                              (%inc-ptr (pref map :link_map.l_addr)
     165                                        (pref dynamic-entries
     166                                              :<E>lf64_<D>yn.d_un.d_val)))))
    161167          (%setf-macptr dynamic-entries
    162168                        (%inc-ptr dynamic-entries
     
    214220
    215221
     222(defun %get-r-debug ()
     223  (let* ((addr (ff-call (%kernel-import target::kernel-import-get-r-debug)
     224                        address)))
     225    (unless (%null-ptr-p addr)
     226      addr)))
     227
    216228(defun %link-map-address ()
    217   (let* ((r_debug (foreign-symbol-address "_r_debug")))
     229  (let* ((r_debug (%get-r-debug)))
    218230    (if r_debug
    219231      (pref r_debug :r_debug.r_map)
     
    238250 
    239251(defun init-shared-libraries ()
     252  #+freebsd-target (dbg)
    240253  (setq *dladdr-entry* (foreign-symbol-entry "dladdr"))
    241254  (when (null *shared-libraries*)
     
    244257      ;;; It seems to be necessary to open each of these libraries
    245258      ;;; yet again, specifying the RTLD_GLOBAL flag.
     259      #+linux-target
    246260      (%dlopen-shlib l)
    247261      (setf (shlib.opened-by-lisp-kernel l) t))))
     
    466480(defvar *statically-linked* nil)
    467481
    468 #+linux-target
     482#+(or linux-target freebsd-target)
    469483(progn
    470484
     
    520534;;; if not found in the OS list it returns nil
    521535;;;
    522 ;;; got this error before putting in the call to NSIsObjectNameDefinedInImage
    523 ;;; dyld: /usr/local/lisp/ccl/dppccl dead lock (dyld operation attempted in a thread already doing a dyld operation)
     536;;; got this error before putting in the call to
     537;;; NSIsObjectNameDefinedInImage dyld: /usr/local/lisp/ccl/dppccl dead
     538;;; lock (dyld operation attempted in a thread already doing a dyld
     539;;; operation)
    524540;;;
    525541
     
    570586)
    571587
    572 #-(or linux-target darwinppc-target)
     588#-(or linux-target darwinppc-target freebsd-target)
    573589(defun shlib-containing-entry (entry &optional name)
    574590  (declare (ignore entry name))
Note: See TracChangeset for help on using the changeset viewer.