Description
I'm having trouble building a project with nlopt with a musl target.
A minimum docker container demonstrating this:
FROM
ekidd/rust-musl-builder:nightly-2020-11-19 AS build
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN cargo install --target x86_64-unknown-linux-musl --path .
`
The error is long, but is clearly a linking issue. The following is an example of an error:
error: linking with cc
failed: exit code: 1
= note: /home/rust/src/target/x86_64-unknown-linux-musl/release/build/nlopt-ae6f811d6a4d96eb/out/lib/libnlopt.a(options.c.o): In function nlopt_set_errmsg': options.c:(.text.nlopt_set_errmsg+0xc0): undefined reference to
__stack_chk_fail'
/home/rust/src/target/x86_64-unknown-linux-musl/release/build/nlopt-ae6f811d6a4d96eb/out/lib/libnlopt.a(optimize.c.o): In function `nlopt_optimize':