Skip to content
This repository
Browse code

[backtraces] add CFI directives to improve backtraces

  • Loading branch information...
commit 0a5bb750ac1fa29500fd0075a7ea44f4d9739889 1 parent 3b80f20
Thomas Gazagnaire samoht authored
1  Makefile
@@ -392,6 +392,7 @@ utils/config.ml: utils/config.mlp config/Makefile
392 392 -e 's|%%EXT_DLL%%|.so|' \
393 393 -e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
394 394 -e 's|%%ASM%%|$(ASM)|' \
  395 + -e 's|%%ASM_CFI_SUPPORTED%%|$(ASM_CFI_SUPPORTED)|' \
395 396 -e 's|%%MKDLL%%|$(MKDLL)|' \
396 397 -e 's|%%MKEXE%%|$(MKEXE)|' \
397 398 -e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
29 asmcomp/amd64/emit.mlp
@@ -317,11 +317,17 @@ let emit_float_test cmp neg arg lbl =
317 317
318 318 (* Deallocate the stack frame before a return or tail call *)
319 319
320   -let output_epilogue () =
  320 +let output_epilogue f =
321 321 if frame_required() then begin
322 322 let n = frame_size() - 8 in
323   - ` addq ${emit_int n}, %rsp\n`
  323 + ` addq ${emit_int n}, %rsp\n`;
  324 + cfi_adjust_cfa_offset (-n);
  325 + f ();
  326 + (* reset CFA back cause function body may continue *)
  327 + cfi_adjust_cfa_offset n
324 328 end
  329 + else
  330 + f ()
325 331
326 332 (* Output the assembly code for an instruction *)
327 333
@@ -373,14 +379,16 @@ let emit_instr fallthrough i =
373 379 ` {emit_call s}\n`;
374 380 record_frame i.live i.dbg
375 381 | Lop(Itailcall_ind) ->
376   - output_epilogue();
  382 + output_epilogue begin fun () ->
377 383 ` jmp *{emit_reg i.arg.(0)}\n`
  384 + end
378 385 | Lop(Itailcall_imm s) ->
379 386 if s = !function_name then
380 387 ` jmp {emit_label !tailrec_entry_point}\n`
381 388 else begin
382   - output_epilogue();
  389 + output_epilogue begin fun () ->
383 390 ` {emit_jump s}\n`
  391 + end
384 392 end
385 393 | Lop(Iextcall(s, alloc)) ->
386 394 if alloc then begin
@@ -394,6 +402,7 @@ let emit_instr fallthrough i =
394 402 if n < 0
395 403 then ` addq ${emit_int(-n)}, %rsp\n`
396 404 else ` subq ${emit_int(n)}, %rsp\n`;
  405 + cfi_adjust_cfa_offset n;
397 406 stack_offset := !stack_offset + n
398 407 | Lop(Iload(chunk, addr)) ->
399 408 let dest = i.res.(0) in
@@ -536,8 +545,9 @@ let emit_instr fallthrough i =
536 545 | Lreloadretaddr ->
537 546 ()
538 547 | Lreturn ->
539   - output_epilogue();
  548 + output_epilogue begin fun () ->
540 549 ` ret\n`
  550 + end
541 551 | Llabel lbl ->
542 552 `{emit_Llabel fallthrough lbl}:\n`
543 553 | Lbranch lbl ->
@@ -613,12 +623,16 @@ let emit_instr fallthrough i =
613 623 | Lsetuptrap lbl ->
614 624 ` call {emit_label lbl}\n`
615 625 | Lpushtrap ->
  626 + cfi_adjust_cfa_offset 8;
616 627 ` pushq %r14\n`;
  628 + cfi_adjust_cfa_offset 8;
617 629 ` movq %rsp, %r14\n`;
618 630 stack_offset := !stack_offset + 16
619 631 | Lpoptrap ->
620 632 ` popq %r14\n`;
  633 + cfi_adjust_cfa_offset (-8);
621 634 ` addq $8, %rsp\n`;
  635 + cfi_adjust_cfa_offset (-8);
622 636 stack_offset := !stack_offset - 16
623 637 | Lraise ->
624 638 if !Clflags.debug then begin
@@ -682,15 +696,18 @@ let fundecl fundecl =
682 696 else
683 697 ` .globl {emit_symbol fundecl.fun_name}\n`;
684 698 `{emit_symbol fundecl.fun_name}:\n`;
  699 + cfi_startproc ();
685 700 if !Clflags.gprofile then emit_profile();
686 701 if frame_required() then begin
687 702 let n = frame_size() - 8 in
688   - ` subq ${emit_int n}, %rsp\n`
  703 + ` subq ${emit_int n}, %rsp\n`;
  704 + cfi_adjust_cfa_offset n;
689 705 end;
690 706 `{emit_label !tailrec_entry_point}:\n`;
691 707 emit_all true fundecl.fun_body;
692 708 List.iter emit_call_gc !call_gc_sites;
693 709 emit_call_bound_errors ();
  710 + cfi_endproc ();
694 711 begin match Config.system with
695 712 "linux" | "gnu" ->
696 713 ` .type {emit_symbol fundecl.fun_name},@function\n`;
20 asmcomp/emitaux.ml
@@ -192,3 +192,23 @@ let is_generic_function name =
192 192 List.exists
193 193 (fun p -> isprefix p name)
194 194 ["caml_apply"; "caml_curry"; "caml_send"; "caml_tuplify"]
  195 +
  196 +(* CFI directives *)
  197 +
  198 +let is_cfi_enabled () =
  199 + !Clflags.debug && Config.asm_cfi_supported
  200 +
  201 +let cfi_startproc () =
  202 + if is_cfi_enabled () then
  203 + emit_string " .cfi_startproc\n"
  204 +
  205 +let cfi_endproc () =
  206 + if is_cfi_enabled () then
  207 + emit_string " .cfi_endproc\n"
  208 +
  209 +let cfi_adjust_cfa_offset n =
  210 + if is_cfi_enabled () then
  211 + begin
  212 + emit_string " .cfi_adjust_cfa_offset "; emit_int n; emit_string "\n";
  213 + end
  214 +
4 asmcomp/emitaux.mli
@@ -50,3 +50,7 @@ type emit_frame_actions =
50 50 val emit_frames: emit_frame_actions -> unit
51 51
52 52 val is_generic_function: string -> bool
  53 +
  54 +val cfi_startproc : unit -> unit
  55 +val cfi_endproc : unit -> unit
  56 +val cfi_adjust_cfa_offset : int -> unit
39 asmcomp/i386/emit.mlp
@@ -309,9 +309,18 @@ let output_test_zero arg =
309 309
310 310 (* Deallocate the stack frame before a return or tail call *)
311 311
312   -let output_epilogue () =
  312 +let output_epilogue f =
313 313 let n = frame_size() - 4 in
314   - if n > 0 then ` addl ${emit_int n}, %esp\n`
  314 + if n > 0 then
  315 + begin
  316 + ` addl ${emit_int n}, %esp\n`;
  317 + cfi_adjust_cfa_offset (-n);
  318 + f ();
  319 + (* reset CFA back cause function body may continue *)
  320 + cfi_adjust_cfa_offset n
  321 + end
  322 + else
  323 + f ()
315 324
316 325 (* Determine if the given register is the top of the floating-point stack *)
317 326
@@ -463,14 +472,16 @@ let emit_instr fallthrough i =
463 472 ` call {emit_symbol s}\n`;
464 473 record_frame i.live i.dbg
465 474 | Lop(Itailcall_ind) ->
466   - output_epilogue();
  475 + output_epilogue begin fun () ->
467 476 ` jmp *{emit_reg i.arg.(0)}\n`
  477 + end
468 478 | Lop(Itailcall_imm s) ->
469 479 if s = !function_name then
470 480 ` jmp {emit_label !tailrec_entry_point}\n`
471 481 else begin
472   - output_epilogue();
  482 + output_epilogue begin fun () ->
473 483 ` jmp {emit_symbol s}\n`
  484 + end
474 485 end
475 486 | Lop(Iextcall(s, alloc)) ->
476 487 if alloc then begin
@@ -496,6 +507,7 @@ let emit_instr fallthrough i =
496 507 if n < 0
497 508 then ` addl ${emit_int(-n)}, %esp\n`
498 509 else ` subl ${emit_int(n)}, %esp\n`;
  510 + cfi_adjust_cfa_offset n;
499 511 stack_offset := !stack_offset + n
500 512 | Lop(Iload(chunk, addr)) ->
501 513 let dest = i.res.(0) in
@@ -649,6 +661,7 @@ let emit_instr fallthrough i =
649 661 ` fldl {emit_reg i.arg.(0)}\n`;
650 662 stack_offset := !stack_offset - 8;
651 663 ` subl $8, %esp\n`;
  664 + cfi_adjust_cfa_offset 8;
652 665 ` fnstcw 4(%esp)\n`;
653 666 ` movw 4(%esp), %ax\n`;
654 667 ` movb $12, %ah\n`;
@@ -663,6 +676,7 @@ let emit_instr fallthrough i =
663 676 end;
664 677 ` fldcw 4(%esp)\n`;
665 678 ` addl $8, %esp\n`;
  679 + cfi_adjust_cfa_offset (-8);
666 680 stack_offset := !stack_offset + 8
667 681 | Lop(Ispecific(Ilea addr)) ->
668 682 ` lea {emit_addressing addr i.arg 0}, {emit_reg i.res.(0)}\n`
@@ -679,29 +693,36 @@ let emit_instr fallthrough i =
679 693 match r with
680 694 {loc = Reg _; typ = Float} ->
681 695 ` subl $8, %esp\n`;
  696 + cfi_adjust_cfa_offset 8;
682 697 ` fstpl 0(%esp)\n`;
683 698 stack_offset := !stack_offset + 8
684 699 | {loc = Stack sl; typ = Float} ->
685 700 let ofs = slot_offset sl 1 in
686 701 ` pushl {emit_int(ofs + 4)}(%esp)\n`;
687 702 ` pushl {emit_int(ofs + 4)}(%esp)\n`;
  703 + cfi_adjust_cfa_offset 8;
688 704 stack_offset := !stack_offset + 8
689 705 | _ ->
690 706 ` pushl {emit_reg r}\n`;
  707 + cfi_adjust_cfa_offset 4;
691 708 stack_offset := !stack_offset + 4
692 709 done
693 710 | Lop(Ispecific(Ipush_int n)) ->
694 711 ` pushl ${emit_nativeint n}\n`;
  712 + cfi_adjust_cfa_offset 4;
695 713 stack_offset := !stack_offset + 4
696 714 | Lop(Ispecific(Ipush_symbol s)) ->
697 715 ` pushl ${emit_symbol s}\n`;
  716 + cfi_adjust_cfa_offset 4;
698 717 stack_offset := !stack_offset + 4
699 718 | Lop(Ispecific(Ipush_load addr)) ->
700 719 ` pushl {emit_addressing addr i.arg 0}\n`;
  720 + cfi_adjust_cfa_offset 4;
701 721 stack_offset := !stack_offset + 4
702 722 | Lop(Ispecific(Ipush_load_float addr)) ->
703 723 ` pushl {emit_addressing (offset_addressing addr 4) i.arg 0}\n`;
704 724 ` pushl {emit_addressing addr i.arg 0}\n`;
  725 + cfi_adjust_cfa_offset 8;
705 726 stack_offset := !stack_offset + 8
706 727 | Lop(Ispecific(Ifloatarithmem(double, op, addr))) ->
707 728 if not (is_tos i.arg.(0)) then
@@ -719,8 +740,9 @@ let emit_instr fallthrough i =
719 740 | Lreloadretaddr ->
720 741 ()
721 742 | Lreturn ->
722   - output_epilogue();
  743 + output_epilogue begin fun () ->
723 744 ` ret\n`
  745 + end
724 746 | Llabel lbl ->
725 747 `{emit_Llabel fallthrough lbl}:\n`
726 748 | Lbranch lbl ->
@@ -784,11 +806,13 @@ let emit_instr fallthrough i =
784 806 if trap_frame_size > 8 then
785 807 ` subl ${emit_int (trap_frame_size - 8)}, %esp\n`;
786 808 ` pushl {emit_symbol "caml_exception_pointer"}\n`;
  809 + cfi_adjust_cfa_offset trap_frame_size;
787 810 ` movl %esp, {emit_symbol "caml_exception_pointer"}\n`;
788 811 stack_offset := !stack_offset + trap_frame_size
789 812 | Lpoptrap ->
790 813 ` popl {emit_symbol "caml_exception_pointer"}\n`;
791 814 ` addl ${emit_int (trap_frame_size - 4)}, %esp\n`;
  815 + cfi_adjust_cfa_offset (-trap_frame_size);
792 816 stack_offset := !stack_offset - trap_frame_size
793 817 | Lraise ->
794 818 if !Clflags.debug then begin
@@ -897,14 +921,19 @@ let fundecl fundecl =
897 921 else
898 922 ` .globl {emit_symbol fundecl.fun_name}\n`;
899 923 `{emit_symbol fundecl.fun_name}:\n`;
  924 + cfi_startproc ();
900 925 if !Clflags.gprofile then emit_profile();
901 926 let n = frame_size() - 4 in
902 927 if n > 0 then
  928 + begin
903 929 ` subl ${emit_int n}, %esp\n`;
  930 + cfi_adjust_cfa_offset n;
  931 + end;
904 932 `{emit_label !tailrec_entry_point}:\n`;
905 933 emit_all true fundecl.fun_body;
906 934 List.iter emit_call_gc !call_gc_sites;
907 935 emit_call_bound_errors ();
  936 + cfi_endproc ();
908 937 begin match Config.system with
909 938 "linux_elf" | "bsd_elf" | "gnu" ->
910 939 ` .type {emit_symbol fundecl.fun_name},@function\n`;
22 asmrun/amd64.S
@@ -18,6 +18,8 @@
18 18
19 19 /* PIC mode support based on contribution by Paul Stravers (see PR#4795) */
20 20
  21 +#include "../config/m.h"
  22 +
21 23 #ifdef SYS_macosx
22 24
23 25 #define G(r) _##r
@@ -47,6 +49,16 @@
47 49
48 50 #endif
49 51
  52 +#ifdef ASM_CFI_SUPPORTED
  53 +#define CFI_STARTPROC .cfi_startproc
  54 +#define CFI_ENDPROC .cfi_endproc
  55 +#define CFI_ADJUST(n) .cfi_adjust_cfa_offset n
  56 +#else
  57 +#define CFI_STARTPROC
  58 +#define CFI_ENDPROC
  59 +#define CFI_ADJUST(n)
  60 +#endif
  61 +
50 62 #ifdef __PIC__
51 63
52 64 /* Position-independent operations on global variables. */
@@ -125,6 +137,7 @@
125 137 /* Allocation */
126 138
127 139 FUNCTION(G(caml_call_gc))
  140 + CFI_STARTPROC
128 141 RECORD_STACK_FRAME(0)
129 142 .Lcaml_call_gc:
130 143 /* Build array of registers, save it into caml_gc_regs */
@@ -147,6 +160,7 @@ FUNCTION(G(caml_call_gc))
147 160 STORE_VAR(%r14, caml_exception_pointer)
148 161 /* Save floating-point registers */
149 162 subq $(16*8), %rsp
  163 + CFI_ADJUST(232)
150 164 movsd %xmm0, 0*8(%rsp)
151 165 movsd %xmm1, 1*8(%rsp)
152 166 movsd %xmm2, 2*8(%rsp)
@@ -199,8 +213,10 @@ FUNCTION(G(caml_call_gc))
199 213 popq %rbp
200 214 popq %r12
201 215 popq %r13
  216 + CFI_ADJUST(-232)
202 217 /* Return to caller */
203 218 ret
  219 + CFI_ENDPROC
204 220
205 221 FUNCTION(G(caml_alloc1))
206 222 .Lcaml_alloc1:
@@ -277,6 +293,7 @@ FUNCTION(G(caml_c_call))
277 293 /* Start the Caml program */
278 294
279 295 FUNCTION(G(caml_start_program))
  296 + CFI_STARTPROC
280 297 /* Save callee-save registers */
281 298 pushq %rbx
282 299 pushq %rbp
@@ -285,6 +302,7 @@ FUNCTION(G(caml_start_program))
285 302 pushq %r14
286 303 pushq %r15
287 304 subq $8, %rsp /* stack 16-aligned */
  305 + CFI_ADJUST(56)
288 306 /* Initial entry point is G(caml_program) */
289 307 leaq GCALL(caml_program)(%rip), %r12
290 308 /* Common code for caml_start_program and caml_callback* */
@@ -294,6 +312,7 @@ FUNCTION(G(caml_start_program))
294 312 PUSH_VAR(caml_gc_regs)
295 313 PUSH_VAR(caml_last_return_address)
296 314 PUSH_VAR(caml_bottom_of_stack)
  315 + CFI_ADJUST(32)
297 316 /* Setup alloc ptr and exception ptr */
298 317 LOAD_VAR(caml_young_ptr, %r15)
299 318 LOAD_VAR(caml_exception_pointer, %r14)
@@ -301,6 +320,7 @@ FUNCTION(G(caml_start_program))
301 320 lea .L108(%rip), %r13
302 321 pushq %r13
303 322 pushq %r14
  323 + CFI_ADJUST(16)
304 324 movq %rsp, %r14
305 325 /* Call the Caml code */
306 326 call *%r12
@@ -308,6 +328,7 @@ FUNCTION(G(caml_start_program))
308 328 /* Pop the exception handler */
309 329 popq %r14
310 330 popq %r12 /* dummy register */
  331 + CFI_ADJUST(-16)
311 332 .L109:
312 333 /* Update alloc ptr and exception ptr */
313 334 STORE_VAR(%r15,caml_young_ptr)
@@ -332,6 +353,7 @@ FUNCTION(G(caml_start_program))
332 353 /* Mark the bucket as an exception result and return it */
333 354 orq $2, %rax
334 355 jmp .L109
  356 + CFI_ENDPROC
335 357
336 358 /* Raise an exception from Caml */
337 359
21 asmrun/i386.S
@@ -16,6 +16,8 @@
16 16 /* Asm part of the runtime system, Intel 386 processor */
17 17 /* Must be preprocessed by cpp */
18 18
  19 +#include "../config/m.h"
  20 +
19 21 /* Linux/BSD with ELF binaries and Solaris do not prefix identifiers with _.
20 22 Linux/BSD with a.out binaries and NextStep do. */
21 23
@@ -42,6 +44,16 @@
42 44 #define FUNCTION_ALIGN 2
43 45 #endif
44 46
  47 +#ifdef ASM_CFI_SUPPORTED
  48 +#define CFI_STARTPROC .cfi_startproc
  49 +#define CFI_ENDPROC .cfi_endproc
  50 +#define CFI_ADJUST(n) .cfi_adjust_cfa_offset n
  51 +#else
  52 +#define CFI_STARTPROC
  53 +#define CFI_ENDPROC
  54 +#define CFI_ADJUST(n)
  55 +#endif
  56 +
45 57 #if defined(PROFILING)
46 58 #if defined(SYS_linux_elf) || defined(SYS_gnu)
47 59 #define PROFILE_CAML \
@@ -89,6 +101,7 @@
89 101
90 102 .align FUNCTION_ALIGN
91 103 G(caml_call_gc):
  104 + CFI_STARTPROC
92 105 PROFILE_CAML
93 106 /* Record lowest stack address and return address */
94 107 movl 0(%esp), %eax
@@ -104,6 +117,7 @@ LBL(105):
104 117 pushl %ecx
105 118 pushl %ebx
106 119 pushl %eax
  120 + CFI_ADJUST(28)
107 121 movl %esp, G(caml_gc_regs)
108 122 /* MacOSX note: 16-alignment of stack preserved at this point */
109 123 /* Call the garbage collector */
@@ -116,8 +130,10 @@ LBL(105):
116 130 popl %esi
117 131 popl %edi
118 132 popl %ebp
  133 + CFI_ADJUST(-28)
119 134 /* Return to caller */
120 135 ret
  136 + CFI_ENDPROC
121 137
122 138 .align FUNCTION_ALIGN
123 139 G(caml_alloc1):
@@ -219,12 +235,14 @@ G(caml_c_call):
219 235 .globl G(caml_start_program)
220 236 .align FUNCTION_ALIGN
221 237 G(caml_start_program):
  238 + CFI_STARTPROC
222 239 PROFILE_C
223 240 /* Save callee-save registers */
224 241 pushl %ebx
225 242 pushl %esi
226 243 pushl %edi
227 244 pushl %ebp
  245 + CFI_ADJUST(16)
228 246 /* Initial entry point is caml_program */
229 247 movl $ G(caml_program), %esi
230 248 /* Common code for caml_start_program and caml_callback* */
@@ -238,6 +256,7 @@ LBL(106):
238 256 pushl $ LBL(108)
239 257 ALIGN_STACK(8)
240 258 pushl G(caml_exception_pointer)
  259 + CFI_ADJUST(20)
241 260 movl %esp, G(caml_exception_pointer)
242 261 /* Call the Caml code */
243 262 call *%esi
@@ -249,6 +268,7 @@ LBL(107):
249 268 #else
250 269 addl $4, %esp
251 270 #endif
  271 + CFI_ADJUST(-8)
252 272 LBL(109):
253 273 /* Pop the callback link, restoring the global variables */
254 274 popl G(caml_bottom_of_stack)
@@ -266,6 +286,7 @@ LBL(108):
266 286 /* Mark the bucket as an exception result and return it */
267 287 orl $2, %eax
268 288 jmp LBL(109)
  289 + CFI_ENDPROC
269 290
270 291 /* Raise an exception from Caml */
271 292
3  config/auto-aux/cfi.S
... ... @@ -0,0 +1,3 @@
  1 +.cfi_startproc
  2 +.cfi_adjust_cfa_offset 8
  3 +.cfi_endproc
7 config/auto-aux/tryassemble
... ... @@ -0,0 +1,7 @@
  1 +#!/bin/sh
  2 +if test "$verbose" = yes; then
  3 +echo "tryassemble: $aspp -o tst $*" >&2
  4 +$aspp -o tst $* || exit 100
  5 +else
  6 +$aspp -o tst $* 2> /dev/null || exit 100
  7 +fi
17 configure
@@ -1591,6 +1591,17 @@ else
1591 1591 echo "LIBBFD_LINK=" >> Makefile
1592 1592 fi
1593 1593
  1594 +# Check whether assembler supports CFI directives
  1595 +
  1596 +asm_cfi_supported=false
  1597 +
  1598 +export aspp
  1599 +
  1600 +if sh ./tryassemble cfi.S; then
  1601 + echo "#define ASM_CFI_SUPPORTED" >> m.h
  1602 + asm_cfi_supported=true
  1603 +fi
  1604 +
1594 1605 # Final twiddling of compiler options to work around known bugs
1595 1606
1596 1607 nativeccprofopts="$nativecccompopts"
@@ -1660,6 +1671,7 @@ echo "CMXS=$cmxs" >> Makefile
1660 1671 echo "MKEXE=$mkexe" >> Makefile
1661 1672 echo "MKDLL=$mksharedlib" >> Makefile
1662 1673 echo "MKMAINDLL=$mkmaindll" >> Makefile
  1674 +echo "ASM_CFI_SUPPORTED=$asm_cfi_supported" >> Makefile
1663 1675
1664 1676 rm -f tst hasgot.c
1665 1677 rm -f ../m.h ../s.h ../Makefile
@@ -1704,6 +1716,11 @@ else
1704 1716 echo " options for linking....... $nativecclinkopts $cclibs"
1705 1717 echo " assembler ................ $as"
1706 1718 echo " preprocessed assembler ... $aspp"
  1719 + if test "$asm_cfi_supported" = "true"; then
  1720 + echo " assembler supports CFI ... yes"
  1721 + else
  1722 + echo " assembler supports CFI ... no"
  1723 + fi
1707 1724 echo " native dynlink ........... $natdynlink"
1708 1725 if test "$profiling" = "prof"; then
1709 1726 echo " profiling with gprof ..... supported"
2  utils/config.mlbuild
@@ -88,6 +88,7 @@ let model = C.model
88 88 let system = C.system
89 89
90 90 let asm = C.asm
  91 +let asm_cfi_supported = C.asm_cfi_supported
91 92
92 93 let ext_obj = C.ext_obj
93 94 let ext_asm = C.ext_asm
@@ -121,6 +122,7 @@ let print_config oc =
121 122 p "model" model;
122 123 p "system" system;
123 124 p "asm" asm;
  125 + p_bool "asm_cfi_supported" asm_cfi_supported;
124 126 p "ext_obj" ext_obj;
125 127 p "ext_asm" ext_asm;
126 128 p "ext_lib" ext_lib;
3  utils/config.mli
@@ -98,6 +98,9 @@ val asm: string
98 98 (* The assembler (and flags) to use for assembling
99 99 ocamlopt-generated code. *)
100 100
  101 +val asm_cfi_supported: bool
  102 + (* Whether assembler understands CFI directives *)
  103 +
101 104 val ext_obj: string
102 105 (* Extension for object files, e.g. [.o] under Unix. *)
103 106 val ext_asm: string
2  utils/config.mlp
@@ -77,6 +77,7 @@ let model = "%%MODEL%%"
77 77 let system = "%%SYSTEM%%"
78 78
79 79 let asm = "%%ASM%%"
  80 +let asm_cfi_supported = %%ASM_CFI_SUPPORTED%%
80 81
81 82 let ext_obj = "%%EXT_OBJ%%"
82 83 let ext_asm = "%%EXT_ASM%%"
@@ -110,6 +111,7 @@ let print_config oc =
110 111 p "model" model;
111 112 p "system" system;
112 113 p "asm" asm;
  114 + p_bool "asm_cfi_supported" asm_cfi_supported;
113 115 p "ext_obj" ext_obj;
114 116 p "ext_asm" ext_asm;
115 117 p "ext_lib" ext_lib;

0 comments on commit 0a5bb75

Please sign in to comment.
Something went wrong with that request. Please try again.