[LLVMdev] malloc, magic, and embedded compilation

Andrew Lenharth andrewl at lenharth.org
Wed May 14 10:18:27 PDT 2008


On Wed, May 14, 2008 at 8:27 AM, Jonathan S. Shapiro <shap at eros-os.com> wrote:
> 1. The particular optimization that was done there was based on the
> compiler substituting an alternate implementation of malloc(). This may
> not be appropriate in kernel or deeply embedded systems. Is there a way
> for someone who is building that sort of system to enable/disable the
> builtin library magic selectively?

After compiling a few kernels with llvm (with LTO), I haven't seen one
yet that names any of it's allocators 'malloc', so in that case it's
kind of a moot point.

As for the matter of entry points, this isn't a problem either lots of
things in a kernel (if properly marked 'used') don't get internalized,
so you don't wind up with a bytecode that has a single entry point
named 'main'.  Oh, and main isn't a popular name for kernel entry
anyway.

Andrew



More information about the llvm-dev mailing list