Merge pull request #9925 from dra27/fdebug-prefix-map-PR

Fix -fdebug-prefix-map when using flexlink
master
David Allsopp 2020-09-21 13:32:58 +01:00 committed by GitHub
commit 507f40ecd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -481,6 +481,10 @@ Working version
(Xavier Leroy, report by Alain Frisch, review by Nicolás Ojeda Bär
and Alain Frisch)
- #9925: Correct passing -fdebug-prefix-map to flexlink on Cygwin by prefixing
it with -link.
(David Allsopp, review by ???)
OCaml 4.11.1
------------

View File

@ -573,7 +573,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 =

View File

@ -206,3 +206,9 @@ let call_linker mode output_name files extra =
in
command cmd
)
let linker_is_flexlink =
(* Config.mkexe, Config.mkdll and Config.mkmaindll are all flexlink
invocations for the native Windows ports and for Cygwin, if shared library
support is enabled. *)
Sys.win32 || Config.supports_shared_libraries && Sys.cygwin

View File

@ -37,3 +37,5 @@ type link_mode =
| Partial
val call_linker: link_mode -> string -> string list -> string -> int
val linker_is_flexlink : bool