[lld][MinGW] Introduce aliases for -Bdynamic and -Bstatic

Authored by zero9178 on May 17 2021, 1:12 PM.


[lld][MinGW] Introduce aliases for -Bdynamic and -Bstatic

Besides -Bdynamic and -Bstatic, ld documents additional aliases for both of these options. Instead of -Bstatic, one may write -dn, -non_shared or -static. Instead of -Bdynamic one may write -dy or -call_shared. Source: https://sourceware.org/binutils/docs-2.36/ld/Options.html

This patch adds those aliases to the MinGW driver of lld for the sake of ld compatibility.

Encountered this case while compiling a static Qt 6.1 distribution and got build failures as -static was passed directly to the linker, instead of through the compiler driver.

Differential Revision: https://reviews.llvm.org/D102637