@@ -4733,7 +4733,7 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
4733
4733
Output.getFilename ());
4734
4734
}
4735
4735
4736
- static void ProcessVSRuntimeLibrary (const ArgList &Args,
4736
+ static void ProcessVSRuntimeLibrary (const ToolChain &TC, const ArgList &Args,
4737
4737
ArgStringList &CmdArgs) {
4738
4738
unsigned RTOptionID = options::OPT__SLASH_MT;
4739
4739
@@ -4796,6 +4796,12 @@ static void ProcessVSRuntimeLibrary(const ArgList &Args,
4796
4796
// implemented in clang.
4797
4797
CmdArgs.push_back (" --dependent-lib=oldnames" );
4798
4798
}
4799
+
4800
+ // All Arm64EC object files implicitly add softintrin.lib. This is necessary
4801
+ // even if the file doesn't actually refer to any of the routines because
4802
+ // the CRT itself has incomplete dependency markings.
4803
+ if (TC.getTriple ().isWindowsArm64EC ())
4804
+ CmdArgs.push_back (" --dependent-lib=softintrin" );
4799
4805
}
4800
4806
4801
4807
void Clang::ConstructJob (Compilation &C, const JobAction &JA,
@@ -7051,7 +7057,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
7051
7057
7052
7058
if (Triple.isWindowsMSVCEnvironment () && !D.IsCLMode () &&
7053
7059
Args.hasArg (options::OPT_fms_runtime_lib_EQ))
7054
- ProcessVSRuntimeLibrary (Args, CmdArgs);
7060
+ ProcessVSRuntimeLibrary (getToolChain (), Args, CmdArgs);
7055
7061
7056
7062
// Handle -fgcc-version, if present.
7057
7063
VersionTuple GNUCVer;
@@ -8178,7 +8184,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
8178
8184
ArgStringList &CmdArgs) const {
8179
8185
bool isNVPTX = getToolChain ().getTriple ().isNVPTX ();
8180
8186
8181
- ProcessVSRuntimeLibrary (Args, CmdArgs);
8187
+ ProcessVSRuntimeLibrary (getToolChain (), Args, CmdArgs);
8182
8188
8183
8189
if (Arg *ShowIncludes =
8184
8190
Args.getLastArg (options::OPT__SLASH_showIncludes,
0 commit comments