Skip to content

Commit d4eca98

Browse files
authored
Build dwarf_ocaml/ files as part of ocamloptcomp (#1641)
1 parent c9ce9fa commit d4eca98

File tree

3 files changed

+25
-35
lines changed

3 files changed

+25
-35
lines changed

backend/debug/dwarf/dwarf_ocaml/dune

Lines changed: 0 additions & 9 deletions
This file was deleted.

backend/emitaux.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,6 @@ let reduce_heap_size ~reset =
434434
end
435435

436436
module Dwarf_helpers = struct
437-
open Dwarf_ocaml
438-
439437
let dwarf = ref None
440438
let sourcefile_for_dwarf = ref None
441439

@@ -481,7 +479,7 @@ module Dwarf_helpers = struct
481479
| true, _, _
482480
| false, _, _ -> ()
483481

484-
let emit_dwarf () = Option.iter Dwarf_ocaml.Dwarf.emit !dwarf
482+
let emit_dwarf () = Option.iter Dwarf.emit !dwarf
485483

486484
let record_dwarf_for_fundecl ~fun_name fun_dbg =
487485
match !dwarf with

dune

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
(copy_files# backend/debug/*.ml{,i})
1919

20+
(copy_files# backend/debug/dwarf/dwarf_ocaml/*.ml{,i})
21+
2022
(copy_files# backend/internal_assembler/*.ml{,i})
2123

2224
(copy_files# backend/regalloc/*.ml{,i})
@@ -271,6 +273,13 @@
271273
available_regs
272274
reg_with_debug_info
273275
compute_ranges
276+
;; asmcomp/debug/dwarf/dwarf_ocaml
277+
;; This code has a lot of dependencies into ocamloptcomp, so we just
278+
;; build it as part of that library.
279+
dwarf
280+
dwarf_compilation_unit
281+
dwarf_concrete_instances
282+
dwarf_state
274283
;; driver/
275284
opterrors
276285
optcompile
@@ -288,9 +297,10 @@
288297
flambda_backend_utils
289298
flambda2_identifiers
290299
flambda2_cmx
291-
dwarf_ocaml
292300
compiler_owee
293-
gc_timings))
301+
gc_timings
302+
dwarf_low
303+
dwarf_high))
294304

295305
(library
296306
(name flambda_backend_common)
@@ -348,7 +358,8 @@
348358
(backend bisect_ppx))
349359
(flags
350360
(:standard -principal))
351-
(ocamlopt_flags (:standard -runtime-variant nnp))
361+
(ocamlopt_flags
362+
(:standard -runtime-variant nnp))
352363
(libraries
353364
flambda_backend_driver
354365
memtrace
@@ -397,7 +408,6 @@
397408
%{dep:backend/asm_targets/asm_targets.a}
398409
%{dep:backend/debug/dwarf/dwarf_low/dwarf_low.a}
399410
%{dep:backend/debug/dwarf/dwarf_high/dwarf_high.a}
400-
%{dep:backend/debug/dwarf/dwarf_ocaml/dwarf_ocaml.a}
401411
%{dep:flambda_backend_common.a}
402412
%{dep:utils/flambda_backend_utils.a}
403413
%{dep:middle_end/flambda2/import/flambda2_import.a}
@@ -434,7 +444,6 @@
434444
%{dep:backend/asm_targets/asm_targets.cma}
435445
%{dep:backend/debug/dwarf/dwarf_low/dwarf_low.cma}
436446
%{dep:backend/debug/dwarf/dwarf_high/dwarf_high.cma}
437-
%{dep:backend/debug/dwarf/dwarf_ocaml/dwarf_ocaml.cma}
438447
%{dep:flambda_backend_common.cma}
439448
%{dep:utils/flambda_backend_utils.cma}
440449
%{dep:middle_end/flambda2/import/flambda2_import.cma}
@@ -471,7 +480,6 @@
471480
%{dep:backend/asm_targets/asm_targets.cmxa}
472481
%{dep:backend/debug/dwarf/dwarf_low/dwarf_low.cmxa}
473482
%{dep:backend/debug/dwarf/dwarf_high/dwarf_high.cmxa}
474-
%{dep:backend/debug/dwarf/dwarf_ocaml/dwarf_ocaml.cmxa}
475483
%{dep:flambda_backend_common.cmxa}
476484
%{dep:utils/flambda_backend_utils.cmxa}
477485
%{dep:middle_end/flambda2/import/flambda2_import.cmxa}
@@ -519,7 +527,6 @@
519527
(external/gc-timings/libgc_timings_stubs.a
520528
as
521529
compiler-libs/libgc_timings_stubs_native.a)
522-
523530
; for special_dune compat
524531
(ocamloptcomp_with_flambda2.cma as compiler-libs/ocamloptcomp.cma)
525532
(ocamloptcomp_with_flambda2.cmxa as compiler-libs/ocamloptcomp.cmxa)
@@ -541,8 +548,7 @@
541548
backend/asm_targets/.asm_targets.objs/byte/asm_targets.{cmi,cmo,cmt})
542549
(glob_files_rec
543550
backend/asm_targets/.asm_targets.objs/native/asm_targets.cmx)
544-
(glob_files
545-
middle_end/flambda2/.flambda2objs/byte/flambda2.{cmi,cmt})
551+
(glob_files middle_end/flambda2/.flambda2objs/byte/flambda2.{cmi,cmt})
546552
(glob_files
547553
middle_end/flambda2/to_cmm/.flambda2_to_cmm.objs/byte/flambda2_to_cmm{,__To_cmm}.{cmi,cmt})
548554
(glob_files
@@ -555,28 +561,23 @@
555561
backend/debug/dwarf/dwarf_flags/.dwarf_flags.objs/native/dwarf_flags.cmx
556562
(glob_files
557563
backend/debug/dwarf/dwarf_low/.dwarf_low.objs/byte/*.{cmi,cmo,cmt})
558-
(glob_files
559-
backend/debug/dwarf/dwarf_low/.dwarf_low.objs/native/*.cmx)
564+
(glob_files backend/debug/dwarf/dwarf_low/.dwarf_low.objs/native/*.cmx)
560565
(glob_files
561566
backend/debug/dwarf/dwarf_high/.dwarf_high.objs/byte/*.{cmi,cmo,cmt})
562-
(glob_files
563-
backend/debug/dwarf/dwarf_high/.dwarf_high.objs/native/*.cmx)
564-
(glob_files
565-
backend/debug/dwarf/dwarf_ocaml/.dwarf_ocaml.objs/byte/*.{cmi,cmo,cmt})
566-
(glob_files
567-
backend/debug/dwarf/dwarf_ocaml/.dwarf_ocaml.objs/native/*.cmx)
568-
(glob_files
569-
external/owee/.compiler_owee.objs/byte/*.{cmi,cmo,cmt,cmti})
570-
(glob_files
571-
external/owee/.compiler_owee.objs/native/*.cmx)
567+
(glob_files backend/debug/dwarf/dwarf_high/.dwarf_high.objs/native/*.cmx)
568+
(glob_files backend/debug/dwarf/dwarf_ocaml/.dwarf_ocaml.objs/native/*.cmx)
569+
(glob_files external/owee/.compiler_owee.objs/byte/*.{cmi,cmo,cmt,cmti})
570+
(glob_files external/owee/.compiler_owee.objs/native/*.cmx)
572571
(glob_files
573572
external/gc-timings/.gc_timings.objs/byte/gc_timings.{cmi,cmti})
574573
external/gc-timings/.gc_timings.objs/native/gc_timings.cmx)
575574
(action
576-
(with-stdout-to compiler-libs-installation.sexp
575+
(with-stdout-to
576+
compiler-libs-installation.sexp
577577
(run tools/gen_compiler_libs_installation.exe %{deps}))))
578578

579579
(install
580580
(section lib)
581581
(package ocaml)
582-
(files (include compiler-libs-installation.sexp)))
582+
(files
583+
(include compiler-libs-installation.sexp)))

0 commit comments

Comments
 (0)