$OpenBSD: patch-src_bootstrap_builder_rs,v 1.21 2021/12/14 10:57:11 semarie Exp $
Pass -Wl,-z,origin to properly setup -Wl,-rpath,$ORIGIN/...

Index: src/bootstrap/builder.rs
--- src/bootstrap/builder.rs.orig
+++ src/bootstrap/builder.rs
@@ -1157,6 +1157,7 @@ impl<'a> Builder<'a> {
                 rustflags.arg("-Zosx-rpath-install-name");
                 Some("-Wl,-rpath,@loader_path/../lib")
             } else if !target.contains("windows") {
+                rustflags.arg("-Clink-args=-Wl,-z,origin");
                 Some("-Wl,-rpath,$ORIGIN/../lib")
             } else {
                 None
