Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.97k stars 560 forks source link

cygwin: workaround DLL load address conflict #22696

Closed tonycoz closed 2 weeks ago

tonycoz commented 2 weeks ago

The DLL load addresses are generated by the linker based on the DLL names, and 5.39.10 we're getting a conflict between cygperl5_41_6.dll and Langinfo.dll.

As a workaround, statically link Langinfo into cygperl for CI and mention the problem in perldelta for anyone else who might build perl on cygwin

Fixes but should not close #22695

TODO: fill description here


sisyphus commented 2 weeks ago

For me, the failure occurs only with -DDEBUGGING builds. Should the proposed perldelta entry mention that non-debugging builds are not affected ?

bulk88 commented 2 weeks ago

https://github.com/Perl/perl5/blob/a6f05e6c69b1b871ac6c89a44d9f2aeb84979a1c/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm#L134

isnt a global rebase of libperl and all XS DLLs supposed to run in Cygwin?

tonycoz commented 2 weeks ago

For me, the failure occurs only with -DDEBUGGING builds. Should the proposed perldelta entry mention that non-debugging builds are not affected ?

It would be anything that makes the binaries larger, I reproduced it with ./Configure -des -Dusedevel -Doptimize=-O0\ -g and with ./Configure -des -Dusedevel -Doptimize=-O2\ -g\ -march=x86-64-v2

tonycoz commented 2 weeks ago

https://github.com/Perl/perl5/blob/a6f05e6c69b1b871ac6c89a44d9f2aeb84979a1c/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm#L134

isnt a global rebase of libperl and all XS DLLs supposed to run in Cygwin?

That isn't what that says, and isn't what it does.

cygperl_5_41_6.dll isn't an archdir dll, though perhaps that code should include cygperl*.dll too.

Also, it only runs for 32-bit builds, which cygwin no longer support, which I can understand, since DLL conflicts like this were many times more common there.

tonycoz commented 2 weeks ago

For me, the failure occurs only with -DDEBUGGING builds. Should the proposed perldelta entry mention that non-debugging builds are not affected ?

I've added a note on this.

jkeenan commented 2 weeks ago

For me, the failure occurs only with -DDEBUGGING builds. Should the proposed perldelta entry mention that non-debugging builds are not affected ?

I've added a note on this.

Can someone familiar with Cygwin review this p.r.? (I'd like to quiet our CI failures on that platform.) Thanks.

jkeenan commented 2 weeks ago

The DLL load addresses are generated by the linker based on the DLL names, and 5.39.10 we're getting a conflict between cygperl5_41_6.dll and Langinfo.dll.

As a workaround, statically link Langinfo into cygperl for CI and mention the problem in perldelta for anyone else who might build perl on cygwin

Fixes but should not close #22695

@tonycoz, this did close #22695; should you re-open it? (My impression is that our Cygwin CI builds are still failing.)

tonycoz commented 1 week ago

@tonycoz, this did close #22695; should you re-open it?

Thanks github, reopened.

(My impression is that our Cygwin CI builds are still failing.)

blead is passing, see the green tick at the top of https://github.com/Perl/perl5 and you can see green ticks for the CI runs done since this was merged at https://github.com/Perl/perl5/commits/blead/

Any PRs will need to be rebased on blead to pass.