[PATCH] D139199: [lld/mac] Fix --start-lib/--end-lib with split thinlto inputs

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 07:49:51 PST 2022


thakis marked 2 inline comments as done.
thakis added a comment.

Thanks!



================
Comment at: lld/test/MachO/thinlto-split-unit-start-lib.ll:9
+;; _ZTI1S below) is present once as undefined and once as defined, it gets
+;; added. When something then references a different symbol in the bitcode
+;; file, causing it to be loaded, would go through all the symbols in the
----------------
MaskRay wrote:
> I find the sentences since "When something then ..." are somewhat difficult to understand...
Reworded it using your suggestion, thanks!


================
Comment at: lld/test/MachO/thinlto-split-unit-start-lib.ll:23
+
+; RUN: %lld -lc++ --start-lib %t/vtable.o --end-lib %t/vtable_use.o -o /dev/null
+
----------------
MaskRay wrote:
> `-lc++` isn't necessary. I suggest a relocatable file with
> 
> ```
> .section __DATA,__data
> .globl __ZTVN10__cxxabiv117__class_type_infoE
> __ZTVN10__cxxabiv117__class_type_infoE:
> ```
`-lc++` just links to a tbd file that contains what you suggested (and 5 other symbols), it doesn't link against a real libc++.


================
Comment at: lld/test/MachO/thinlto-split-unit-start-lib.ll:80
+
+attributes #0 = { mustprogress nofree norecurse nosync nounwind ssp willreturn memory(argmem: write) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" }
+attributes #1 = { mustprogress nofree norecurse nosync nounwind ssp willreturn memory(none) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "tune-cpu"="generic" }
----------------
MaskRay wrote:
> These `#*` and `!*` can all be removed to denoise the test file.
Done. (I kind of like using the output of clang unedited, but since I had to edit anyways to add the type metadata to the typeinfo, might as well.)


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

https://reviews.llvm.org/D139199



More information about the llvm-commits mailing list