Do not pass -runtime-variant _pic on Windows (#635)

This commit is contained in:
Jérémie Dimino 2018-03-19 19:13:02 -04:00 committed by GitHub
parent 45fa214314
commit 3f22d9f82b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,8 @@ next
everything in the universe. Jbuilder cannot cache the result of an action that everything in the universe. Jbuilder cannot cache the result of an action that
depend on the universe (#603, fixes #255 @diml) depend on the universe (#603, fixes #255 @diml)
- Don't pass `-runtime-variant _pic` on Windows (#635)
1.0+beta19 (14/03/2018) 1.0+beta19 (14/03/2018)
----------------------- -----------------------

View File

@ -47,7 +47,8 @@ module Linkage = struct
} }
let o_flags = ["-output-complete-obj"] let o_flags = ["-output-complete-obj"]
let so_flags = ["-output-complete-obj"; "-runtime-variant"; "_pic"] let so_flags_windows = o_flags
let so_flags_unix = ["-output-complete-obj"; "-runtime-variant"; "_pic"]
let of_user_config (ctx : Context.t) (m : Jbuild.Executables.Link_mode.t) = let of_user_config (ctx : Context.t) (m : Jbuild.Executables.Link_mode.t) =
let wanted_mode : Mode.t = let wanted_mode : Mode.t =
@ -80,6 +81,12 @@ module Linkage = struct
[] []
| Object -> o_flags | Object -> o_flags
| Shared_object -> | Shared_object ->
let so_flags =
if ctx.os_type = "Win32" then
so_flags_windows
else
so_flags_unix
in
if real_mode = Native then if real_mode = Native then
(* The compiler doesn't pass these flags in native mode. This (* The compiler doesn't pass these flags in native mode. This
looks like a bug in the compiler. *) looks like a bug in the compiler. *)