Skip to content

Cross-compiling Julia itself #30338

Open
Open
@staticfloat

Description

It would be very useful for the build team if Julia itself could be cross-compiled. Among other things, this would enable building Julia under BinaryBuilder, a long-standing desire of myself and anyone else that has to maintain Julia-building infrastructure.

The fundamental limitation is, of course, Julia's bootstrap process. We can cross-compile the C parts just fine, but the bootstrap of Base and stdlib are not cross-compilable yet. On the other hand, as far as I can tell, bootstrap doesn't actually do that much introspection of the system it's running on, so it seems reasonable to me that we could pass some kind of -C x86_64-apple-darwin14 and generate a sys.ji/sys.o for that particular target.

We need to:

  • Tell LLVM to codegen for the appropriate architecture/OS calling conventions, etc....
  • Tell Julia/LLVM to output code in the appropriate format (e.g. .dylib/.dll/.so)
  • Force the bootstrap process to build build_h.jl appropriately so that it thinks it is in fact on Windows, etc... (This might be already done through BB's mocking of uname, I haven't checked)

Metadata

Assignees

No one assigned

    Labels

    buildingBuild system, or building Julia or its dependencies

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions