Discussion:
[rt.cpan.org #116056] Fixes for Cygwin build of PAR::Packer
(too old to reply)
Ken Brown via RT
2016-07-11 19:15:23 UTC
Permalink
Mon Jul 11 15:15:22 2016: Request 116056 was acted upon.
Transaction: Ticket created by ***@cornell.edu
Queue: PAR
Subject: Fixes for Cygwin build of PAR::Packer
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@cornell.edu
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >


There are two problems with the build of PAR::Packer 1.033 on Cygwin:

1. The build fails with "undefined reference to `__stack_chk_fail'".
This happens starting with version 1.030 due to the removal of the line

$boot_ldflags .= $static_ldflags;

from Makefile.PL. Adding that line back (see the attached
boot_ldflags.patch) fixes the problem.

2. The method for detecting a 64-bit system in Makefile.PL, based on
$Config{archname}, doesn't work on 64-bit Cygwin. Here we have the
following:

$ perl -e 'use Config; print $Config{archname}'
cygwin-thread-multi

$ perl -e 'use Config; print $Config{myuname}'
cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin

So PAR::Packer should use myuname on Cygwin instead of archname. See
the attached x86_64_cygwin.patch. (This comes from a patch used by
Yaakov Selkowitz, the Cygwin maintainer of PAR::Packer.)

Ken
Roderich Schupp via RT
2016-07-13 10:26:20 UTC
Permalink
Wed Jul 13 06:26:09 2016: Request 116056 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Fixes for Cygwin build of PAR::Packer
Broken in: 1.030
Severity: (no value)
Owner: Nobody
Requestors: ***@cornell.edu
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >
Thanks for reporting these problems. Next time, please do not lump
several problems into one bug, but submit diffrent bug reports for ach.
Post by Ken Brown via RT
1. The build fails with "undefined reference to `__stack_chk_fail'".
This happens starting with version 1.030 due to the removal of the line
$boot_ldflags .= $static_ldflags;
from Makefile.PL. Adding that line back (see the attached
boot_ldflags.patch) fixes the problem.
That's definitively the wrong fix, boot.exe is a standalone executable
that has no dependencies or perl stuff. I'll look into why this undefined
reference appears.
Post by Ken Brown via RT
2. The method for detecting a 64-bit system in Makefile.PL, based on
$Config{archname}, doesn't work on 64-bit Cygwin. Here we have the
...
So PAR::Packer should use myuname on Cygwin instead of archname. See
the attached x86_64_cygwin.patch.
A better solution is to use $Config{ptrsize} (4 or 8) to differentiate
between 32 bit and 64 bit systems.

Cheers, Roderich
Ken Brown via RT
2016-07-13 14:02:52 UTC
Permalink
Wed Jul 13 10:02:51 2016: Request 116056 was acted upon.
Transaction: Correspondence added by ***@cornell.edu
Queue: PAR-Packer
Subject: Re: [rt.cpan.org #116056] Fixes for Cygwin build of PAR::Packer
Broken in: 1.030
Severity: (no value)
Owner: Nobody
Requestors: ***@cornell.edu
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >
Post by Ken Brown via RT
<URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >
Thanks for reporting these problems. Next time, please do not lump
several problems into one bug, but submit diffrent bug reports for ach.
OK, sorry about that.
Post by Ken Brown via RT
Post by Ken Brown via RT
1. The build fails with "undefined reference to `__stack_chk_fail'".
This happens starting with version 1.030 due to the removal of the line
$boot_ldflags .= $static_ldflags;
from Makefile.PL. Adding that line back (see the attached
boot_ldflags.patch) fixes the problem.
That's definitively the wrong fix, boot.exe is a standalone executable
that has no dependencies or perl stuff.
How about something like this:

--- origsrc/PAR-Packer-1.033/myldr/Makefile.PL 2016-05-12 03:20:37.000000000 -0400
+++ src/PAR-Packer-1.033/myldr/Makefile.PL 2016-07-13 09:48:08.177541500 -0400
@@ -370,7 +370,7 @@ $parldyn_exe: $par_exe
boot$o: \$(MKTMP_STUFF) boot_embedded_files.c

$boot_exe: boot$o
- \$(LD) boot$o $boot_ldflags $res $out$boot_exe_link
+ \$(LD) boot$o \$(LDFLAGS) $boot_ldflags $res $out$boot_exe_link
$mt_cmd

boot_embedded_files.c: $par_exe
Post by Ken Brown via RT
Post by Ken Brown via RT
2. The method for detecting a 64-bit system in Makefile.PL, based on
$Config{archname}, doesn't work on 64-bit Cygwin. Here we have the
...
So PAR::Packer should use myuname on Cygwin instead of archname. See
the attached x86_64_cygwin.patch.
A better solution is to use $Config{ptrsize} (4 or 8) to differentiate
between 32 bit and 64 bit systems.
Agreed.

Ken
Roderich Schupp via RT
2016-07-16 16:38:07 UTC
Permalink
Sat Jul 16 12:37:55 2016: Request 116056 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Fixes for Cygwin build of PAR::Packer
Broken in: 1.030
Severity: (no value)
Owner: Nobody
Requestors: ***@cornell.edu
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >
Post by Ken Brown via RT
1. The build fails with "undefined reference to `__stack_chk_fail'".
This happens starting with version 1.030 due to the removal of the
line
$boot_ldflags .= $static_ldflags;
The reason is that boot.o is compiled with something like -fstack-protector-strong
(hence stack checks are compiled in), but boot.exe is linked without this flag
(which would have linked the library implementing these checks).
OK, so $static_ldflags is back, but this time the suppression of -l<perl lib> works.

I've committed both fixes at https://www.openfoundry.org/svn/par/PAR-Packer/trunk -
can you give it a try?

Cheers, Roderich
Ken Brown via RT
2016-07-16 17:09:51 UTC
Permalink
Sat Jul 16 13:09:45 2016: Request 116056 was acted upon.
Transaction: Correspondence added by ***@cornell.edu
Queue: PAR-Packer
Subject: Re: [rt.cpan.org #116056] Fixes for Cygwin build of PAR::Packer
Broken in: 1.030
Severity: (no value)
Owner: Nobody
Requestors: ***@cornell.edu
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >
Post by Roderich Schupp via RT
I've committed both fixes at https://www.openfoundry.org/svn/par/PAR-Packer/trunk -
can you give it a try?
Works for me.

Thanks.

Ken
Roderich Schupp via RT
2016-07-17 12:38:12 UTC
Permalink
Sun Jul 17 08:38:01 2016: Request 116056 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Fixes for Cygwin build of PAR::Packer
Broken in: 1.030
Severity: (no value)
Owner: Nobody
Requestors: ***@cornell.edu
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=116056 >
Post by Ken Brown via RT
Works for me.
Thanks for testing! Released as 1.034.

Cheers, Roderich

Loading...