[PATCH] D145268: [lld-macho] Fix default LTO triple

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 13:29:58 PST 2023


keith added a comment.

In D145268#4168067 <https://reviews.llvm.org/D145268#4168067>, @int3 wrote:

> Huh, I'm surprised that setting `-object_path_lto` has a functional difference; I thought it was only to make debugging the intermediate object files easier. Did you figure out why?
>
> Also, did you figure out why LLD-ELF doesn't seem to need to set `DefaultTriple`?

so the difference with elf is it just avoids this work all together, here's a patch with that option https://reviews.llvm.org/D145273 and the original commit for that logic https://github.com/llvm/llvm-project/commit/f3994e4dfa0214b2a09a0e327ba37e6b38bbcdb3

with this patch the object_path_lto file ends up getting created and is empty, so technically the other patch would be less work, although I doubt it's meaningful perf wise



================
Comment at: lld/test/MachO/lto-object-path.ll:5
 ; RUN: rm -rf %t; mkdir %t
+; RUN: llc -filetype=obj %s -o %t/test-obj.o
 ; RUN: opt -thinlto-bc %s -o %t/test.o
----------------
int3 wrote:
> how does compiling with `llc` different from compiling with `opt`?
the difference is that we want an object file here and the opt calls are producing bitcode files


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145268



More information about the llvm-commits mailing list