Bug 256110 - security/vaultwarden: Fix build on aarch64
Summary: security/vaultwarden: Fix build on aarch64
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Some People
Assignee: Michael Reifenberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-23 22:04 UTC by wcarson.bugzilla
Modified: 2021-05-25 16:49 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mr)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wcarson.bugzilla 2021-05-23 22:04:44 UTC
security/vaultwarden fails to build on FreeBSD 13-STABLE/aarch64 even after incorporating the patch in bug #256081. It fails with:

   Compiling diesel_migrations v1.4.0
     Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=diesel_migrations CARGO_MANIFEST_DIR=/wrkdirs/usr/ports/security/vaultwarden/work/vault
warden-1.21.0/cargo-crates/diesel_migrations-1.4.0 CARGO_PKG_AUTHORS='Sean Griffin <sean@seantheprogrammer.com>' CARGO_PKG_DESCRIPTION='Migration
 management for diesel' CARGO_PKG_HOMEPAGE='http://diesel.rs' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=dies
el_migrations CARGO_PKG_REPOSITORY='' CARGO_PKG_VERSION=1.4.0 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=4 CARGO_PKG_VERSION_PATCH=0 CARGO
_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/wrkdirs/usr/ports/security/vaultwarden/work/target/release/deps:/usr/local/lib:/wrkdirs/usr/ports/security/
vaultwarden/work/target/release/build/libsqlite3-sys-c9b2cfb5173da1ed/out' /usr/local/bin/rustc --crate-name diesel_migrations /wrkdirs/usr/ports
/security/vaultwarden/work/vaultwarden-1.21.0/cargo-crates/diesel_migrations-1.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi
 --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="mysql"' --cfg 'featu
re="postgres"' --cfg 'feature="sqlite"' -C metadata=c2b0add844e25a1d -C extra-filename=-c2b0add844e25a1d --out-dir /wrkdirs/usr/ports/security/va
ultwarden/work/target/release/deps -L dependency=/wrkdirs/usr/ports/security/vaultwarden/work/target/release/deps --extern migrations_internals=/
wrkdirs/usr/ports/security/vaultwarden/work/target/release/deps/libmigrations_internals-46ce7d9cbb20659f.rmeta --extern migrations_macros=/wrkdir
s/usr/ports/security/vaultwarden/work/target/release/deps/libmigrations_macros-ef4263a290ba5a8f.so --cap-lints warn -C linker=cc -C link-arg=-Wl,
-rpath,/usr/local/lib -C link-arg=-L/usr/local/lib -C link-arg=-fstack-protector-strong -L native=/wrkdirs/usr/ports/security/vaultwarden/work/ta
rget/release/build/libsqlite3-sys-aee51e034fba9e28/out -L native=/usr/local/lib/mysql -L native=/usr/local/lib`
error: /wrkdirs/usr/ports/security/vaultwarden/work/target/release/deps/libmigrations_macros-ef4263a290ba5a8f.so: Undefined symbol "__subtf3"
  --> /wrkdirs/usr/ports/security/vaultwarden/work/vaultwarden-1.21.0/cargo-crates/diesel_migrations-1.4.0/src/lib.rs:82:1
   |
82 | extern crate migrations_macros;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


I was able to track the problem to this Issue, where it describes missing instructions on the ARM64 platform:

https://github.com/rust-lang/compiler-builtins/issues/201

The fix for me was adding the following to the Makefile:

RUSTFLAGS=      -C target-feature=+crt-static -C link-arg=-lgcc

As a side note, I also had to upgrade the openssl-sys-0.9.62 crate to openssl-sys-0.9.63 in order to support LibreSSL 3.3.3.
Comment 1 Mikael Urankar freebsd_committer 2021-05-25 16:49:04 UTC
We should fix this in our libgcc_s: https://reviews.freebsd.org/D28690