From owner-freebsd-bugs@FreeBSD.ORG Mon Apr 13 17:29:40 2015 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B5A3F5D for ; Mon, 13 Apr 2015 17:29:40 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5CBAAA for ; Mon, 13 Apr 2015 17:29:39 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id EA132D65962 for ; Tue, 14 Apr 2015 03:29:31 +1000 (AEST) Date: Tue, 14 Apr 2015 03:29:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org cc: freebsd-bugs@freebsd.org Subject: Re: [Bug 199422] fmodl not fully defined on architectures where LDBL_PREC == 53 (arm, mips, powerpc) In-Reply-To: Message-ID: <20150414032241.K6307@besplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=9cW_t1CCXrUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=6eDVSmkA6v0oe3KBrioA:9 a=CjuIK1q_8ugA:10 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 17:29:40 -0000 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 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