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 inter-procedural optimizations.
libscalaropts.a An archive of all scalar optimizations.
libtransforms.a An archive of just the level raise pass.
libtarget.a An archive containing code generator support for describing target architectures.
libanalysis.a An archive containing intra-procedural analyses.
libdatastructure.a An archive containing optimizations for data structures.
libinstrument.a No idea.
libregalloc.a Register Allocation code.
libipa.a An archive containing inter-procedural analyses
libtransformutils.a Utiltities for transformations?
libsupport.a General support utilities
libevar.a Live variable analysis for SPARC

Object File

Description

support.o General support utilities
asmparser.o Assembler Parser
bcreader.o Byte Code Reader
bcwriter.o Byte Code Writer
sched.o SPARC instruction scheduler
selectiondag.o Aggressive instruction selector for Directed Acyclic Graphs
transformutils.o Utilities for code transformations
ipa.o Inter-Procedural Analysis Optimizations
select.o SPARC instruction selector
cwriter.o "C" Code Writer
profpaths.o Path profiling instrumentation
regalloc.o Register Allocation
instrument.o Instrumentation? Of What?
datastructure.o Data Structure Analysis
codegen.o Native code generation
livevar.o 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?
sparc.o Sun SPARC Processor Specific
target.o Target Machine Support?
transforms.o Code Transformations
x86.o Intel x86 Processor Specific
powerpc.o PowerPC Processor Specific
scalaropts.o Optimizations For Scalars
ipo.o Inter-Procedural Optimization
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.