@@ -1682,6 +1682,9 @@ let configure i =
1682
1682
let target = Key. (get ctx target) in
1683
1683
Log. info (fun m -> m " Configuring for target: %a" Key. pp_target target);
1684
1684
let opam_name = unikernel_name target name in
1685
+ let target_debug = Key. (get ctx target_debug) in
1686
+ if target_debug && target <> `Ukvm then
1687
+ Log. warn (fun m -> m " -g not supported for target: %a" Key. pp_target target);
1685
1688
configure_myocamlbuild () >> = fun () ->
1686
1689
configure_opam ~name: opam_name i >> = fun () ->
1687
1690
configure_makefile ~opam_name >> = fun () ->
@@ -1798,7 +1801,7 @@ let ldflags pkg = pkg_config pkg ["--variable=ldflags"]
1798
1801
1799
1802
let ldpostflags pkg = pkg_config pkg [" --variable=ldpostflags" ]
1800
1803
1801
- let link info name target =
1804
+ let link info name target target_debug =
1802
1805
let libs = Info. libraries info in
1803
1806
match target with
1804
1807
| `Unix | `MacOSX ->
@@ -1862,7 +1865,7 @@ let link info name target =
1862
1865
| "mirage-net-solo5" -> " net" :: acc
1863
1866
| "mirage-block-solo5" -> " blk" :: acc
1864
1867
| _ -> acc)
1865
- [] libs
1868
+ [] libs @ ( if target_debug then [ " gdb " ] else [] )
1866
1869
in
1867
1870
pkg_config " solo5-kernel-ukvm" [" --variable=libdir" ] >> = function
1868
1871
| [ libdir ] ->
@@ -1879,9 +1882,10 @@ let build i =
1879
1882
let warn_error = Key. (get ctx warn_error) in
1880
1883
let target = Key. (get ctx target) in
1881
1884
let libs = Info. libraries i in
1885
+ let target_debug = Key. (get ctx target_debug) in
1882
1886
check_entropy libs >> = fun () ->
1883
1887
compile libs warn_error target >> = fun () ->
1884
- link i name target >> | fun out ->
1888
+ link i name target target_debug >> | fun out ->
1885
1889
Log. info (fun m -> m " Build succeeded: %s" out)
1886
1890
1887
1891
let clean i =
@@ -1928,6 +1932,7 @@ module Project = struct
1928
1932
method! keys = [
1929
1933
Key. (abstract target);
1930
1934
Key. (abstract warn_error);
1935
+ Key. (abstract target_debug);
1931
1936
]
1932
1937
method! packages =
1933
1938
let common = [
0 commit comments