Skip to content

Error Cross compiling for x86_64-pc-windows-gnu from Linux #40

@michaelvanstraten

Description

@michaelvanstraten

I have the following docker image for testing the compilation.

From rust:latest
RUN rustup target add x86_64-pc-windows-gnu
RUN apt-get update -y && apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 libnpth-mingw-w64-dev
RUN mkdir src
RUN git clone https://github.com/MagicalBitcoin/libtor-sys.git src

WORKDIR src
CMD cargo build -vv --features=vendored-openssl --target=x86_64-pc-windows-gnu

I am on the master branch of version 46.9.1+0.4.6.9 with commit ID 19bae62.

There seams to be a problem with libevent, it errors out when checking the dependency:

Error
checking for libevent directory... 
  --- stderr
  configure: WARNING: using cross tools not prefixed with host triplet
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event.c: In function 'dump_inserted_event_fn':
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event.c:3751:18: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long long int' [-Wformat=]
   3751 |  fprintf(output, "  %p [%s "EV_SOCK_FMT"]%s%s%s%s%s%s%s",
        |                  ^~~~~~~~~~~
  In file included from /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/minheap-internal.h:36,
                   from /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event-internal.h:40,
                   from /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event.c:62:
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/util-internal.h:461:25: note: format string is defined here
    461 | #define EV_I64_FMT "%I64d"
        |                     ~~~~^
        |                         |
        |                         int
        |                     %I64lld
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event.c: In function 'dump_active_event_fn':
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event.c:3785:18: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long long int' [-Wformat=]
   3785 |  fprintf(output, "  %p [%s "EV_SOCK_FMT", priority=%d]%s%s%s%s%s active%s%s\n",
        |                  ^~~~~~~~~~~
  In file included from /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/minheap-internal.h:36,
                   from /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event-internal.h:40,
                   from /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/event.c:62:
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/util-internal.h:461:25: note: format string is defined here
    461 | #define EV_I64_FMT "%I64d"
        |                     ~~~~^
        |                         |
        |                         int
        |                     %I64lld
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/evutil.c: In function 'evutil_check_ifaddrs':
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/evutil.c:714:13: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'ULONG (*)(ULONG,  ULONG,  void *, IP_ADAPTER_ADDRESSES_XP *, ULONG *)' {aka 'long unsigned int (*)(long unsigned int,  long unsigned int,  void *, IP_ADAPTER_ADDRESSES_XP *, long unsigned int *)'} [-Wcast-function-type]
    714 |  if (!(fn = (GetAdaptersAddresses_fn_t) GetProcAddress(lib, "GetAdaptersAddresses")))
        |             ^
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/evdns.c: In function 'load_nameservers_with_getnetworkparams':
  /src/target/x86_64-pc-windows-gnu/debug/build/libtor-sys-ae46822d76c19b23/out/libevent/libevent-src/evdns.c:3781:13: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(FIXED_INFO *, DWORD *)' {aka 'long unsigned int (*)(FIXED_INFO *, long unsigned int *)'} [-Wcast-function-type]
   3781 |  if (!(fn = (GetNetworkParams_fn_t) GetProcAddress(handle, "GetNetworkParams"))) {
        |             ^
  configure: WARNING: unrecognized options: --disable-shared, --enable-static, --disable-module-dircache
  configure: WARNING: using cross tools not prefixed with host triplet
  configure: WARNING: Could not find a linkable libevent.  If you have it installed somewhere unusual, you can specify an explicit path using --with-libevent-dir
  configure: WARNING: On Debian, you can install libevent using "apt-get install libevent-dev"
  configure: error: Missing libraries; unable to proceed.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

Here is a full log of the build:
log.txt

I would be very grade full if somebody could help me with this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions