[PATCH] D69313: Handle more crt*.o filename variants.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 14:12:47 PDT 2019


ruiu added inline comments.


================
Comment at: lld/ELF/OutputSections.cpp:390-391
+//
+// Gcc uses any of crt[begin|end][<empty>|S|T].o.
+// Clang uses Gcc's plus clang_rt.crt[begin|end][<empty>|S|T][-<arch>|<empty>].o.
 static bool isCrtBeginEnd(StringRef s, StringRef filename) {
----------------
saugustine wrote:
> ruiu wrote:
> > At this point maybe we should consider start using regexps?
> Entirely up to you. My preference is not strong.
Let's try that to see how it looks. You can create a regex object by doing this

  std::regex re(R"(^crtbegin[ST].o|^clang_rtbegin[ST]-.*\.o)");

and use re.match to see if an argument matches the regex.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D69313





More information about the llvm-commits mailing list