Skip to content

build.sh missing musl static libraries (crt1.o, libc.a, libunwind.a) #414

@codegod100

Description

@codegod100

When building for musl targets on Linux, build.sh only copies libhost.a to the target directory. However, platform/main.roc declares that musl targets also require crt1.o, libc.a, and libunwind.a:

x64musl: ["crt1.o", "libhost.a", "libunwind.a", app, "libc.a"],
arm64musl: ["crt1.o", "libhost.a", "libunwind.a", app, "libc.a"],

This causes linker failures when trying to build Roc applications:

ld.lld: error: cannot open examples/../platform/targets/x64musl/crt1.o: No such file or directory
ld.lld: error: cannot open examples/../platform/targets/x64musl/libunwind.a: No such file or directory
ld.lld: error: cannot open examples/../platform/targets/x64musl/libc.a: No such file or directory

Fix:

The Rust toolchain already includes these files in its self-contained musl support directory at:

~/.rustup/toolchains/<toolchain>/lib/rustlib/<target>/lib/self-contained/

build.sh should copy these files for musl targets after building libhost.a.

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