GCC collect2 passes several options to the linker even if LTO is not used
(note, lld does not support GCC LTO). The lto-wrapper may be a relative
path (especially during development, when gcc is in a build directory), e.g.
-plugin-opt=relative/path/to/lto-wrapper
We need to ignore such options, which are currently interpreted by
cl::ParseCommandLineOptions() and will fail with error: --plugin-opt: ld.lld: Unknown command line argument 'relative/path/to/lto-wrapper'
because the path is apparently not an option registered by an llvm::cl::opt.
See lto-plugin-ignore.s for how we interpret various -plugin-opt= options now.
This looks better to me. I suppose the ignore checking could be an even tighter, e.g. it contains either liblto_plugin.so or lto-wrapper - does that seem reasonable? Probably don't even need to check for '/' in that case.