This is a follow on to D119107. AIX ld now supports libLTO loaded
as a plugin
This change teaches the clang driver how to pass AIX ld the
libLTO path and the option to pass LTO significant driver options
through to the plugin. Some remarks plugin options are mapped
to their libLTO equivalents when using the AIX ld.
We need also to indicate to the toolchain that we now support
bitcode in the linker, or we run into asserts on some single-step
LTO invocations.
See also https://www.ibm.com/docs/en/aix/7.2?topic=l-ld-command for
the linker interface.
co-authored-by: Ettore Tiotto <etiotto@ca.ibm.com>
co-authored-by: Wai Hung Tsang <whitneyt@ca.ibm.com>
instead of having two functions: getLTOPluginType and getLTOPluginTypeImpl, why not just have one: getLTOPluginTypeImpl.
In the base class (ToolChain) implementation it returns LTOPT_LLVMldlld or LTOPT_LLVMgold, and then derived classes that cannot incorporate their logic into the base implementation wud override (so AIX will do that).
Right now the base class's implementation is split between getLTOPluginType and getLTOPluginTypeImpl, but is avoidable.