[PATCH] D102637: [lld][MinGW] Introduce aliases for -Bdynamic and -Bstatic

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 13:10:55 PDT 2021


zero9178 marked an inline comment as done.
zero9178 added a comment.

In D102637#2764385 <https://reviews.llvm.org/D102637#2764385>, @mstorsjo wrote:

> LGTM
>
> Interesting, I wasn't aware of the others, other than `-static`.
>
> Is this use of `-static` (which I'd presume is in the form of `-Wl,-static`) somewhere in the Qt source/build system itself (which would surprise me as I build Qt quite a lot, but I haven't tested building 6.x with cmake statically), or in a third party build script?

I only first encountered it when compiling Qt 6.1 as well (I haven't checked Qt 6.0, assuming it's there too). The command is actually of the form `-Xlinker -static`. I just quickly ran a grep of it over the output of `ninja -t commands` and as far as I can tell it's added for every executable built by Qt.
Their build passes it directly to the linker here: https://github.com/qt/qtbase/blob/a4618c020d3923eb6c8c55115c49d7c9f00b3034/cmake/QtTargetHelpers.cmake#L196



================
Comment at: lld/MinGW/Options.td:117
 def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias<undefined>;
+def alias_Bdynamic_dy: Flag<["-"],"dy">,Alias<Bdynamic>;
+def alias_Bdynamic_call_shared: Flag<["-"],"call_shared">,Alias<Bdynamic>;
----------------
mstorsjo wrote:
> Nit: I try to keep these alphabetical, especially as long as the existing ones are. And also, keep spaces after commas.
Ahh that makes sense. I shall commit with:
```

// Alias
+def alias_Bdynamic_call_shared: Flag<["-"], "call_shared">, Alias<Bdynamic>;
+def alias_Bdynamic_dy: Flag<["-"], "dy">, Alias<Bdynamic>;
+def alias_Bstatic_dn: Flag<["-"], "dn">, Alias<Bstatic>;
+def alias_Bstatic_non_shared: Flag<["-"], "non_shared">, Alias<Bstatic>;
+def alias_Bstatic_static: Flag<["-"], "static">, Alias<Bstatic>;
 def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
 def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>;
 def alias_strip_S: Flag<["-"], "S">, Alias<strip_debug>;
 def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias<undefined>;

```
then.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102637/new/

https://reviews.llvm.org/D102637



More information about the llvm-commits mailing list