[PATCH] D84412: [clang][Driver] Don't hardcode --as-needed/--no-as-needed on Illumos

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 4 08:56:21 PDT 2020


MaskRay added a comment.

#clang <https://reviews.llvm.org/tag/clang/> does not have many people. You might need to add people explicitly..



================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:633
 
+static const char *getAsNeededOption(const ToolChain &TC, bool ignore) {
+  // FIXME: Need to handle GNU ld on Solaris.
----------------
`ignore` seems strange. How about `start`?


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:634
+static const char *getAsNeededOption(const ToolChain &TC, bool ignore) {
+  // FIXME: Need to handle GNU ld on Solaris.
+  if (TC.getTriple().isOSSolaris())
----------------
Can you improve the comment to mention that this is to work around illumnos ld?


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:636
+  if (TC.getTriple().isOSSolaris())
+    return ignore ? "-zignore" : "-zrecord";
+  else
----------------
I'll assume that `-zignore` has semantics similar to --as-needed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84412



More information about the cfe-commits mailing list