Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

build/test on Windows 10 with MinGW #64

Open
@genio

Description

@genio

When building LibUV for Perl 5 (not Perl 6), we have to make use of cmake with MinGW and gmake.

Strawberry Perl (even Portables work here) makes both MinGW and gmake available to you out of the box and throws them both into your $env:PATH. You can then run cpanm Alien::cmake3 to get the latest cmake. perl -MAlien::cmake3 -E "say Alien::cmake3->bin_dir" will give you the path to the newly installed cmake bin directory. Add that to your path via: $env:PATH+="C:\Strawberry\ll_5.26.1.1_normal\lib\perl5\MSWin32-x64-multi-thread\auto\share\dist\Alien-cmake3\bin\".

Now, you have cmake, MinGW, and gmake binaries available in your path. Here's the build attempt I'm trying:

Unzip libuv-v1.23.1.tar.gz to C:\temp\libuv-v1.23.1

PS C:\temp\out> md -Force C:\temp\out\1.23.1\

Now we have a directory in which we can store our build.

PS C:\temp\out> cmake -G "MinGW Makefiles" -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -DCMAKE_INSTALL_PREFIX:PATH=C:/temp/out/1.23.1/ -DCMAKE_MAKE_PROGRAM:PATH=gmake -DBUILD_TESTING=ON C:/temp/libuv-v1.23.1

Now, compile the project:

PS C:\temp\out> gmake all test

This will compile fine, but fail when it tries to run the test suite:

[100%] Linking C executable uv_run_tests.exe
CMakeFiles
\uv_run_tests.dir/objects.a(test-spawn.c.obj):test-spawn.c:(.text+0x43b0): undefined reference to `quote_cmd_arg'
CMakeFiles\uv_run_tests.dir/objects.a(test-spawn.c.obj
):test-spawn.c
:(.text+0x461e
): undefined reference
 to `make_program_args
'
CMakeFiles
\uv_run_tests.dir/objects.a
(test-spawn.c.obj):test
-spawn.c:(.text
+0x4676): undefined
 reference to
 `make_program_args
'
CMakeFiles\uv_run_tests.dir
/objects.a(test-spawn.c.obj
):test-spawn.c:(.text+0x4b60): undefined reference to `make_program_env
'
collect2.exe: error: ld returned 1 exit status

gmake[2]: *** [CMakeFiles\uv_run_tests.dir\build.make:2391: uv_run_tests.exe] Error 1

gmake[1]: *** [CMakeFiles\Makefile2:301: CMakeFiles/uv_run_tests.dir/all] Error 2

gmake: *** [Makefile:94: all] Error 2

Here's the entire output log

Is there something especially stupid that I'm doing wrong?

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