[PATCH] D138065: [ELF] Handle GCC collect2 -plugin-opt= on Windows
Brett Werling via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 14:36:58 PST 2022
bwerl created this revision.
bwerl added reviewers: grimar, tejohnson.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: MaskRay.
Herald added a project: All.
bwerl requested review of this revision.
Herald added subscribers: llvm-commits, StephenFan.
Herald added a project: LLVM.
Follows up on commit cd5d5ce235081005173566c99c592550021de058 <https://reviews.llvm.org/rGcd5d5ce235081005173566c99c592550021de058> by
additionally ignoring relative paths ending in "lto-wrapper.exe" as
can be the case for GCC cross-compiled for Windows.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138065
Files:
lld/ELF/Driver.cpp
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -1360,12 +1360,15 @@
parseClangOption(std::string("-") + arg->getValue(), arg->getSpelling());
// GCC collect2 passes -plugin-opt=path/to/lto-wrapper with an absolute or
- // relative path. Just ignore. If not ended with "lto-wrapper", consider it an
+ // relative path. Just ignore. If not ended with "lto-wrapper" (or
+ // "lto-wrapper.exe" for GCC cross-compiled for Windows), consider it an
// unsupported LLVMgold.so option and error.
- for (opt::Arg *arg : args.filtered(OPT_plugin_opt_eq))
- if (!StringRef(arg->getValue()).endswith("lto-wrapper"))
+ for (opt::Arg *arg : args.filtered(OPT_plugin_opt_eq)) {
+ StringRef v(arg->getValue());
+ if (!v.endswith("lto-wrapper") && !v.endswith("lto-wrapper.exe"))
error(arg->getSpelling() + ": unknown plugin option '" + arg->getValue() +
"'");
+ }
config->passPlugins = args::getStrings(args, OPT_load_pass_plugins);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138065.475582.patch
Type: text/x-patch
Size: 1067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221115/666a20d7/attachment.bin>
More information about the llvm-commits
mailing list