I wanted to use hyper, with rustc beta 1.1, on windows 7, with MinGW
installed, but don't get around a compile error in time v0.1.26:
C:\cygwin64\home\emabee.cargo\registry\src\github.com-1ecc6299db9ec823\time-0.1.26\src/time_helpers.c:1:0:
sorry, unimplemented: 64-bit mode not compiled in thread ''
panicked at 'explicit panic',C:\cygwin64\home\emabee.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.6\src\lib.rs:459.
I had the same problems when setting up Windows tests for Rustful. I think you have to make sure everything adds up. rustc, MinGW, gcc and everything else should be 64bit for it to work, if I understand it correctly. The alternative, which I ended up doing, is to switch things to 32bit instead, but I chose that path because Appveyor already had 32bit MinGW installed in their systems and I didn't want to fuzz around any more.
$ gcc --version --verbose
Using built-in specs.
COLLECT_GCC=c:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
gcc.exe (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++,ada --dis
able-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gmp-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= --with-sy
stem-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='--version' '-v' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1.exe -quiet -v -iprefix c:\mingw\bin../lib/gcc/mingw32/4.8.1/ help-dummy -quiet -dumpbase help-dummy -mtune=generic -march=pentiumpro -auxbase help-dummy -version --version -o C:\Users\d020383\AppData\Lo
cal\Temp\ccuIqzAe.s
GNU C (GCC) version 4.8.1 (mingw32)
compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='--version' '-v' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v --version -o C:\Users\d020383\AppData\Local\Temp\ccv64MCm.o C:\Users\d020383\AppData\Local\Temp\ccuIqzAe.s
GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
GNU assembler (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `mingw32'.
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../
COLLECT_GCC_OPTIONS='--version' '-v' '-mtune=generic' '-march=pentiumpro'
c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/collect2.exe -Bdynamic --version c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crtbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1 -Lc:/mingw/bin/../lib/gcc -Lc:/
mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../.. C:\Users\d020383\AppData\Local\Temp\ccv64MCm.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
-lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crtend.o
collect2 version 4.8.1
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe -Bdynamic --version c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crtbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1 -Lc:/mingw/bin/../
lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../.. C:\Users\d020383\AppData\Local\Temp\ccv64MCm.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser
32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crtend.o
GNU ld (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
The rust-openssl readme mentions placing the files in "locations that Cargo can find". http://www.mingw.org/wiki/HOWTO_Specify_the_Location_of_Libraries_for_use_with_MinGW helped me figure that out. In short, if you look at the gcc call above, the paths following the "-L" arguments are some of the paths that work. Your build would have failed earlier if it couldn't successfully find the openssl includes, so it is finding some version of the header files but is failing to find the dlls.
Rust prefers bundled gcc and its' libs to any other gcc installation on the PATH.
You can either:
Remove the "Linker and platform libraries" component of your Rust installation. Rustc will then invoke the external gcc.
Add location of libssl to the library search path. I think the easiest way to do that at this time is to set the gcc LIBRARY_PATH environment variable.
Tried and failed with both options you mentioned, all you really need is supply gcc with path in which openssl libs could be found. Following guide mentioned by @ogeon will help. Either by copying files or setting proper environment variables that used by build script. There is nothing specific to gcc here.
I submitted PR to rust-openssl, which should help build openssl-sys dependency (for hyper in this case) with mingw (after merge and openssl-sys crate update) without need to install openssl separately and setting environment variables.
I applied the change from the PR to my version of the build.rs (since I'm using msys64, it is at C:\msys64\home\emabee.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-sys-0.6.2), called in my normal project cargo clean and cargo build, and that was it.
time is now pure Rust code, so you should no longer need a MinGW setup for that. In addition OpenSSL support in hyper is now optional and there will soon be a pure Rust alternative using the Windows Schannel API for SSL support.