Skip to content

Configure fails to find libquadmath on cygwin #17782

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

Closed
tonycoz opened this issue May 12, 2020 · 0 comments · Fixed by Perl/metaconfig#65
Closed

Configure fails to find libquadmath on cygwin #17782

tonycoz opened this issue May 12, 2020 · 0 comments · Fixed by Perl/metaconfig#65

Comments

@tonycoz
Copy link
Contributor

tonycoz commented May 12, 2020

Module:

Description

Configure fails to find libquadmath on cygwin:

$ ./Configure -des -Dusedevel -Dusequadmath
...
*** You requested the use of the quadmath library, but you
*** do not seem to have the quadmath library installed.
*** Cannot continue, aborting.

tony@phobos ~/dev/perl/git/perl
$ git describe
v5.31.11-21-g6319bad96e

tony@phobos ~/dev/perl/git/perl
$ uname -a
CYGWIN_NT-10.0 phobos 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin

But the compiler has no problem finding it:

$ cc -otestquad.exe testquad.c -lquadmath

$ ./testquad
2.000000

$ cat testquad.c
#include <quadmath.h>
#include <stdio.h>

int main() {
  __float128 q = ceilq(1.2);
  printf("%f\n", (double)q);
  return 0;
}

I considered applying a change to the hints file as is done in hints/linux.sh that asks gcc for -print-search-dirs, but to find quadmath this requires adding gcc's version specific directories and means that if a new gcc is installed we can end up linking an extension against different versions of libraries than the executable or libperl shared library.

But the main problem I see is we have a tool that can find libraries (the compiler/linker) and in general it's smarter about it than Configure is - since it will only accept libraries that will match the current build, while Configure only checks names.

Perl configuration
From a build without -Dusequadmath:

Summary of my perl5 (revision 5 version 31 subversion 12) configuration:
  Commit id: 6319bad96eba493c5f3bc7857e1c58687c461d70
  Platform:
    osname=cygwin
    osvers=3.1.4(0.34053)
    archname=cygwin-thread-multi
    uname='cygwin_nt-10.0 phobos 3.1.4(0.34053) 2020-02-19 08:49 x86_64 cygwin '
    config_args='-des -Dusedevel'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2'
    optimize='-O3'
    cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong'
    ccversion=''
    gccversion='9.3.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='g++'
    ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/lib /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../lib/../include/w32api /usr/local/lib /lib
    libs=-lpthread -ldl
    perllibs=-lpthread -ldl
    libc=/usr/lib/libc.a
    so=dll
    useshrplib=true
    libperl=cygperl5_31_12.dll
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' --shared  -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_DEVEL
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_THREAD_SAFE_LOCALE
  Built under cygwin
  Compiled at May 12 2020 14:34:44
  @INC:
    lib
    /usr/local/lib/perl5/site_perl/5.31.12/cygwin-thread-multi
    /usr/local/lib/perl5/site_perl/5.31.12
    /usr/local/lib/perl5/5.31.12/cygwin-thread-multi
    /usr/local/lib/perl5/5.31.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants