[PATCH] D131618: [WIP][Do NOT review] LLD related changes for -ffat-lto-objects support
Paul Kirth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 22 13:59:57 PDT 2022
paulkirth added a comment.
I think the test strategy here needs to be:
- Format checking
-. llvm generates the correct object file sections when configured for fatlto
1. clang generates fatlto objects correctly (i.e. correctly sets up the codegen pipeline in llvm)
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:7120-7122
+ if (IsUsingLTO && LTOMode == LTOK_Full &&
+ Args.getLastArg(options::OPT_ffat_lto_objects))
+ CmdArgs.push_back("-ffat-lto-objects");
----------------
Do we always do this under `-flto=full`, now? Doesn't that just essentially disable full LTO, since you set it to 'thin' when compiling for fat objects?
================
Comment at: clang/test/CodeGen/embed-lto-fatlto.c:4-5
+//
+// CHECK: !{{[0-9]+}} = !{i32 1, !"ThinLTO", i32 0}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"EnableSplitLTOUnit", i32 1}
+
----------------
What property are you trying to check here? that the full LTO mode is replaced with thin?
================
Comment at: lld/test/ELF/fatlto/fatlto.test:28-30
+; RUN: obj2yaml %tfoo-fatLTO > %tfoo-fatLTO.yaml
+; RUN: obj2yaml %tfoo-LTO > %tfoo-LTO.yaml
+; RUN: diff %tfoo-fatLTO.yaml %tfoo-LTO.yaml
----------------
Can this test fail given how you generate the linker's inputs and what you're comparing?
So, does the diff fail if you don't pass the `-fat-lto-objects` flag on Line 13?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131618/new/
https://reviews.llvm.org/D131618
More information about the llvm-commits
mailing list