File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ let remove_Wl cclibs =
168
168
(String. sub cclib 4 (String. length cclib - 4 ))
169
169
else cclib)
170
170
171
- let call_linker mode output_name files extra =
171
+ let call_linker ?( native_toplevel = false ) mode output_name files extra =
172
172
Profile. record_call " c-linker" (fun () ->
173
173
let cmd =
174
174
if mode = Partial then
@@ -194,7 +194,8 @@ let call_linker mode output_name files extra =
194
194
)
195
195
(Filename. quote output_name)
196
196
" " (* (Clflags.std_include_flag "-I")*)
197
- (quote_prefixed " -L" (Load_path. get_paths () ))
197
+ (if native_toplevel then " "
198
+ else quote_prefixed " -L" (Load_path. get_paths () ))
198
199
(String. concat " " (List. rev ! Clflags. all_ccopts))
199
200
(quote_files files)
200
201
extra
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ type link_mode =
35
35
| MainDll
36
36
| Partial
37
37
38
- val call_linker : link_mode -> string -> string list -> string -> int
38
+ (* If the ~native_toplevel flag is true, we don't pass any `-L` flags to gcc.
39
+ In some cases we observed so many flags being passed that gcc would crash,
40
+ but they should all be unnecessary as we're compiling with `-shared` in that
41
+ case. *)
42
+ (* CR-someday ccasinghino: the argument above equally applies to all cases when
43
+ `link_mode` is `Dll`, but that didn't seem to work. Understand why. *)
44
+ val call_linker :
45
+ ?native_toplevel : bool -> link_mode -> string -> string list -> string -> int
39
46
40
47
val linker_is_flexlink : bool
You can’t perform that action at this time.
0 commit comments