[GH-ISSUE #2514] vaultwarden compiled on Alpine Linux segfaults without "RUSTFLAGS=-C target-feature=-crt-static" #28780

Closed
opened 2026-06-17 08:25:03 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @DerVerruckteFuchs on GitHub (May 29, 2022).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2514

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). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2514 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.

<!-- gh-comment-id:1140427439 --> @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: github-starred/vaultwarden#28780