From 3f22d9f82bd59bc1eb85df225ff8a3a76aa751a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Mon, 19 Mar 2018 19:13:02 -0400 Subject: [PATCH] Do not pass -runtime-variant _pic on Windows (#635) --- CHANGES.md | 2 ++ src/exe.ml | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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. *)