[ELF] Refactor the way we handle -plugin-opt= (GCC collect2 or clang LTO related options)
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. Reviewed By: grimar, tejohnson Differential Revision: https://reviews.llvm.org/D78158
Loading
Please sign in to comment