crossconfig.m4 is pretty incomplete. The example I found was for GNU/Linux targeted crosses, but I suspect many of the others have the same problem; likewise, by inspection, I think that this problem is in 3.4 also (it worked in 3.3, and I haven't tested 3.4 yet). The problem is that the *-linux* case doesn't define all the C99 math functions. This means that sqrtf is provided in libmath/stubs.o as (float) sqrt (val). sqrt is a call to __builtin_sqrt, which GCC expands to sqrtf, generating an infinite loop.
Confirmed.
Subject: Re: New: Math functions misdetected by cross configuration > crossconfig.m4 is pretty incomplete. The example I found was for GNU/Linux > targeted crosses, but I suspect many of the others have the same problem; > likewise, by inspection, I think that this problem is in 3.4 also (it worked > in 3.3, and I haven't tested 3.4 yet). [...] I think you are right. We expect target maintainers (for those targets which are usually crossed) to update the entries as they (re-)attempt ports. Sorry, but this is the protocol at the moment. Offhand, I don't recall why autoconf doesn't work here... Regards, Loren
Subject: Re: Math functions misdetected by cross configuration Well, we can't use autoconf normally, because we can't necessarily run link tests. On the other hands: - sometimes we can run link tests - sometimes we could use compile tests instead; there's a macro to check for presence of a prototype. I may experiment with these...
You have to have both link and compile visibility. Compile-time bits are often obscured by defines on the compile line, FYI. Here's a patch that fixes the linux crosses WRT C99 math. Give it a whirl, if you can, and I'll put it on gcc-3.4.0 if it works for you. -benjamin
Subject: Bug 15046 CVSROOT: /cvs/gcc Module name: gcc Changes by: bkoz@gcc.gnu.org 2004-05-13 17:49:54 Modified files: libstdc++-v3 : ChangeLog configure crossconfig.m4 Log message: 2004-05-13 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/15046 * crossconfig.m4: Add C99 math bits for linux crosses. * configure: Regenerate. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2473&r2=1.2474 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&r1=1.386&r2=1.387 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/crossconfig.m4.diff?cvsroot=gcc&r1=1.13&r2=1.14
Subject: Bug 15046 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: bkoz@gcc.gnu.org 2004-05-15 21:25:46 Modified files: libstdc++-v3 : ChangeLog configure crossconfig.m4 Log message: 2004-05-15 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/15046 * crossconfig.m4: Add C99 math bits for linux crosses. * configure: Regenerate. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.103&r2=1.2224.2.104 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.373.4.8&r2=1.373.4.9 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/crossconfig.m4.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.11.4.2&r2=1.11.4.3
Fixed for 3.4.1.
Subject: Re: Math functions misdetected by cross configuration Thanks. I tested the patch on arm-linux (better late than never), and now libstdc++-v3 contains the right set of stubs and no stubs which recursively call themselves.
This patch actually breaks uclinux, since it doesn't provide a number of the functions defined here. Also, the problem of stub functions recursively calling themselves is not addressed at all. I suppose we may need some additional libstdc++ hackery to fix that.
Postponed until GCC 3.4.3.
Postponed until GCC 3.4.4.
(In reply to comment #9) > This patch actually breaks uclinux, since it doesn't provide a number of the > functions defined here. Also, the problem of stub functions recursively calling > themselves is not addressed at all. I suppose we may need some additional > libstdc++ hackery to fix that. But that is a bug in the configure which makes uclinux thinks it is a glibc, really there should be a different triplit for those targets.
The orginal problem was fixed in 3.4.1. The next problem is in PR 20353.