[Bug 199422] fmodl not fully defined on architectures where LDBL_PREC == 53 (arm, mips, powerpc)

Bruce Evans brde at optusnet.com.au
Mon Apr 13 17:29:40 UTC 2015


On Mon, 13 Apr 2015 bugzilla-noreply at freebsd.org wrote:

> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199422
>
> I testing out a change to build lib/msun/tests on all architectures, and I
> lib/msun/tests/fmod_test failed to compile on MACHINE == {arm,mips,powerpc}
> with the following error:
>
> t_fmod.o: In function `atfu_fmod_body':
> t_fmod.c:(.text+0x200): undefined reference to `fmodl'
> t_fmod.c:(.text+0x204): undefined reference to `fmodl'
> t_fmod.c:(.text+0x2f0): undefined reference to `fmodl'
> t_fmod.c:(.text+0x2f4): undefined reference to `fmodl'
> t_fmod.c:(.text+0x434): undefined reference to `fmodl'
> t_fmod.o:t_fmod.c:(.text+0x438): more undefined references to `fmodl' follow
> --- fmod_test ---
> *** [fmod_test] Error code 1
>
> make[8]: stopped in /home/ngie/head/lib/msun/tests
>
> Are these functions supposed to be fully defined?

fmodl just seems to be missing a weak definition.  Try this fix.

X diff -u2 e_fmod.c~ e_fmod.c
X --- e_fmod.c~	2013-05-30 08:14:16.000000000 +0000
X +++ e_fmod.c	2015-04-13 17:18:19.493921000 +0000
X @@ -21,4 +21,6 @@
X   */
X 
X +#include <float.h>
X +
X  #include "math.h"
X  #include "math_private.h"
X @@ -131,2 +133,6 @@
X  	return x;		/* exact output */
X  }
X +
X +#if (LDBL_MANT_DIG == 53)
X +__weak_reference(fmod, fmodl);
X +#endif

Testing weak aliases is mostly redundant, but it is
probably easier to not have special cases for them.
The special cases would still need existence tests.

Bruce


More information about the freebsd-bugs mailing list