LLVM: symbol not found for bytecode compilation

The field I was interested in to check my theory is in fact Extra dynamically-loaded libraries. The libraries mentioned in this field are 1) dynamically loaded when the byte code is run 2) At byte code link time, primitives found in the byte code are checked for existence in these libraries so that you don’t get obvious missing symbol surprises when you run the executable.

In any case I think the problem is pinned down.

There’s more than one fix but solving that in the META is not such a good idea. You can either:

  1. Add the library to the Extra dynamically-loaded libraries field of the library by specifying -dllib -lLLVM when creating llvm.cma
  2. Stop using naked pointers (this means you won’t refer to symbols from the llvm library directly and the problem goes away).

Even though it will be more work I highly suggest 2. Naked pointers are deprecated and on their way out because of multicore. See this thread for background information and this section of the manual on how to go about this.