Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: configure
- ===================================================================
- RCS file: /caml/ocaml/configure,v
- retrieving revision 1.266
- diff -u -r1.266 configure
- --- configure 6 Oct 2008 13:31:47 -0000 1.266
- +++ configure 21 Oct 2008 02:15:29 -0000
- @@ -256,6 +256,14 @@
- # Almost the same as NeXTStep
- bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
- mathlib="";;
- + *,x86_64-*-darwin*)
- + bytecc="$bytecc -arch x86_64"
- + bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings"
- + # Tell gcc that we can use 32-bit code addresses for threaded code
- + # unless we are compiled for a shared library (-fPIC option)
- + echo "#ifndef __PIC__" >> m.h
- + echo "# define ARCH_CODE32" >> m.h
- + echo "#endif" >> m.h;;
- *,*-*-darwin*)
- bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings"
- mathlib=""
- @@ -566,16 +574,17 @@
- mksharedlibrpath="-rpath "
- shared_libraries_supported=true;;
- i[3456]86-*-darwin*)
- - dyld=ld
- - if test -f /usr/bin/ld_classic; then
- - # The new linker in Mac OS X 10.5 does not support read_only_relocs
- - # dyld=/usr/bin/ld_classic XXX FIXME incompatible with X11 libs
- - :
- - fi
- + dyld=gcc
- mksharedlib="$dyld -bundle -flat_namespace -undefined suppress -read_only_relocs suppress"
- bytecccompopts="$dl_defs $bytecccompopts"
- dl_needs_underscore=false
- shared_libraries_supported=true;;
- + x86_64-*-darwin*)
- + dyld=gcc
- + mksharedlib="$dyld -m64 -bundle -flat_namespace -undefined suppress -read_only_relocs suppress"
- + bytecccompopts="$dl_defs $bytecccompopts"
- + dl_needs_underscore=false
- + shared_libraries_supported=true;;
- *-apple-darwin*)
- mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress"
- bytecccompopts="$dl_defs $bytecccompopts"
- @@ -647,6 +656,7 @@
- x86_64-*-freebsd*) arch=amd64; system=freebsd;;
- x86_64-*-netbsd*) arch=amd64; system=netbsd;;
- x86_64-*-openbsd*) arch=amd64; system=openbsd;;
- + x86_64-*-darwin9.5) arch=amd64; system=macosx;;
- esac
- # Some platforms exist both in 32-bit and 64-bit variants, not distinguished
- @@ -685,6 +695,7 @@
- *,*,rhapsody,*) nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs"
- if $arch64; then partialld="ld -r -arch ppc64"; fi;;
- *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";;
- + amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";;
- *,gcc*,*,*) nativecccompopts="$gcc_warnings";;
- esac
- @@ -696,6 +707,8 @@
- asppprofflags='-pg -DPROFILING';;
- alpha,*,*) as='as'
- aspp='gcc -c';;
- + amd64,*,macosx) as='as -arch x86_64'
- + aspp='gcc -arch x86_64 -c';;
- amd64,*,*) as='as'
- aspp='gcc -c';;
- arm,*,*) as='as';
- @@ -734,6 +747,7 @@
- i386,*,linux_elf) profiling='prof';;
- i386,*,gnu) profiling='prof';;
- i386,*,bsd_elf) profiling='prof';;
- + amd64,*,macosx) profiling='prof';;
- i386,*,macosx) profiling='prof';;
- sparc,*,solaris)
- profiling='prof'
- @@ -1092,13 +1106,20 @@
- # Determine if system stack overflows can be detected
- case "$arch,$system" in
- - i386,linux_elf|amd64,linux|power,rhapsody|i386,macosx)
- + i386,linux_elf|amd64,linux|power,rhapsody|amd64,macosx|i386,macosx)
- echo "System stack overflow can be detected."
- echo "#define HAS_STACK_OVERFLOW_DETECTION" >> s.h;;
- *)
- echo "Cannot detect system stack overflow.";;
- esac
- +#Remap the MAP_ANONYMOUS for macosx amd64
- +case "$arch,$system" in
- + amd64,macosx)
- + echo "#define MAP_ANONYMOUS MAP_ANON" >> s.h;;
- + *);;
- +esac
- +
- # Determine the target architecture for the "num" library
- case "$host" in
- Index: asmcomp/amd64/emit.mlp
- ===================================================================
- RCS file: /caml/ocaml/asmcomp/amd64/emit.mlp,v
- retrieving revision 1.16
- diff -u -r1.16 emit.mlp
- --- asmcomp/amd64/emit.mlp 1 Aug 2008 08:04:57 -0000 1.16
- +++ asmcomp/amd64/emit.mlp 21 Oct 2008 02:15:29 -0000
- @@ -23,6 +23,14 @@
- open Linearize
- open Emitaux
- +(* The things that MacOSX need *)
- +let setcnt = ref (-1)
- +let macosx =
- + match Config.system with
- + | "macosx" -> true
- + | _ -> false
- +
- +
- (* Tradeoff between code size and code speed *)
- let fastcode_flag = ref true
- @@ -54,15 +62,16 @@
- (* Symbols *)
- let emit_symbol s =
- - Emitaux.emit_symbol '$' s
- + if macosx then emit_string "_";
- + Emitaux.emit_symbol '$' s
- let emit_call s =
- - if !Clflags.dlcode
- + if !Clflags.dlcode && not macosx
- then `call {emit_symbol s}@PLT`
- else `call {emit_symbol s}`
- let emit_jump s =
- - if !Clflags.dlcode
- + if !Clflags.dlcode && not macosx
- then `jmp {emit_symbol s}@PLT`
- else `jmp {emit_symbol s}`
- @@ -82,6 +91,7 @@
- (* Output a .align directive. *)
- let emit_align n =
- + let n = if macosx then Misc.log2 n else n in
- ` .align {emit_int n}\n`
- let emit_Llabel fallthrough lbl =
- @@ -588,7 +598,8 @@
- end else begin
- ` jmp *{emit_label lbl}(, {emit_reg i.arg.(0)}, 8)\n`
- end;
- - ` .section .rodata\n`;
- + if macosx then ` .section .rodata,\"\"\n`
- + else ` .section .rodata\n`;
- emit_align 8;
- `{emit_label lbl}:`;
- for i = 0 to Array.length jumptbl - 1 do
- @@ -670,7 +681,8 @@
- List.iter emit_call_gc !call_gc_sites;
- emit_call_bound_errors ();
- if !float_constants <> [] then begin
- - ` .section .rodata.cst8,\"a\",@progbits\n`;
- + if macosx then ` .section .rodata.cst8,\"a\"\n`
- + else ` .section .rodata.cst8,\"a\",@progbits\n`;
- List.iter emit_float_constant !float_constants
- end
- @@ -715,11 +727,20 @@
- let begin_assembly() =
- if !Clflags.dlcode then begin
- (* from amd64.S; could emit these constants on demand *)
- - ` .section .rodata.cst8,\"a\",@progbits\n`;
- - ` .align 16\n`;
- - `caml_negf_mask: .quad 0x8000000000000000, 0\n`;
- - ` .align 16\n`;
- - `caml_absf_mask: .quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF\n`;
- + if macosx then begin
- + ` .section .rodata.cst8,\"a\"\n`;
- + ` .align 4\n`;
- + `caml_negf_mask: .quad 0x8000000000000000, 0\n`;
- + ` .align 4\n`;
- + `caml_absf_mask: .quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF\n`;
- + end else begin
- + (* from amd64.S; could emit these constants on demand *)
- + ` .section .rodata.cst8,\"a\",@progbits\n`;
- + ` .align 16\n`;
- + `caml_negf_mask: .quad 0x8000000000000000, 0\n`;
- + ` .align 16\n`;
- + `caml_absf_mask: .quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF\n`;
- + end;
- end;
- let lbl_begin = Compilenv.make_symbol (Some "data_begin") in
- ` .data\n`;
- @@ -750,7 +771,12 @@
- efa_word = (fun n -> ` .quad {emit_int n}\n`);
- efa_align = emit_align;
- efa_label_rel = (fun lbl ofs ->
- - ` .long ({emit_label lbl} - .) + {emit_int32 ofs}\n`);
- + incr setcnt;
- + if macosx then
- + ` .set L$set${emit_int !setcnt},({emit_label lbl} - .) + {emit_int32 ofs}\n .long L$set${emit_int !setcnt}\n`
- + else
- + ` .set ({emit_label lbl} - .) + {emit_int32 ofs}\n .long L$set${emit_int !setcnt}\n`
- + );
- efa_def_label = (fun l -> `{emit_label l}:\n`);
- efa_string = (fun s -> emit_string_directive " .asciz " s) };
- if Config.system = "linux" then
- Index: asmrun/amd64.S
- ===================================================================
- RCS file: /caml/ocaml/asmrun/amd64.S,v
- retrieving revision 1.12
- diff -u -r1.12 amd64.S
- --- asmrun/amd64.S 1 Aug 2008 08:04:57 -0000 1.12
- +++ asmrun/amd64.S 21 Oct 2008 02:15:29 -0000
- @@ -16,11 +16,20 @@
- /* Asm part of the runtime system, AMD64 processor */
- /* Must be preprocessed by cpp */
- +#ifdef SYS_macosx
- +#define FUNCTION_ALIGN 2
- +#define EIGHT 3
- +#define SIXTEEN 4
- +#define PREPARE_SYMBOL(r) _##r
- +#else
- #define FUNCTION_ALIGN 4
- +#define PREPARE_SYMBOL(r) r
- +#define EIGHT 8
- +#define SIXTEEN 16
- +#endif
- #define FUNCTION(name) \
- .globl name; \
- - .type name,@function; \
- .align FUNCTION_ALIGN; \
- name:
- @@ -28,17 +37,17 @@
- /* Allocation */
- -FUNCTION(caml_call_gc)
- +FUNCTION(PREPARE_SYMBOL(caml_call_gc))
- /* Record lowest stack address and return address */
- movq 0(%rsp), %rax
- - movq %rax, caml_last_return_address(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_last_return_address)(%rip)
- leaq 8(%rsp), %rax
- - movq %rax, caml_bottom_of_stack(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- .L105:
- - /* Save caml_young_ptr, caml_exception_pointer */
- - movq %r15, caml_young_ptr(%rip)
- - movq %r14, caml_exception_pointer(%rip)
- - /* Build array of registers, save it into caml_gc_regs */
- + /* Save PREPARE_SYMBOL(caml_young_ptr), PREPARE_SYMBOL(caml_exception_pointer) */
- + movq %r15, PREPARE_SYMBOL(caml_young_ptr)(%rip)
- + movq %r14, PREPARE_SYMBOL(caml_exception_pointer)(%rip)
- + /* Build array of registers, save it into PREPARE_SYMBOL(caml_gc_regs) */
- pushq %r13
- pushq %r12
- pushq %rbp
- @@ -52,7 +61,7 @@
- pushq %rdi
- pushq %rbx
- pushq %rax
- - movq %rsp, caml_gc_regs(%rip)
- + movq %rsp, PREPARE_SYMBOL(caml_gc_regs)(%rip)
- /* Save floating-point registers */
- subq $(16*8), %rsp
- movlpd %xmm0, 0*8(%rsp)
- @@ -72,7 +81,7 @@
- movlpd %xmm14, 14*8(%rsp)
- movlpd %xmm15, 15*8(%rsp)
- /* Call the garbage collector */
- - call caml_garbage_collection
- + call PREPARE_SYMBOL(caml_garbage_collection)
- /* Restore all regs used by the code generator */
- movlpd 0*8(%rsp), %xmm0
- movlpd 1*8(%rsp), %xmm1
- @@ -104,93 +113,93 @@
- popq %rbp
- popq %r12
- popq %r13
- - /* Restore caml_young_ptr, caml_exception_pointer */
- - movq caml_young_ptr(%rip), %r15
- - movq caml_exception_pointer(%rip), %r14
- + /* Restore PREPARE_SYMBOL(caml_young_ptr), PREPARE_SYMBOL(caml_exception_pointer) */
- + movq PREPARE_SYMBOL(caml_young_ptr)(%rip), %r15
- + movq PREPARE_SYMBOL(caml_exception_pointer)(%rip), %r14
- /* Return to caller */
- ret
- -FUNCTION(caml_alloc1)
- +FUNCTION(PREPARE_SYMBOL(caml_alloc1))
- subq $16, %r15
- - cmpq caml_young_limit(%rip), %r15
- + cmpq PREPARE_SYMBOL(caml_young_limit)(%rip), %r15
- jb .L100
- ret
- .L100:
- movq 0(%rsp), %rax
- - movq %rax, caml_last_return_address(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_last_return_address)(%rip)
- leaq 8(%rsp), %rax
- - movq %rax, caml_bottom_of_stack(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- subq $8, %rsp
- call .L105
- addq $8, %rsp
- - jmp caml_alloc1
- + jmp PREPARE_SYMBOL(caml_alloc1)
- -FUNCTION(caml_alloc2)
- +FUNCTION(PREPARE_SYMBOL(caml_alloc2))
- subq $24, %r15
- - cmpq caml_young_limit(%rip), %r15
- + cmpq PREPARE_SYMBOL(caml_young_limit)(%rip), %r15
- jb .L101
- ret
- .L101:
- movq 0(%rsp), %rax
- - movq %rax, caml_last_return_address(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_last_return_address)(%rip)
- leaq 8(%rsp), %rax
- - movq %rax, caml_bottom_of_stack(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- subq $8, %rsp
- call .L105
- addq $8, %rsp
- - jmp caml_alloc2
- + jmp PREPARE_SYMBOL(caml_alloc2)
- -FUNCTION(caml_alloc3)
- +FUNCTION(PREPARE_SYMBOL(caml_alloc3))
- subq $32, %r15
- - cmpq caml_young_limit(%rip), %r15
- + cmpq PREPARE_SYMBOL(caml_young_limit)(%rip), %r15
- jb .L102
- ret
- .L102:
- movq 0(%rsp), %rax
- - movq %rax, caml_last_return_address(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_last_return_address)(%rip)
- leaq 8(%rsp), %rax
- - movq %rax, caml_bottom_of_stack(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- subq $8, %rsp
- call .L105
- addq $8, %rsp
- - jmp caml_alloc3
- + jmp PREPARE_SYMBOL(caml_alloc3)
- -FUNCTION(caml_allocN)
- +FUNCTION(PREPARE_SYMBOL(caml_allocN))
- subq %rax, %r15
- - cmpq caml_young_limit(%rip), %r15
- + cmpq PREPARE_SYMBOL(caml_young_limit)(%rip), %r15
- jb .L103
- ret
- .L103:
- pushq %rax /* save desired size */
- movq 8(%rsp), %rax
- - movq %rax, caml_last_return_address(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_last_return_address)(%rip)
- leaq 16(%rsp), %rax
- - movq %rax, caml_bottom_of_stack(%rip)
- + movq %rax, PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- call .L105
- popq %rax /* recover desired size */
- - jmp caml_allocN
- + jmp PREPARE_SYMBOL(caml_allocN)
- /* Call a C function from Caml */
- -FUNCTION(caml_c_call)
- +FUNCTION(PREPARE_SYMBOL(caml_c_call))
- /* Record lowest stack address and return address */
- popq %r12
- - movq %r12, caml_last_return_address(%rip)
- - movq %rsp, caml_bottom_of_stack(%rip)
- + movq %r12, PREPARE_SYMBOL(caml_last_return_address)(%rip)
- + movq %rsp, PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- /* Make the exception handler and alloc ptr available to the C code */
- - movq %r15, caml_young_ptr(%rip)
- - movq %r14, caml_exception_pointer(%rip)
- + movq %r15, PREPARE_SYMBOL(caml_young_ptr)(%rip)
- + movq %r14, PREPARE_SYMBOL(caml_exception_pointer)(%rip)
- /* Call the function (address in %rax) */
- call *%rax
- /* Reload alloc ptr */
- - movq caml_young_ptr(%rip), %r15
- + movq PREPARE_SYMBOL(caml_young_ptr)(%rip), %r15
- /* Return to caller */
- pushq %r12
- ret
- /* Start the Caml program */
- -FUNCTION(caml_start_program)
- +FUNCTION(PREPARE_SYMBOL(caml_start_program))
- /* Save callee-save registers */
- pushq %rbx
- pushq %rbp
- @@ -199,18 +208,18 @@
- pushq %r14
- pushq %r15
- subq $8, %rsp /* stack 16-aligned */
- - /* Initial entry point is caml_program */
- - leaq caml_program(%rip), %r12
- - /* Common code for caml_start_program and caml_callback* */
- + /* Initial entry point is PREPARE_SYMBOL(caml_program) */
- + leaq PREPARE_SYMBOL(caml_program)(%rip), %r12
- + /* Common code for PREPARE_SYMBOL(caml_start_program) and PREPARE_SYMBOL(caml_callback)* */
- .L106:
- /* Build a callback link */
- subq $8, %rsp /* stack 16-aligned */
- - pushq caml_gc_regs(%rip)
- - pushq caml_last_return_address(%rip)
- - pushq caml_bottom_of_stack(%rip)
- + pushq PREPARE_SYMBOL(caml_gc_regs)(%rip)
- + pushq PREPARE_SYMBOL(caml_last_return_address)(%rip)
- + pushq PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- /* Setup alloc ptr and exception ptr */
- - movq caml_young_ptr(%rip), %r15
- - movq caml_exception_pointer(%rip), %r14
- + movq PREPARE_SYMBOL(caml_young_ptr)(%rip), %r15
- + movq PREPARE_SYMBOL(caml_exception_pointer)(%rip), %r14
- /* Build an exception handler */
- lea .L108(%rip), %r13
- pushq %r13
- @@ -224,12 +233,12 @@
- popq %r12 /* dummy register */
- .L109:
- /* Update alloc ptr and exception ptr */
- - movq %r15, caml_young_ptr(%rip)
- - movq %r14, caml_exception_pointer(%rip)
- + movq %r15, PREPARE_SYMBOL(caml_young_ptr)(%rip)
- + movq %r14, PREPARE_SYMBOL(caml_exception_pointer)(%rip)
- /* Pop the callback link, restoring the global variables */
- - popq caml_bottom_of_stack(%rip)
- - popq caml_last_return_address(%rip)
- - popq caml_gc_regs(%rip)
- + popq PREPARE_SYMBOL(caml_bottom_of_stack)(%rip)
- + popq PREPARE_SYMBOL(caml_last_return_address)(%rip)
- + popq PREPARE_SYMBOL(caml_gc_regs)(%rip)
- addq $8, %rsp
- /* Restore callee-save registers. */
- addq $8, %rsp
- @@ -249,8 +258,8 @@
- /* Raise an exception from Caml */
- -FUNCTION(caml_raise_exn)
- - testl $1, caml_backtrace_active(%rip)
- +FUNCTION(PREPARE_SYMBOL(caml_raise_exn))
- + testl $1, PREPARE_SYMBOL(caml_backtrace_active)(%rip)
- jne .L110
- movq %r14, %rsp
- popq %r14
- @@ -261,7 +270,7 @@
- movq 0(%rsp), %rsi /* arg 2: pc of raise */
- leaq 8(%rsp), %rdx /* arg 3: sp of raise */
- movq %r14, %rcx /* arg 4: sp of handler */
- - call caml_stash_backtrace
- + call PREPARE_SYMBOL(caml_stash_backtrace)
- movq %r12, %rax /* Recover exception bucket */
- movq %r14, %rsp
- popq %r14
- @@ -269,30 +278,30 @@
- /* Raise an exception from C */
- -FUNCTION(caml_raise_exception)
- - testl $1, caml_backtrace_active(%rip)
- +FUNCTION(PREPARE_SYMBOL(caml_raise_exception))
- + testl $1, PREPARE_SYMBOL(caml_backtrace_active)(%rip)
- jne .L111
- movq %rdi, %rax
- - movq caml_exception_pointer(%rip), %rsp
- + movq PREPARE_SYMBOL(caml_exception_pointer)(%rip), %rsp
- popq %r14 /* Recover previous exception handler */
- - movq caml_young_ptr(%rip), %r15 /* Reload alloc ptr */
- + movq PREPARE_SYMBOL(caml_young_ptr)(%rip), %r15 /* Reload alloc ptr */
- ret
- .L111:
- movq %rdi, %r12 /* Save exception bucket */
- /* arg 1: exception bucket */
- - movq caml_last_return_address(%rip), %rsi /* arg 2: pc of raise */
- - movq caml_bottom_of_stack(%rip), %rdx /* arg 3: sp of raise */
- - movq caml_exception_pointer(%rip), %rcx /* arg 4: sp of handler */
- - call caml_stash_backtrace
- + movq PREPARE_SYMBOL(caml_last_return_address)(%rip), %rsi /* arg 2: pc of raise */
- + movq PREPARE_SYMBOL(caml_bottom_of_stack)(%rip), %rdx /* arg 3: sp of raise */
- + movq PREPARE_SYMBOL(caml_exception_pointer)(%rip), %rcx /* arg 4: sp of handler */
- + call PREPARE_SYMBOL(caml_stash_backtrace)
- movq %r12, %rax /* Recover exception bucket */
- - movq caml_exception_pointer(%rip), %rsp
- + movq PREPARE_SYMBOL(caml_exception_pointer)(%rip), %rsp
- popq %r14 /* Recover previous exception handler */
- - movq caml_young_ptr(%rip), %r15 /* Reload alloc ptr */
- + movq PREPARE_SYMBOL(caml_young_ptr)(%rip), %r15 /* Reload alloc ptr */
- ret
- /* Callback from C to Caml */
- -FUNCTION(caml_callback_exn)
- +FUNCTION(PREPARE_SYMBOL(caml_callback_exn))
- /* Save callee-save registers */
- pushq %rbx
- pushq %rbp
- @@ -307,7 +316,7 @@
- movq 0(%rbx), %r12 /* code pointer */
- jmp .L106
- -FUNCTION(caml_callback2_exn)
- +FUNCTION(PREPARE_SYMBOL(caml_callback2_exn))
- /* Save callee-save registers */
- pushq %rbx
- pushq %rbp
- @@ -320,10 +329,10 @@
- /* closure stays in %rdi */
- movq %rsi, %rax /* first argument */
- movq %rdx, %rbx /* second argument */
- - leaq caml_apply2(%rip), %r12 /* code pointer */
- + leaq PREPARE_SYMBOL(caml_apply2)(%rip), %r12 /* code pointer */
- jmp .L106
- -FUNCTION(caml_callback3_exn)
- +FUNCTION(PREPARE_SYMBOL(caml_callback3_exn))
- /* Save callee-save registers */
- pushq %rbx
- pushq %rbp
- @@ -337,34 +346,35 @@
- movq %rdx, %rbx /* second argument */
- movq %rdi, %rsi /* closure */
- movq %rcx, %rdi /* third argument */
- - leaq caml_apply3(%rip), %r12 /* code pointer */
- + leaq PREPARE_SYMBOL(caml_apply3)(%rip), %r12 /* code pointer */
- jmp .L106
- -FUNCTION(caml_ml_array_bound_error)
- - leaq caml_array_bound_error(%rip), %rax
- - jmp caml_c_call
- +FUNCTION(PREPARE_SYMBOL(caml_ml_array_bound_error))
- + leaq PREPARE_SYMBOL(caml_array_bound_error)(%rip), %rax
- + jmp PREPARE_SYMBOL(caml_c_call)
- .data
- - .globl caml_system__frametable
- - .type caml_system__frametable,@object
- - .align 8
- -caml_system__frametable:
- + .globl PREPARE_SYMBOL(caml_system__frametable)
- + .align EIGHT
- +PREPARE_SYMBOL(caml_system__frametable):
- .quad 1 /* one descriptor */
- .quad .L107 /* return address into callback */
- .value -1 /* negative frame size => use callback link */
- .value 0 /* no roots here */
- - .align 8
- + .align EIGHT
- - .section .rodata.cst8,"a",@progbits
- - .globl caml_negf_mask
- - .type caml_negf_mask,@object
- - .align 16
- -caml_negf_mask:
- +#ifdef SYS_macosx
- + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
- +#else
- + .section .rodata.cst8,"a",@progbits
- +#endif
- + .globl PREPARE_SYMBOL(caml_negf_mask)
- + .align SIXTEEN
- +PREPARE_SYMBOL(caml_negf_mask):
- .quad 0x8000000000000000, 0
- - .globl caml_absf_mask
- - .type caml_absf_mask,@object
- - .align 16
- -caml_absf_mask:
- + .globl PREPARE_SYMBOL(caml_absf_mask)
- + .align SIXTEEN
- +PREPARE_SYMBOL(caml_absf_mask):
- .quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF
- #if defined(SYS_linux)
- Index: asmrun/signals_osdep.h
- ===================================================================
- RCS file: /caml/ocaml/asmrun/signals_osdep.h,v
- retrieving revision 1.11
- diff -u -r1.11 signals_osdep.h
- --- asmrun/signals_osdep.h 11 Jan 2008 16:13:11 -0000 1.11
- +++ asmrun/signals_osdep.h 21 Oct 2008 02:15:30 -0000
- @@ -34,8 +34,6 @@
- /****************** AMD64, Linux */
- -#elif defined(TARGET_amd64) && defined (SYS_linux)
- -
- #define DECLARE_SIGNAL_HANDLER(name) \
- static void name(int sig, siginfo_t * info, ucontext_t * context)
- @@ -49,6 +47,29 @@
- #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15])
- #define CONTEXT_FAULTING_ADDRESS ((char *) context->uc_mcontext.gregs[REG_CR2])
- +/****************** AMD64, MacOSX */
- +#elif defined(TARGET_amd64) && defined (SYS_macosx)
- +
- + #define DECLARE_SIGNAL_HANDLER(name) \
- + static void name(int sig, siginfo_t * info, void * context)
- +
- + #define SET_SIGACT(sigact,name) \
- + sigact.sa_sigaction = (name); \
- + sigact.sa_flags = SA_SIGINFO
- +
- + #include <sys/ucontext.h>
- + #include <AvailabilityMacros.h>
- +
- +#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
- + #define CONTEXT_REG(r) r
- + #else
- + #define CONTEXT_REG(r) __##r
- + #endif
- +
- + #define CONTEXT_STATE (((ucontext_t *)context)->uc_mcontext->CONTEXT_REG(ss))
- + #define CONTEXT_PC (CONTEXT_STATE.CONTEXT_REG(rip))
- + #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
- +
- /****************** I386, Linux */
- #elif defined(TARGET_i386) && defined(SYS_linux_elf)
Add Comment
Please, Sign In to add comment