Object Files: Understanding The Result Of LLVM Compilation
  1. Abstract
  2. Introduction
  3. File Contents
  4. Linkage Rules Of Thumb
    1. Always Link vmcore.o, support.a
    2. Placeholder

Written by Reid Spencer

Abstract

This document describes the contents of the many objects files and libraries that are produced by compiling LLVM. To make use of LLVM this information is needed in order to understand what files should be linked into your program.

Introduction

If you're writing a compiler, virtual machine, or any other utility for LLVM, you'll need to figure out which of the many .a (archive) and .o (object) files you will need to link with to be successful. An understanding of the contents of these files and their inter-relationships will be useful in coming up with an optimal specification for the objects and libraries to link with.

The purpose of this document is to hopefully reduce some of the trial and error that the author experienced in using LLVM.

File Contents

The table below provides a summary of the basic contents of each file.

Summary Of LLVM Library And Object Files

Library

Description

libipo.a An archive of all interprocedural optimizations.
libscalaropts.a An archive of all scalar optimizations.
libtransforms.a Uncategorized transformations.
libtarget.a An archive containing generic code generator support.
libanalysis.a An archive containing intraprocedural analyses.
libdatastructure.a An archive containing Data Structure Analysis.
libinstrument.a Intraprocedural instrumentation and utilities.
libsparcv9regalloc.a SparcV9 graph-coloring register allocator.
libipa.a An archive containing interprocedural analyses
libtransformutils.a Utility functions for transformations.
libsupport.a General support utilities

Object File

Description

support.o General support utilities
asmparser.o Assembler Parser
bcreader.o Bytecode Reader
bcwriter.o Bytecode Writer
sched.o SparcV9 instruction scheduler
selectiondag.o Aggressive instruction selector for Directed Acyclic Graphs
transformutils.o Utilities for code transformations
ipa.o Interprocedural Analyses
sparcv9select.o SparcV9 instruction selector
cwriter.o "C" Code Writer
profpaths.o Path profiling instrumentation
sparcv9regalloc.o SparcV9 graph-coloring register allocator
instrument.o Intraprocedural instrumentation and utilities.
datastructure.o Data Structure Analysis
codegen.o Native code generation
sparcv9livevar.o SparcV9 Live Variable Analysis
vmcore.o Virtual Machine Core
lli-interpreter.o Interpreter for LLVM ByteCode
lli-jit.o Just-In-Time Compiler For LLVM ByteCode
executionengine.o Engine for LLI
debugger.o Source Level Debugging Support
analysis.o General framework for Analysis
sparcv9.o SparcV9 backend
target.o Generic backend support
transforms.o Uncategorized transformations.
x86.o Intel x86 backend
powerpc.o PowerPC backend
scalaropts.o Optimizations For Scalars
ipo.o Interprocedural Optimizations
trace.o Support For Tracing/Debugging?
profile_rt.o Runtime Library For Profiler
sample.o Sample Program ?
stkr_compiler.o Stacker Language Compiler Library
stkr_runtime.o Stacker Language Runtime Library

Linkage Rules Of Thumb

This section contains various "rules of thumb" about what files you should link into your programs.

Always Link vmcore.o support.a

No matter what you do with LLVM, you'll always need to link with vmcore.o and support.a.

Placeholder

Need more rules of thumb here.