File ocaml-3.12-fix-size-directive.patch of Package ocaml

PR#5237: incorrect .size directives generated for x86-32 and x86-64
See http://caml.inria.fr/cgi-bin/viewcvs.cgi?diff_format=u&rev=10981&view=rev

--- asmcomp/amd64/emit.mlp	2011/03/13 13:33:17	10980
+++ asmcomp/amd64/emit.mlp	2011/03/13 13:36:00	10981
@@ -688,17 +688,18 @@
   emit_all true fundecl.fun_body;
   List.iter emit_call_gc !call_gc_sites;
   emit_call_bound_errors ();
+  begin match Config.system with
+    "linux" | "gnu" ->
+      `	.type	{emit_symbol fundecl.fun_name},@function\n`;
+      `	.size	{emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
+    | _ -> ()
+  end;
   if !float_constants <> [] then begin
     if macosx
     then `	.literal8\n`
     else `	.section	.rodata.cst8,\"a\",@progbits\n`;
     List.iter emit_float_constant !float_constants
-  end;
-  match Config.system with
-    "linux" | "gnu" ->
-      `	.type	{emit_symbol fundecl.fun_name},@function\n`;
-      `	.size	{emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
-  | _ -> ()
+  end
 
 (* Emission of data *)
 
--- asmcomp/i386/emit.mlp	2011/03/13 13:33:17	10980
+++ asmcomp/i386/emit.mlp	2011/03/13 13:36:00	10981
@@ -905,12 +905,12 @@
   emit_all true fundecl.fun_body;
   List.iter emit_call_gc !call_gc_sites;
   emit_call_bound_errors ();
-  List.iter emit_float_constant !float_constants;
-  match Config.system with
+  begin match Config.system with
     "linux_elf" | "bsd_elf" | "gnu" ->
       `	.type	{emit_symbol fundecl.fun_name},@function\n`;
       `	.size	{emit_symbol fundecl.fun_name},.-{emit_symbol fundecl.fun_name}\n`
-  | _ -> ()
+  | _ -> () end;
+  List.iter emit_float_constant !float_constants
 
 
 (* Emission of data *)
openSUSE Build Service is sponsored by