vaultwarden compiled on Alpine Linux segfaults without "RUSTFLAGS=-C target-feature=-crt-static" #1286

Closed
opened 2026-02-05 00:31:27 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @DerVerruckteFuchs on GitHub (May 29, 2022).

I've attempted to build vaultwarden on Alpine Linux 3.15 and 3.16, and the resulting binary segfaults when trying to run it. It seems to be a build environment issue with OpenSSL. The build environment fix (using RUSTFLAGS=-C target-feature=-crt-static) from the link worked for me. I used env RUSTFLAGS=-C target-feature=-crt-static cargo build..., and I have a build that runs successfully. It would probably be a good idea to set this somewhere for Alpine Linux builds.

Originally created by @DerVerruckteFuchs on GitHub (May 29, 2022). I've attempted to build vaultwarden on Alpine Linux 3.15 and 3.16, and the resulting binary segfaults when trying to run it. It seems to be a [build environment issue with OpenSSL](https://users.rust-lang.org/t/sigsegv-with-program-linked-against-openssl-in-an-alpine-container/52172). The build environment fix (using `RUSTFLAGS=-C target-feature=-crt-static`) from the link worked for me. I used `env RUSTFLAGS=-C target-feature=-crt-static cargo build...`, and I have a build that runs successfully. It would probably be a good idea to set this somewhere for Alpine Linux builds.
Author
Owner

@BlackDex commented on GitHub (May 29, 2022):

We do not use alpine as a build environment, so no need to add this. Maybe adding it to the wiki is an option.

@BlackDex commented on GitHub (May 29, 2022): We do not use alpine as a build environment, so no need to add this. Maybe adding it to the wiki is an option.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1286