LLVM-TLI-CHECKER(1)
π¦ LLVM-TLI-CHECKER(1) β the TargetLibraryInfo vs library checker, bestie edition
okay so this is a page from the LLVM manual suite, and it's about a little tool that goes by llvm-tli-checker. she's a vibe checker, but for symbols. let's get into it π
β¨ NAME β¨
llvm-tli-checker β TargetLibraryInfo vs library checker. literally what it says on the tin, no cap.
πΈ SYNOPSIS πΈ
llvm-tli-checker [options] [library-fileβ¦]
that's it. that's the whole entry point. you give her some options, you give her some library files, she goes to work π«Ά
π DESCRIPTION π
so here's the tea, bestie π
llvm-tli-checker takes TargetLibraryInfo's opinion about whether library functions are available, and it compares that opinion against the actual set of functions exported by the library files you told it about. then it reports every single disagreement β like, every place where TLI thinks one thing and reality thinks another.
basically it's checking "does TLI say this function is there?" vs "is this function actually there?" and calling out the drama when those two don't match. π₯
who is this for? primarily vendors β people who need to make sure the TLI for their target is correct. because if it's not, the compiler will "optimize" some code sequence into a library call that isn't actually available, and that is not the moment you want to be having. π
π EXAMPLE π
here's her serving a real example, look at her go:
$ llvm-tli-checker --triple x86_64-scei-ps4 example.so
TLI knows 466 symbols, 235 available for 'x86_64-scei-ps4'
Looking for symbols in 'example.so'
Found 235 global function symbols in 'example.so'
Found a grand total of 235 library symbols
<< TLI yes SDK no: '_ZdaPv' aka operator delete[](void*)
>> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int)
<< Total TLI yes SDK no: 1
>> Total TLI no SDK yes: 1
== Total TLI yes SDK yes: 234
FAIL: LLVM TLI doesn't match SDK libraries.
see the << and >> arrows? that's her pointing at the mismatches. << is "TLI said yes, SDK said no" and >> is "TLI said no, SDK said yes". she's dramatic about it and honestly? deserved. π
β OPTIONS β
one bullet per flag, no skipping, we respect all of them equally:
--dump-tliβ prints "available"/"not available" for every single library function, based on what TargetLibraryInfo knows for the triple you specified, and then exits. and listen β this one does not read any input files at all. she just dumps the TLI and dips. π--help,-hβ prints a summary of the command line options and exits. your classic "wait what were the flags again" move π«Ά--libdir=<directory>β a base directory that gets prepended to each library file path. this is so handy when you've got a bunch of library files all chilling in the same directory, or when your list of input filenames is sitting in a response file. queen of convenience π--report=<level>β how much info she spills.<level>can besummary,discrepancy, orfull.summaryβ only gives you the count of matching and mis-matching symbolsdiscrepancyβ lists the mis-matching symbolsfullβ lists all symbols known to TLI, matching or mis-matching
the default is discrepancy. so by default she names names. π
--separateβ reads and reports a summary for each library file separately. lowkey useful when you're trying to identify library files that don't contribute anything TLI knows about. this implies--report=summary(and yes, you can override that). π--triple=<triple>β the triple to use for initializing TargetLibraryInfo. that's the whole job of this flag, she's very focused β¨@<FILE>β read command-line options and/or library names from the response file<FILE>. group-chat style: you don't type everything, you forward the whole thread π
π§ EXIT STATUS π§
okay this part is important, pay attention:
llvm-tli-checker returns 0 even if there are mismatches. yes really. she found the drama, she told you about it, she's still gonna exit clean. π
she returns a non-zero exit code if:
- there's an unrecognized option, or
- no input files are provided
so if you get a non-zero, it's not about the symbols β it's about you. (lovingly.) π«Ά
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). they're the ones keeping this whole thing alive, periodt. π
πΈ COPYRIGHT πΈ
2003-2024, LLVM Project
and that's the whole page bestie π she's LLVM manual page 15, dated 2024-04-14, from the LLVM suite itself β go check your target's TLI, iykyk π
β¨π¦
π¦ where this page comes from
- ubuntu noble: llvm-16 1:16.0.6-23ubuntu4 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms