[LLVMdev] How to bootstrap a bitcode file?
Joachim Durchholz
jo at durchholz.org
Fri Jun 3 13:18:56 PDT 2011
Hi all,
The question is:
Given a barebones nonroot shell account with no compiler and linker,
what would be needed to execute a given bitcode file?
I several possibilities here.
On one end, the distributor simply compiles the bitcode to any platform
supported and provides the binaries.
That means a 150% reliable cross-compiler setup for LLVM. Is that a
realistic option?
On the other end, the distributor offers, for each platform supported, a
simple LLVM backend in binary format, then use that to bootstrap a full
optimizing LLVM backend for the current platform, finally compile the
bitcode file to binary. (Keep the LLVM backend around so it can be
reused for the next bitcode file.)
The snag here might be LLVM's dependency on the platform linker; since
there is no root access, this requires supplying a locally-installable
version of the linker infrastructure for the platform.
I also hear there's a bitcode interpreter around, which would be yet
another option. Could either interpret the final bitcode file directly,
or be used as the first stage of the bootstrap process.
Recommendations which path would be the most robust against breakage as
platforms evolve?
Regards,
Jo
More information about the llvm-dev
mailing list