Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Apr 2015 03:29:31 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: [Bug 199422] fmodl not fully defined on architectures where LDBL_PREC == 53 (arm, mips, powerpc)
Message-ID:  <20150414032241.K6307@besplex.bde.org>
In-Reply-To: <bug-199422-8@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

On Mon, 13 Apr 2015 bugzilla-noreply@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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150414032241.K6307>