LLVM-LINK(1)
π LLVM-LINK β the LLVM bitcode linker, bestie edition
okay so real talk: llvm-link is the LLVM bitcode linker, and it's lowkey the glue of the whole operation. It's literally part of the LLVM fam (you'll see the LLVM manual name on the tin), and I'm about to explain it so well you'll be the main character of your compiler course. π
β¨ SYNOPSIS β¨
llvm-link [options] filename ...
πΈ DESCRIPTION πΈ
So here's the vibe: llvm-link takes several LLVM bitcode files and links them together into a single LLVM bitcode file. That's it, that's the whole serve. β¨
The output goes to standard output by default β unless you use the -o option to specify a filename, which you probably should, because otherwise your terminal is gonna get a whole lot of raw bytes dumped on it. π
π OPTIONS π
-fβ enables binary output on terminals. Normallyllvm-linkwill flat-out refuse to write raw bitcode output if the output stream is a terminal (respectful king tbh). With this option,llvm-linkwill write raw bitcode regardless of the output device. So like, it stops asking and just does it. π«Ά-ofilename β specify the output file name. And if filename is-, thenllvm-linkwill write its output to standard output. (yes bestie,-means stdout, classic icon behavior)-Sβ write output in LLVM intermediate language instead of bitcode. Human-readable era! π-dβ if specified,llvm-linkprints a human-readable version of the output bitcode file to standard error. note: standard error, not stdout β so you can peek without ruining your output. π¦--helpβ print a summary of command line options. the "wait what were the flags again" button, we've all been there. π-vβ verbose mode. prints info about whatllvm-linkis doing. This typically includes a message for each bitcode file linked in and for each library found. it's giving "narrator voice" and honestly? obsessed. π₯--overridefilename β adds the passed-in file to the link and overrides symbols that have already been declared with the definitions in the file that is passed in. This flag can be specified multiple times to have multiple files act as overrides. And if a symbol is declared more than twice, the definition from the file declared last takes precedence. (last one wins, no cap β so order matters, bestie, do not forget) β--importfunction:filename β specify a function that should be imported from the specified file for linking with ThinLTO. This option can be specified multiple times to import multiple functions. π§--summary-indexfilename β specify the path to a file containing the module summary index with the results of an earlier ThinLTO link. β οΈ This option is required when--importis used. like, not a suggestion. required required.--internalizeβ maintains existing linkage for symbols defined in the first input and converts linkage in all other inputs to internal linkage unless they are referenced byllvm*.usedor are special-cased runtime functions (e.g. stack protector runtime). first file stays famous, everyone else goes private. π--disable-debug-info-type-mapβ disables the use of a uniquing type map for debug info. π--only-neededβ link only needed symbols. minimalist queen behavior.--disable-lazy-loadingβ disable lazy module loading. no more "i'll get to it later".--suppress-warningsβ suppress all linker warnings. living in denial (affectionate). π--preserve-bc-uselistorderβ preserve the use-list order when writing LLVM bitcode. π--preserve-ll-uselistorderβ preserve the use-list order when writing LLVM assembly. (yes,llfor assembly,bcfor bitcode β that's the iykyk) π--ignore-non-bitcodeβ do not error out when a non-bitcode file is encountered while processing an archive. it sees a fake and simply chooses peace. π
π¦ EXIT STATUS π¦
If llvm-link succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value. simple as that, bestie. π
π Author π
Maintained by the LLVM Team (https://llvm.org/). shoutout the maintainers, they're carrying. π«Ά
π Copyright π
2003-2026, LLVM Project
k that's the whole page!! π mwah. this cutie is from the LLVM manual set, version 23, dated 2026-10-20 β go forth and link responsibly, bestie. β¨π
π¦ where this page comes from
- arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms