summaryrefslogtreecommitdiff
path: root/bytecomp
diff options
context:
space:
mode:
authorTom Kelly <ctk21@cl.cam.ac.uk>2021-03-05 17:18:04 +0000
committerTom Kelly <ctk21@cl.cam.ac.uk>2021-03-05 17:18:04 +0000
commit18d0029479c739f212c859d86a248c7d7d958213 (patch)
treeaf38472c9bf9372d18bb1b36c7bc6ec8bee9464c /bytecomp
parentedc8a7664193fd3f4704065286c4076c470e46f3 (diff)
parent58adc59581cdd70ef4861ced8a9a0f448230b0f2 (diff)
downloadocaml-18d0029479c739f212c859d86a248c7d7d958213.tar.gz
Merge commit '58adc59581cdd70ef4861ced8a9a0f448230b0f2' into parallel_minor_gc_4_12
Diffstat (limited to 'bytecomp')
-rw-r--r--bytecomp/bytelink.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml
index b8c874b234..fd5bd490aa 100644
--- a/bytecomp/bytelink.ml
+++ b/bytecomp/bytelink.ml
@@ -466,7 +466,8 @@ let link_bytecode_as_c tolink outfile with_main =
(fun () ->
(* The bytecode *)
output_string outchan "\
-#define CAML_INTERNALS\
+#define CAML_INTERNALS\n\
+#define CAMLDLLIMPORT\
\n\
\n#ifdef __cplusplus\
\nextern \"C\" {\
@@ -573,7 +574,13 @@ let build_custom_runtime prim_name exec_name =
else "-lcamlrun" ^ !Clflags.runtime_variant in
let debug_prefix_map =
if Config.c_has_debug_prefix_map && not !Clflags.keep_camlprimc_file then
- [Printf.sprintf "-fdebug-prefix-map=%s=camlprim.c" prim_name]
+ let flag =
+ [Printf.sprintf "-fdebug-prefix-map=%s=camlprim.c" prim_name]
+ in
+ if Ccomp.linker_is_flexlink then
+ "-link" :: flag
+ else
+ flag
else
[] in
let exitcode =