Skip to content

Commit 40ea61b

Browse files
authored
[Clang][MinGW] Pass --functionpadmin to the linker when -fms-hotpatch is used (#116512)
1 parent 696c108 commit 40ea61b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/MinGW.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
188188
<< A->getSpelling() << GuardArgs;
189189
}
190190

191+
if (Args.hasArg(options::OPT_fms_hotpatch))
192+
CmdArgs.push_back("--functionpadmin");
193+
191194
CmdArgs.push_back("-o");
192195
const char *OutputFile = Output.getFilename();
193196
// GCC implicitly adds an .exe extension if it is given an output file name

clang/test/Driver/mingw.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@
8484
// RUN: %clang --target=arm64ec-windows-gnu -### -o /dev/null %s 2>&1 \
8585
// RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK
8686
// CHECK_MINGW_EC_LINK: "-m" "arm64ecpe"
87+
88+
// RUN: %clang --target=i686-windows-gnu -fms-hotpatch -### -- %s 2>&1 \
89+
// RUN: | FileCheck %s --check-prefix=FUNCTIONPADMIN
90+
// FUNCTIONPADMIN: "--functionpadmin"

0 commit comments

Comments
 (0)