New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quadmath builds fail on Cygwin in ext/POSIX #15443
Comments
From @dcollinsnHello, Builds on Cygwin configured with: ./Configure -Dusedevel -des '-Doptimize=-O3 -g' -DDEBUGGING -Dusethreads -Dusequadmath Fail in the stage of compiling ext/POSIX. The first failing command is the following: g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector-strong -o ../../lib/auto/POSIX/POSIX.dll POSIX.o ../../cygperl5_25_3.dll -lm Which fails to link against the quadmath symbols. Appending -lquadmath to the command causes it to work. Notably, all the other compilation steps do have correct libraries set. For example, miniperl is successfully linked with: gcc -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong -L/usr/local/lib -o miniperl.exe opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o cygwin.o miniperlmain.o -lpthread -ldl -lquadmath Build log attached. After manually fixing that one command and running `make` again, I got the following perl -V: $ ./perl -Ilib -V Characteristics of this binary (from libperl): -- |
From @dcollinsn./Configure -Dusedevel -des '-Doptimize=-O3 -g' -DDEBUGGING -Dusethreads -Dusequadmath If you compile perl5 on a different machine or from a different object program finished with exit code 0 |
From @dcollinsn |
From @pjacklamI have attached a patch that fixes this. With the patch I am able to build Perl with quadmath support on Cygwin. Woohoo! |
From @pjacklamperl-5.27.6.patchdiff -c -r perl-5.27.6/ext/POSIX/Makefile.PL perl-5.27.6-patched/ext/POSIX/Makefile.PL
*** perl-5.27.6/ext/POSIX/Makefile.PL 2017-10-27 03:58:42.000000000 +0200
--- perl-5.27.6-patched/ext/POSIX/Makefile.PL 2017-12-15 11:27:45.658871300 +0100
***************
*** 20,25 ****
--- 20,28 ----
if ($^O eq 'aix' && $Config{uselongdouble}) {
push @libs, qw(c128);
}
+ if ($^O eq 'cygwin' && $Config{usequadmath}) {
+ push @libs, qw(quadmath);
+ }
WriteMakefile(
NAME => 'POSIX',
@libs ? ( 'LIBS' => [ join(" ", map { "-l$_" } @libs) ] ) : (),
|
The RT System itself - Status changed from 'new' to 'open' |
From @pjacklamWith the patch I included above, I was able to build Perl versions 5.24.3, 5.26.1, 5.27.3, 5.27.4, 5.27.5, 5.27.6, and 5.27.7 on both i686 (32-bit Cygwin) and x86_64 (64-bit Cygwin). All of them were built using GCC version 7.2.0. I also tried GCC versions 4.9.4, 5.5.0, and 6.4.0 – although not every combination of Perl and GCC – but those tried worked successfully. |
From @jkeenanOn Sun, 07 Jan 2018 12:45:07 GMT, pjacklam wrote:
Thanks for the patch. Applied to blead in commit 291c057. I'll close the ticket within 7 days unless there are complaints. -- |
From @LeontOn Fri, Dec 15, 2017 at 12:42 PM, (Peter J. Acklam) via RT
This rather feels like wallpaper covering a hole in the wall. Could you look up where the quadmath.dll is for your compiler, and if Leon |
From @pjacklamSun, 07 Jan 2018 05:51:12 -0800 skrev LeonT:
I don't know whether this is a Cygwin problem or a Perl problem, or First attempt at building PerlI installed Cygwin's gcc (version 6.4.0) and libquadmath packages. Then export PATH=/usr/bin:/bin but that failed with the following output (...) Choosing the C types to be used for Perl's internal types... *** You requested the use of the quadmath library, but you Here is where the "quadmath"-related stuff is located: $ find /usr | egrep -i quadmath Second attempt at building PerlI decided to build the same version of gcc (version 6.4.0) from source export PATH=/usr/site/gcc-6.4.0/bin:/usr/bin:/bin sh That succeeded: (...) If you compile perl5 on a different machine or from a different object Here is where the "quadmath"-related stuff is located: $ find /usr/site/gcc-6.4.0/ | egrep -i quadmath As you can see, the location of the quadmath-related files, relative to Anyway, Configure succeede, so then I ran make, but it fails with the If I include the patch I suggested above, I am finally able to build As for the the paths in libpth. For perl that is installed with Cygwin, $ perl -V:libpth for the perl I compiled myself (with quadmath support), I get $ /usr/site/perl-5.27.7/bin/perl -V:libpth |
From @LeontOn Mon, Jan 8, 2018 at 3:49 PM, (Peter J. Acklam) via RT
That's clearly not going to work
That should work iff you use exactly the same compiler, the one you Leon |
From @pjacklamSorry for creating any confusion by using two different compilers. It seems clear that the problem is that the "quadmath" library isn't loaded. The problem is not that the "quadmath" isn't found. It will be found, when requested. Alas, I don't know where in the build process I need to add that when Perl is built with the -Dusequadmath option, the "quadmath" library should be loaded. |
@pjacklam What's the status of this ticket? |
The patch fixed the problem in the sense that perl with quadmath enabled now builds just fine on Cygwin. The most recent version I have built is 5.31.6. @Leont pointed out that this might be like using wallpaper to fix a hole in the wall, but I don't know enough about libraries and linking to create a better fix. |
Migrated from rt.perl.org#128627 (status was 'open')
Searchable as RT128627$
The text was updated successfully, but these errors were encountered: