~/talk

Rust Unlinked: Rustc, Symbols, and Static Libraries

Talkat Conf42 Rustlang 2024 · on Thursday, 2024-08-22· [compilers-and-language-design, rust]
slides:none on file

Shows that linking can consume roughly half of compile time and demonstrates a reproducible experiment: compile foo.rs and bar.rs to object files, inspect symbol tables with nm/readelf, inspect LLVM IR, and try manual ld linking until an undefined core symbol (core is an rlib, not an .o) blocks progress. Solution is to build staticlib + build.rs, package .o files with ar, and let rust-lld (or cargo) link the archives — the example then links and runs.

AI-written summary · about

  1. 0:00intro
  2. 0:26preamble
  3. 1:59understanding linking in rust
  4. 4:48compilation phases in rust
  5. 7:05lexing, parsing, and code analysis
  6. 9:56intermediate representations and optimizations
  7. 14:47llvm and code generation
  8. 18:00query-based compilation model
  9. 22:31introduction to object files
  10. 22:57introduction to object code
  11. 23:19experimenting with rust
  12. 23:37understanding the code example
  13. 24:01exploring symbol mangling
  14. 26:25compiling and linking object files
  15. 27:46using nm utility for symbol table
  16. 30:45examining elf file format
  17. 33:19manual linking with ld linker
  18. 34:12handling linking errors
  19. 35:55using static libraries in rust
  20. 39:47generating llvm ir
  21. 41:30conclusion and references
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.