Fix native backtraces on arm*
authorStephane Glondu <steph@glondu.net>
Wed, 13 Nov 2013 13:29:30 +0000 (14:29 +0100)
committerStephane Glondu <steph@glondu.net>
Wed, 13 Nov 2013 13:29:30 +0000 (14:29 +0100)
debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch [new file with mode: 0644]
debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-sparc-and-ar.patch [deleted file]
debian/patches/0015-Fix-native-backtraces-on-arm.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch b/debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch
new file mode 100644 (file)
index 0000000..eab9280
--- /dev/null
@@ -0,0 +1,25 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Wed, 13 Nov 2013 14:28:16 +0100
+Subject: Native backtraces don't work on powerpc and sparc
+
+---
+ testsuite/tests/backtrace/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/testsuite/tests/backtrace/Makefile b/testsuite/tests/backtrace/Makefile
+index 83f9472..e71863a 100644
+--- a/testsuite/tests/backtrace/Makefile
++++ b/testsuite/tests/backtrace/Makefile
+@@ -18,7 +18,10 @@ OTHERFILES=backtrace2.ml raw_backtrace.ml
+ default:
+       $(MAKE) byte
+-      @if $(BYTECODE_ONLY); then : ; else $(MAKE) native; fi
++      @case `dpkg-architecture -qDEB_BUILD_ARCH` in \
++        sparc|powerpc) : ;; \
++        *) if $(BYTECODE_ONLY) ; then : ; else $(MAKE) native; fi ;; \
++      esac
+ .PHONY: byte
+ byte:
+-- 
diff --git a/debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-sparc-and-ar.patch b/debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-sparc-and-ar.patch
deleted file mode 100644 (file)
index 35372e9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Stephane Glondu <steph@glondu.net>
-Date: Sat, 9 Nov 2013 07:56:39 +0100
-Subject: Native backtraces don't work on powerpc, sparc and arm*
-
----
- testsuite/tests/backtrace/Makefile | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/testsuite/tests/backtrace/Makefile b/testsuite/tests/backtrace/Makefile
-index 83f9472..ce563be 100644
---- a/testsuite/tests/backtrace/Makefile
-+++ b/testsuite/tests/backtrace/Makefile
-@@ -18,7 +18,10 @@ OTHERFILES=backtrace2.ml raw_backtrace.ml
- default:
-       $(MAKE) byte
--      @if $(BYTECODE_ONLY); then : ; else $(MAKE) native; fi
-+      @case `dpkg-architecture -qDEB_BUILD_ARCH` in \
-+        sparc|powerpc|arm*) : ;; \
-+        *) if $(BYTECODE_ONLY) ; then : ; else $(MAKE) native; fi ;; \
-+      esac
- .PHONY: byte
- byte:
--- 
diff --git a/debian/patches/0015-Fix-native-backtraces-on-arm.patch b/debian/patches/0015-Fix-native-backtraces-on-arm.patch
new file mode 100644 (file)
index 0000000..3e2ca3f
--- /dev/null
@@ -0,0 +1,59 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Wed, 13 Nov 2013 14:28:20 +0100
+Subject: Fix native backtraces on arm*
+
+Author: Jacques-Henri Jourdan
+Bug: http://caml.inria.fr/mantis/view.php?id=6233
+Signed-off-by: Stephane Glondu <steph@glondu.net>
+---
+ asmcomp/linearize.ml  | 6 ++++++
+ asmcomp/linearize.mli | 3 +++
+ asmcomp/schedgen.ml   | 3 ++-
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/asmcomp/linearize.ml b/asmcomp/linearize.ml
+index 963ffe9..5095c3a 100644
+--- a/asmcomp/linearize.ml
++++ b/asmcomp/linearize.ml
+@@ -86,6 +86,12 @@ let instr_cons d a r n =
+   { desc = d; next = n; arg = a; res = r;
+     dbg = Debuginfo.none; live = Reg.Set.empty }
++(* Cons an instruction (live empty) *)
++
++let instr_cons_debug d a r dbg n =
++ { desc = d; next = n; arg = a; res = r;
++ dbg = dbg; live = Reg.Set.empty }
++
+ (* Cons a simple instruction (arg, res, live empty) *)
+ let cons_instr d n =
+diff --git a/asmcomp/linearize.mli b/asmcomp/linearize.mli
+index ad5dc3a..ca203a7 100644
+--- a/asmcomp/linearize.mli
++++ b/asmcomp/linearize.mli
+@@ -42,6 +42,9 @@ val has_fallthrough :  instruction_desc -> bool
+ val end_instr: instruction
+ val instr_cons:
+   instruction_desc -> Reg.t array -> Reg.t array -> instruction -> instruction
++val instr_cons_debug:
++ instruction_desc -> Reg.t array -> Reg.t array -> Debuginfo.t ->
++ instruction -> instruction
+ val invert_test: Mach.test -> Mach.test
+ type fundecl =
+diff --git a/asmcomp/schedgen.ml b/asmcomp/schedgen.ml
+index 885c945..a04ab27 100644
+--- a/asmcomp/schedgen.ml
++++ b/asmcomp/schedgen.ml
+@@ -336,7 +336,8 @@ method private reschedule ready_queue date cont =
+             if son.emitted_ancestors = son.ancestors then
+               new_queue := son :: !new_queue)
+           node.sons;
+-        instr_cons node.instr.desc node.instr.arg node.instr.res
++        instr_cons_debug node.instr.desc node.instr.arg node.instr.res
++        node.instr.dbg
+           (self#reschedule !new_queue (date + issue_cycles) cont)
+   end
+-- 
index efbcf038342d564fc0d72f5bf0027273746a05a6..85a784a49c661beb20e23eae8fac460c17106045 100644 (file)
@@ -11,4 +11,5 @@
 0011-Enable-mkstemp-in-yacc.patch
 0012-Fix-ocamlopt-on-sparc.patch
 0013-Tune-resource-usage-of-some-tests.patch
-0014-Native-backtraces-don-t-work-on-powerpc-sparc-and-ar.patch
+0014-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch
+0015-Fix-native-backtraces-on-arm.patch