From: Stephane Glondu Date: Wed, 13 Nov 2013 13:29:30 +0000 (+0100) Subject: Fix native backtraces on arm* X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~187 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0520662c9ecb022842723f56f49d9f326536e240;p=ocaml.git Fix native backtraces on arm* --- 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 index 00000000..eab92804 --- /dev/null +++ b/debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-and-sparc.patch @@ -0,0 +1,25 @@ +From: Stephane Glondu +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 index 35372e9c..00000000 --- a/debian/patches/0014-Native-backtraces-don-t-work-on-powerpc-sparc-and-ar.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Stephane Glondu -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 index 00000000..3e2ca3fc --- /dev/null +++ b/debian/patches/0015-Fix-native-backtraces-on-arm.patch @@ -0,0 +1,59 @@ +From: Stephane Glondu +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 +--- + 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 + +-- diff --git a/debian/patches/series b/debian/patches/series index efbcf038..85a784a4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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