From owner-svn-src-all@FreeBSD.ORG Sat Nov 17 23:05:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A4344E0; Sat, 17 Nov 2012 23:05:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06B318FC08; Sat, 17 Nov 2012 23:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHN5Ist002674; Sat, 17 Nov 2012 23:05:18 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHN5IZn002672; Sat, 17 Nov 2012 23:05:18 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172305.qAHN5IZn002672@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243193 - in stable/9/lib: libc/gen msun/src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:05:19 -0000 Author: dim Date: Sat Nov 17 23:05:18 2012 New Revision: 243193 URL: http://svnweb.freebsd.org/changeset/base/243193 Log: MFC r242879: Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, but not in libm.so. This makes it possible to statically link executables using both isnan and isnanf with libc and libm. Tested by: kargl MFC r242894: Add an explanatory comment to lib/libc/gen/isnan.c about the fix to make static linking with libc and libm work. Requested by: jilles Modified: stable/9/lib/libc/gen/isnan.c stable/9/lib/msun/src/s_isnan.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/9/lib/libc/gen/isnan.c ============================================================================== --- stable/9/lib/libc/gen/isnan.c Sat Nov 17 22:58:33 2012 (r243192) +++ stable/9/lib/libc/gen/isnan.c Sat Nov 17 23:05:18 2012 (r243193) @@ -33,8 +33,14 @@ /* * XXX These routines belong in libm, but they must remain in libc for * binary compat until we can bump libm's major version number. + * + * Note this only applies to the dynamic versions of libm and libc, so + * for the static and profiled versions we stub out the definitions. + * Otherwise you cannot link statically to libm and libc at the same + * time, when calling both functions. */ +#ifdef PIC __weak_reference(__isnan, isnan); __weak_reference(__isnanf, isnanf); @@ -55,3 +61,4 @@ __isnanf(float f) u.f = f; return (u.bits.exp == 255 && u.bits.man != 0); } +#endif /* PIC */ Modified: stable/9/lib/msun/src/s_isnan.c ============================================================================== --- stable/9/lib/msun/src/s_isnan.c Sat Nov 17 22:58:33 2012 (r243192) +++ stable/9/lib/msun/src/s_isnan.c Sat Nov 17 23:05:18 2012 (r243193) @@ -30,8 +30,9 @@ #include "fpmath.h" -/* Provided by libc */ -#if 0 +/* Provided by libc.so */ +#ifndef PIC +#undef isnan int isnan(double d) { @@ -40,7 +41,7 @@ isnan(double d) u.d = d; return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0)); } -#endif +#endif /* !PIC */ int __isnanf(float f)