From 05d5087a405faabd030556ae7fe966238e6aad89 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Jun 05 2018 20:04:48 +0000 Subject: Add RISC-V patch to add debuginfo (DWARF) generation. --- diff --git a/0001-Don-t-add-rpaths-to-libraries.patch b/0001-Don-t-add-rpaths-to-libraries.patch index 8236abe..3ebed03 100644 --- a/0001-Don-t-add-rpaths-to-libraries.patch +++ b/0001-Don-t-add-rpaths-to-libraries.patch @@ -1,7 +1,7 @@ From b53eed0544eaa4ac264e405bd73a43ca3fb574d8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jun 2014 10:00:15 +0100 -Subject: [PATCH 1/6] Don't add rpaths to libraries. +Subject: [PATCH 1/7] Don't add rpaths to libraries. --- tools/Makefile | 4 ++-- @@ -23,5 +23,5 @@ index 78d2a1068..fbec019ed 100644 sed -n -e 's/^#ml //p' ../config/Makefile) \ > ocamlmklibconfig.ml -- -2.15.1 +2.16.2 diff --git a/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch b/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch index d927d2b..cfd64ef 100644 --- a/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch +++ b/0002-ocamlbyteinfo-ocamlplugininfo-Useful-utilities-from-.patch @@ -1,7 +1,7 @@ From 010f13a4bc64e3d37aaea3b4fee56295672b91ff Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:40:36 +0100 -Subject: [PATCH 2/6] ocamlbyteinfo, ocamlplugininfo: Useful utilities from +Subject: [PATCH 2/7] ocamlbyteinfo, ocamlplugininfo: Useful utilities from Debian, sent upstream. See: @@ -236,5 +236,5 @@ index 000000000..e28800f31 + header.units + end -- -2.15.1 +2.16.2 diff --git a/0003-configure-Allow-user-defined-C-compiler-flags.patch b/0003-configure-Allow-user-defined-C-compiler-flags.patch index 543d1da..93913a3 100644 --- a/0003-configure-Allow-user-defined-C-compiler-flags.patch +++ b/0003-configure-Allow-user-defined-C-compiler-flags.patch @@ -1,7 +1,7 @@ From 19dbb0c6b73513dddef2702daedcb68bba375af1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 29 May 2012 20:44:18 +0100 -Subject: [PATCH 3/6] configure: Allow user defined C compiler flags. +Subject: [PATCH 3/7] configure: Allow user defined C compiler flags. --- configure | 4 ++++ @@ -23,5 +23,5 @@ index 1316b3c1e..53f45f85b 100755 cclibs="$cclibs $mathlib" -- -2.15.1 +2.16.2 diff --git a/0004-Add-RISC-V-backend.patch b/0004-Add-RISC-V-backend.patch index 6174455..0be06ac 100644 --- a/0004-Add-RISC-V-backend.patch +++ b/0004-Add-RISC-V-backend.patch @@ -1,7 +1,7 @@ From 08c2bdb60e291ddf55cb82053c39215ff9dac069 Mon Sep 17 00:00:00 2001 From: Nicolas Ojeda Bar Date: Fri, 27 Oct 2017 17:05:25 +0200 -Subject: [PATCH 4/6] Add RISC-V backend +Subject: [PATCH 4/7] Add RISC-V backend --- README.adoc | 1 + @@ -1764,5 +1764,5 @@ index 53f45f85b..cf5a4a02a 100755 case "$ccfamily" in clang-*) -- -2.15.1 +2.16.2 diff --git a/0005-Copyright-untabify.patch b/0005-Copyright-untabify.patch index c22eb52..98082d6 100644 --- a/0005-Copyright-untabify.patch +++ b/0005-Copyright-untabify.patch @@ -1,7 +1,7 @@ From 58821468995b2dbe18cb1c7259fc5447e2c417ca Mon Sep 17 00:00:00 2001 From: Nicolas Ojeda Bar Date: Fri, 1 Dec 2017 14:39:46 +0100 -Subject: [PATCH 5/6] Copyright, untabify +Subject: [PATCH 5/7] Copyright, untabify --- asmrun/riscv.S | 608 ++++++++++++++++++++++++++++----------------------------- @@ -713,5 +713,5 @@ index a82048efc..88d7ab924 100644 + .align 3 + .size caml_system__frametable, .-caml_system__frametable -- -2.15.1 +2.16.2 diff --git a/0006-fix-caml_c_call-reload-caml_young_limit.patch b/0006-fix-caml_c_call-reload-caml_young_limit.patch index 8e5f6e3..fad5fd7 100644 --- a/0006-fix-caml_c_call-reload-caml_young_limit.patch +++ b/0006-fix-caml_c_call-reload-caml_young_limit.patch @@ -1,7 +1,7 @@ From eba9efdbf5e1cecf39e93e16e6e9d0847e3abb15 Mon Sep 17 00:00:00 2001 From: Nicolas Ojeda Bar Date: Sat, 2 Dec 2017 10:44:41 +0100 -Subject: [PATCH 6/6] fix caml_c_call: reload caml_young_limit +Subject: [PATCH 6/7] fix caml_c_call: reload caml_young_limit --- asmrun/riscv.S | 2 +- @@ -21,5 +21,5 @@ index 88d7ab924..121f8ba71 100644 jr s2 .size caml_c_call, .-caml_c_call -- -2.15.1 +2.16.2 diff --git a/0007-riscv-Emit-debug-info.patch b/0007-riscv-Emit-debug-info.patch new file mode 100644 index 0000000..11a7153 --- /dev/null +++ b/0007-riscv-Emit-debug-info.patch @@ -0,0 +1,40 @@ +From ed16ef068b566b5e172c7b40dc9e5159ea900c03 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 5 Jun 2018 19:48:08 +0000 +Subject: [PATCH 7/7] riscv: Emit debug info. + +--- + asmcomp/riscv/emit.mlp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/asmcomp/riscv/emit.mlp b/asmcomp/riscv/emit.mlp +index 51165d0f1..f32477a8f 100644 +--- a/asmcomp/riscv/emit.mlp ++++ b/asmcomp/riscv/emit.mlp +@@ -261,6 +261,7 @@ let tailrec_entry_point = ref 0 + (* Output the assembly code for an instruction *) + + let emit_instr i = ++ emit_debug_info i.dbg; + match i.desc with + Lend -> () + | Lop(Imove | Ispill | Ireload) -> +@@ -554,6 +555,7 @@ let fundecl fundecl = + emit_stack_adjustment (-n); + if !contains_calls then store_ra n; + `{emit_label !tailrec_entry_point}:\n`; ++ emit_debug_info fundecl.fun_dbg; + emit_all fundecl.fun_body; + List.iter emit_call_gc !call_gc_sites; + List.iter emit_call_bound_error !bound_error_sites; +@@ -613,6 +615,7 @@ let data l = + + let begin_assembly() = + ` .file \"\"\n`; (* PR#7073 *) ++ reset_debug_info (); + (* Emit the beginning of the segments *) + let lbl_begin = Compilenv.make_symbol (Some "data_begin") in + ` {emit_string data_space}\n`; +-- +2.16.2 + diff --git a/ocaml.spec b/ocaml.spec index 3a0a615..4b95236 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -27,7 +27,7 @@ Name: ocaml Version: 4.07.0 -Release: 0.beta2.0%{?dist} +Release: 0.beta2.1%{?dist} Summary: OCaml compiler and programming environment @@ -64,6 +64,10 @@ Patch0004: 0004-Add-RISC-V-backend.patch Patch0005: 0005-Copyright-untabify.patch Patch0006: 0006-fix-caml_c_call-reload-caml_young_limit.patch +# RISC-V patch to add debuginfo (DWARF) generation. +# Sent upstream 2018-06-05. +Patch0007: 0007-riscv-Emit-debug-info.patch + BuildRequires: gcc BuildRequires: binutils-devel BuildRequires: ncurses-devel @@ -430,6 +434,9 @@ find $RPM_BUILD_ROOT \( -name '*.cmt' -o -name '*.cmti' \) -a -delete %changelog +* Tue Jun 5 2018 Richard W.M. Jones - 4.07.0-0.beta2.1 +- Add RISC-V patch to add debuginfo (DWARF) generation. + * Thu Apr 26 2018 Richard W.M. Jones - 4.07.0-0.beta2.0 - OCaml 4.07.0-beta2 (RHBZ#1536734).