Tor fails to build with mingw-w64 and rust 1.53.0
When trying to build tor for Windows with mingw-w64 and rust 1.53.0, I get this build error:
x86_64-w64-mingw32-ar: `u' modifier ignored since `D' is the default (see `U')
AR src/lib/libtor-trace.a
x86_64-w64-mingw32-ar: `u' modifier ignored since `D' is the default (see `U')
CCLD src/test/test-switch-id.exe
x86_64-w64-mingw32-gcc: error: ./src/rust/target/x86_64-pc-windows-gnu/release/tor_rust.lib: No such file or directory
make[1]: *** [Makefile:11280: src/test/test-switch-id.exe] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/build/tor-7440a38846d7'
make: *** [Makefile:7372: all] Error 2
Doing this change fixed the build:
diff --git a/configure.ac b/configure.ac
index 1b1d3a9892..e3037ad02a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -691,13 +691,7 @@ if test "x$enable_rust" = "xyes"; then
fi
fi
- dnl For now both MSVC and MinGW rust libraries will output static libs with
- dnl the MSVC naming convention.
- if test "$bwin32" = "true"; then
- tor_rust_static_name=tor_rust.lib
- else
- tor_rust_static_name=libtor_rust.a
- fi
+ tor_rust_static_name=libtor_rust.a
AC_CANONICAL_BUILD
I think it might be related to https://github.com/rust-lang/rust/commit/5ecc18f3ece1124a56ff76a74c3eb4153be5b3b8