Skip to content

Using x86_64-unknown-linux-musl as a target for a module #85

Closed
@chipsenkbeil

Description

@chipsenkbeil

This is just an open question and I think the answer is no. Is it possible in some way to build a Lua module with musl as the target? If you try to build a cdylib, you get the immediate notification that the musl target doesn't support that crate type.

You can use a staticlib crate type and it builds fine, but to my knowledge you cannot import *.a or *.lib (windows) using module require(...) in Lua. I've seen scattered mentioning of baking static libraries into programs that also embed lua like Lua EPICS module, but no mention for Lua 5.1+ or luajit about using them.

With my lack of knowledge in the space, I'm assuming it doesn't make sense to link to a static library. The only reason this popped up for me is that some musl-based systems like Alpine linux don't have the needed libraries like ld-linux-x86-64.so for Lua to be able to load the module when built with the gnu target. This isn't a dealbreaker for me, but is a limitation of my move to a Lua module for distant.nvim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions