Skip Menu |

This queue is for tickets about the Future-AsyncAwait CPAN distribution.

Report information
The Basics
Id: 128163
Status: resolved
Priority: 0/
Queue: Future-AsyncAwait

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.16
Fixed in: 0.17



Subject: Fails to build on MSWin32: PerlProc_setjmp + PerlProc_longjmp
For example http://www.cpantesters.org/cpan/report/a62f768f-6e1e-1014-9f68-c98cc14c3d8c Generating script 'lib\Future\AsyncAwait.lds' dlltool --def "lib\Future\AsyncAwait.def" --output-exp "lib\Future\AsyncAwait.exp" g++ -o "blib\arch\auto\Future\AsyncAwait\AsyncAwait.xs.dll" -Wl,--base-file,"lib\Future\AsyncAwait.base" -Wl,--image-base,0x22320000 -mdll -s -L"C:\Strawberry\perl\lib\CORE" -L"C:\Strawberry\c\lib" "lib\Future\AsyncAwait.lds" "lib\Future\AsyncAwait.exp" lib\Future\AsyncAwait.o:AsyncAwait.c:(.text+0x2c64): undefined reference to `PerlProc_setjmp' lib\Future\AsyncAwait.o:AsyncAwait.c:(.text+0x2d5b): undefined reference to `PerlProc_longjmp' collect2.exe: error: ld returned 1 exit status -- Paul Evans
A point of note: Scope::Escape uses the JMPENV_* macros, and it runs fine on MSWin32. https://metacpan.org/source/ZEFRAM/Scope-Escape-0.005/lib/Scope/Escape.xs#L731 http://matrix.cpantesters.org/?dist=Scope-Escape+0.005 -- Paul Evans
Setting -DNO_XSLOCKS appears to fix this. I'll keep it MSWin32-only for now though. -- Paul Evans
Subject: rt128163.patch
=== modified file 'Build.PL' --- Build.PL 2018-01-24 03:59:37 +0000 +++ Build.PL 2019-01-04 18:43:17 +0000 @@ -3,6 +3,15 @@ use Module::Build; +my @extra_compiler_flags = qw( -std=c89 -Ihax ); + +# MSWin32 needs NO_XSLOCKS to make longjmp work. I have no idea what this is +# about, I just stole it from Scope::Escape +# https://metacpan.org/source/ZEFRAM/Scope-Escape-0.005/Build.PL#L25 +if( $^O eq "MSWin32" ) { + push @extra_compiler_flags, "-DNO_XSLOCKS=1"; +} + my $build = Module::Build->new( module_name => 'Future::AsyncAwait', requires => { @@ -24,7 +33,7 @@ }, }, - extra_compiler_flags => [qw( -std=c89 -Ihax )], + extra_compiler_flags => \@extra_compiler_flags, ); $build->create_build_script; === modified file 'lib/Future/AsyncAwait.pm' --- lib/Future/AsyncAwait.pm 2019-01-04 18:13:42 +0000 +++ lib/Future/AsyncAwait.pm 2019-01-04 18:43:17 +0000 @@ -350,13 +350,6 @@ =item * -Fails to build on MSWin32 due to missing symbols C<PerlProc_setjmp> and -C<PerlProc_longjmp>. - -L<https://rt.cpan.org/Ticket/Display.html?id=128163> - -=item * - Various failures on threaded perls version 5.20 and earlier. These don't seem to be happening on non-threaded builds of the same versions, nor at any version 5.22 or later.
Released in 0.17 -- Paul Evans