@@ -4697,7 +4697,7 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
4697
4697
Output.getFilename ());
4698
4698
}
4699
4699
4700
- static void ProcessVSRuntimeLibrary (const ArgList &Args,
4700
+ static void ProcessVSRuntimeLibrary (const ToolChain &TC, const ArgList &Args,
4701
4701
ArgStringList &CmdArgs) {
4702
4702
unsigned RTOptionID = options::OPT__SLASH_MT;
4703
4703
@@ -4760,6 +4760,12 @@ static void ProcessVSRuntimeLibrary(const ArgList &Args,
4760
4760
// implemented in clang.
4761
4761
CmdArgs.push_back (" --dependent-lib=oldnames" );
4762
4762
}
4763
+
4764
+ // All Arm64EC object files implicitly add softintrin.lib. This is necessary
4765
+ // even if the file doesn't actually refer to any of the routines because
4766
+ // the CRT itself has incomplete dependency markings.
4767
+ if (TC.getTriple ().isWindowsArm64EC ())
4768
+ CmdArgs.push_back (" --dependent-lib=softintrin" );
4763
4769
}
4764
4770
4765
4771
void Clang::ConstructJob (Compilation &C, const JobAction &JA,
@@ -7015,7 +7021,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
7015
7021
7016
7022
if (Triple.isWindowsMSVCEnvironment () && !D.IsCLMode () &&
7017
7023
Args.hasArg (options::OPT_fms_runtime_lib_EQ))
7018
- ProcessVSRuntimeLibrary (Args, CmdArgs);
7024
+ ProcessVSRuntimeLibrary (getToolChain (), Args, CmdArgs);
7019
7025
7020
7026
// Handle -fgcc-version, if present.
7021
7027
VersionTuple GNUCVer;
@@ -8134,7 +8140,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
8134
8140
ArgStringList &CmdArgs) const {
8135
8141
bool isNVPTX = getToolChain ().getTriple ().isNVPTX ();
8136
8142
8137
- ProcessVSRuntimeLibrary (Args, CmdArgs);
8143
+ ProcessVSRuntimeLibrary (getToolChain (), Args, CmdArgs);
8138
8144
8139
8145
if (Arg *ShowIncludes =
8140
8146
Args.getLastArg (options::OPT__SLASH_showIncludes,
0 commit comments