diff --git a/CHANGES.md b/CHANGES.md index aa563982..e98843bf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,8 @@ next everything in the universe. Jbuilder cannot cache the result of an action that depend on the universe (#603, fixes #255 @diml) +- Don't pass `-runtime-variant _pic` on Windows (#635) + 1.0+beta19 (14/03/2018) ----------------------- diff --git a/src/exe.ml b/src/exe.ml index d0a0988b..c58a8cd2 100644 --- a/src/exe.ml +++ b/src/exe.ml @@ -47,7 +47,8 @@ module Linkage = struct } 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 wanted_mode : Mode.t = @@ -80,6 +81,12 @@ module Linkage = struct [] | Object -> o_flags | Shared_object -> + let so_flags = + if ctx.os_type = "Win32" then + so_flags_windows + else + so_flags_unix + in if real_mode = Native then (* The compiler doesn't pass these flags in native mode. This looks like a bug in the compiler. *)