Wrong unconditional dependency on nanl

Christophe Lyon <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAKdteObUL17DuzY2qT8m85OWyCGVPHP5EmF9M0bbD=YqDEzC7g@mail.gmail.com>
Hello,

On aarch64 I've notice that a simple hello.c fails to link against
current newlib master:
.../aarch64-elf/libc/usr/lib/libc.a(lib_a-strtorx.o): In function `ULtox':
.../newlib/libc/stdlib/strtorx.c:92: undefined reference to `nanl'

It seems to me that an unconditional dependency on nanl() was
introduced by commit
6c212a8b7873703c4f98c6b68579b234918be83a
Author: Masamichi Hosoda <[email protected]>
Date:   Thu Aug 16 09:18:50 2018 +0900
    Fix strtod ("nan") and strtold ("nan") returns wrong negative NaN

but I'm not sure how to fix this as I did not follow the discussion
around this patch.

It seems to me that nanl() is only defined if _LDBL_EQ_DBL
(newlib/libm/common/nanl.c), but the patch above introduces a call to
nanl() in a code path where !defined (_LDBL_EQ_DBL)

This I suspect the problem is present on other targets, too ?

Christophe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.