@@ -528,7 +528,8 @@ ToolChain::constructInvocation(const CompileJobAction &job,
528
528
if (context.Args .hasFlag (options::OPT_static_executable,
529
529
options::OPT_no_static_executable, false ) ||
530
530
context.Args .hasFlag (options::OPT_static_stdlib,
531
- options::OPT_no_static_stdlib, false )) {
531
+ options::OPT_no_static_stdlib, false ) ||
532
+ getTriple ().isOSBinFormatWasm ()) {
532
533
Arguments.push_back (" -use-static-resource-dir" );
533
534
}
534
535
@@ -1023,7 +1024,8 @@ ToolChain::constructInvocation(const MergeModuleJobAction &job,
1023
1024
if (context.Args .hasFlag (options::OPT_static_executable,
1024
1025
options::OPT_no_static_executable, false ) ||
1025
1026
context.Args .hasFlag (options::OPT_static_stdlib,
1026
- options::OPT_no_static_stdlib, false )) {
1027
+ options::OPT_no_static_stdlib, false ) ||
1028
+ getTriple ().isOSBinFormatWasm ()) {
1027
1029
Arguments.push_back (" -use-static-resource-dir" );
1028
1030
}
1029
1031
@@ -1191,6 +1193,14 @@ ToolChain::constructInvocation(const GeneratePCHJobAction &job,
1191
1193
addInputsOfType (Arguments, context.InputActions , file_types::TY_ObjCHeader);
1192
1194
context.Args .AddLastArg (Arguments, options::OPT_index_store_path);
1193
1195
1196
+ if (context.Args .hasFlag (options::OPT_static_executable,
1197
+ options::OPT_no_static_executable, false ) ||
1198
+ context.Args .hasFlag (options::OPT_static_stdlib, options::OPT_no_static_stdlib,
1199
+ false ) ||
1200
+ getTriple ().isOSBinFormatWasm ()) {
1201
+ Arguments.push_back (" -use-static-resource-dir" );
1202
+ }
1203
+
1194
1204
if (job.isPersistentPCH ()) {
1195
1205
Arguments.push_back (" -emit-pch" );
1196
1206
Arguments.push_back (" -pch-output-dir" );
0 commit comments