Skip to content

Support for musl #132

@joehoyle

Description

@joehoyle

I'm trying to build a PHP extension for Alpine Linux, which uses musl. My understanding is that I need to set my Cargo.toml to build a staticlib rather than cdylib in this case.

I'm running into issues with building ext-php-rs, I think the first issue is that bindgen is set to dynamically link libclang, which fails with "Dynamic loading not supported". It does appear from https://gitlab.alpinelinux.org/alpine/aports/-/issues/12226 that it's possible for bindgen to work with clang-static.

After cloning ext-php-rs and trying that, I am now getting an error:

  = note: /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: /root/.rustup/toolchains/stable-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-182d699ce6400069.rlib(cpu_model.o): undefined reference to symbol 'getauxval'
          /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: /lib/libc.musl-aarch64.so.1: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status

I'm a bit out of my depth with this though! If anyone else has tried or had experience with building for musl, and pointers would be much appreciated! Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions