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