Ignore:
Timestamp:
Apr 9, 2009, 1:35:20 AM (10 years ago)
Author:
gb
Message:

pmcl-kernel.c: don't define objc_personality_v0, since in the Wacky World
Of Mach-O this can have the effect of shadowing the real ObjC runtime symbol.

x86-spentry64.s: in ffcall_return_registers: after saving return registers
relative to %csave0, restore them from there (not from %csave3). Most
callers don't care (will just look at the register buffer that csave0
pointed to), but if we're returning/raising an ObjC exception we want to get
it from the right place.

In the ObjC exception gunk, reference the new 'lisp_objc_personality' via
a 64-bit absolute address. This seems to be OK with the Leopard linker;
we'll see about other versions.

objc-support.lisp: in SETUP-OBJC-EXCEPTION-GLOBALS, try to ensure that
this only happens once per session (since we're using a kludge to
detect whether or not indirection is necessary.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/objc-bridge/objc-support.lisp

    r11907 r11913  
    141141#+apple-objc-2.0
    142142(progn
     143(defloadvar *objc-exception-globals-setup* nil) 
    143144(defun setup-objc-exception-globals ()
    144145  (flet ((set-global (offset name)
    145            (with-macptrs (p (%int-to-ptr (+ (target-nil-value) (%kernel-global-offset offset))))
    146             (unless (%null-ptr-p (%get-ptr p))
    147               (%setf-macptr p (%get-ptr p)))
    148             (setf (%get-ptr p)
    149                   (foreign-symbol-address name)))))
    150     (set-global 'objc-2-personality "___objc_personality_v0")
    151     (set-global 'objc-2-begin-catch "_objc_begin_catch")
    152     (set-global 'objc-2-end-catch "_objc_end_catch")
    153     (set-global 'unwind-resume "__Unwind_Resume")))
     146           (let* ((p (%int-to-ptr (+ (target-nil-value) (%kernel-global-offset offset))))
     147                  (q (%get-ptr p)))
     148             (unless (%null-ptr-p q)
     149               (setq p q))
     150             (setf (%get-ptr p)
     151                   (foreign-symbol-address name)))))
     152    (unless *objc-exception-globals-setup*
     153      (setq *objc-exception-globals-setup* t)
     154      (set-global 'objc-2-personality "___objc_personality_v0")
     155      (set-global 'objc-2-begin-catch "_objc_begin_catch")
     156      (set-global 'objc-2-end-catch "_objc_end_catch")
     157      (set-global 'unwind-resume "__Unwind_Resume"))))
    154158
    155159
     
    157161  (setup-objc-exception-globals))
    158162
    159 (setup-objc-exception-globals)
    160163)
    161164
Note: See TracChangeset for help on using the changeset viewer.