]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use -lresolv in LIBS with rust on OSX.
authorNick Mathewson <nickm@torproject.org>
Thu, 4 Jan 2018 19:02:24 +0000 (14:02 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 4 Jan 2018 19:02:24 +0000 (14:02 -0500)
This fixes issue #24652, and is a workaround for Rust issue
https://github.com/rust-lang/rust/issues/46797 .

Makefile.am
changes/bug24652 [new file with mode: 0644]
configure.ac

index ad2ceb66a9cd3397092c58fde087a79e29bc3660..a126986f3a2599e811c972541c0a9410c4e993a8 100644 (file)
@@ -26,7 +26,8 @@ TESTING_TOR_BINARY=$(top_builddir)/src/or/tor$(EXEEXT)
 endif
 
 if USE_RUST
-rust_ldadd=$(top_builddir)/src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@
+rust_ldadd=$(top_builddir)/src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@ \
+       @TOR_RUST_EXTRA_LIBS@
 else
 rust_ldadd=
 endif
diff --git a/changes/bug24652 b/changes/bug24652
new file mode 100644 (file)
index 0000000..6e35e25
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes (build, compatibility, rust, OSX):
+
+    - When building with Rust on OSX, link against libresolv, to
+      work around the issue at
+      https://github.com/rust-lang/rust/issues/46797. Fixes bug
+      24652; bugfix on 0.3.1.1-alpha.
index 1bd782eb805490d090dc7de1ef19c2242ec277a2..6bfbc2326821a16c1f4bab094530edf3a7bb0f1e 100644 (file)
@@ -436,6 +436,15 @@ if test "x$enable_rust" = "xyes"; then
     fi
   fi
 
+  dnl This is a workaround for #46797
+  dnl (a.k.a https://github.com/rust-lang/rust/issues/46797 ).  Once the
+  dnl upstream bug is fixed, we can remove this workaround.
+  case "$host_os" in
+      darwin*)
+        TOR_RUST_EXTRA_LIBS="-lresolv"
+       ;;
+  esac
+
   dnl For now both MSVC and MinGW rust libraries will output static libs with
   dnl the MSVC naming convention.
   if test "$bwin32" = "true"; then
@@ -460,6 +469,8 @@ if test "x$enable_rust" = "xyes"; then
   fi
 fi
 
+AC_SUBST(TOR_RUST_EXTRA_LIBS)
+
 AC_SEARCH_LIBS(socket, [socket network])
 AC_SEARCH_LIBS(gethostbyname, [nsl])
 AC_SEARCH_LIBS(dlopen, [dl])