[PATCH] D76461: [llvm-ar] Use target triple to deduce archive kind for bitcode inputs

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 22:58:50 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-ar/Inputs/bsd.ll:1
+; ModuleID = 'lto_gnu_obj.bc'
+target triple = "x86_64-unknown-freebsd"
----------------
The ModuleID comment is not needed now.

I suggest that you use `RUN: echo -e '....' > %t.bsd.ll` to inline the trivial test. Also drop `dso_local`


================
Comment at: llvm/test/tools/llvm-ar/Inputs/bsd.ll:4
+
+; Function Attrs: noinline nounwind optnone uwtable
+define dso_local void @_Z3foov() {
----------------
Since you dropped the attribute group, you need to drop the comment as well.


================
Comment at: llvm/tools/llvm-ar/llvm-ar.cpp:905
+      else if (TargetTriple.isOSBinFormatELF()) {
+        return TargetTriple.isOSBSDLike() ? object::Archive::K_BSD
+                                          : object::Archive::K_GNU;
----------------
I will ask some BSD people whether this is correct.

(Honestly I don't like the logic much.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76461





More information about the llvm-commits mailing list