On Thu, Dec 02, 2010 at 02:00:10PM -0500, David Schultz wrote: > On Thu, Dec 02, 2010, Kostik Belousov wrote: > > For __isnanf, libc exports __isn...@fbsd_1.0, and libm exports > > __isn...@fbsd_1.2. I suspect that we could export both > > __isn...@fbsd_1.0 and __isn...@fbsd_1.2 from libc. > > I like the idea of adding an __isn...@fbsd_1.2 alias to libc for > the benefit of people running -CURRENT.
Ok, draft of the change is below, I am not sure is it worth the churn. I was unable to make the ld support two versions of the same symbol. lib/msun would benefit from elimination of isnan sources if this is committed. diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index d55bc46..f7c722e 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -19,8 +19,8 @@ SRCS+= __getosreldate.c __xuname.c \ getosreldate.c getpagesize.c getpagesizes.c \ getpeereid.c getprogname.c getpwent.c getttyent.c \ getusershell.c getutxent.c getvfsbyname.c glob.c \ - initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ - lockf.c lrand48.c mrand48.c nftw.c nice.c \ + initgroups.c isatty.c isinf.c isnan.c isnan_compat.c jrand48.c \ + lcong48.c lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pututxline.c pw_scan.c pwcache.c \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index f9abab5..fd0a896 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -200,7 +200,6 @@ FBSD_1.0 { getvfsbyname; __isnan; isnan; - __isnanf; isnanf; __isinf; isinf; @@ -378,6 +377,7 @@ FBSD_1.2 { sem_wait; setutxdb; setutxent; + __isnanf; }; FBSDprivate_1.0 { diff --git a/lib/libc/gen/isnan_compat.c b/lib/libc/gen/isnan_compat.c new file mode 100644 index 0000000..f4749eb --- /dev/null +++ b/lib/libc/gen/isnan_compat.c @@ -0,0 +1,17 @@ +/* + * The file is in public domain. + * Written by Konstantin Belousov <k...@freebsd.org> + * + * $FreeBSD$ + */ + +#include <math.h> + +__sym_compat(__isnanf, __isnanf_compat, FBSD_1.0); + +int +__isnanf_compat(float f) +{ + + return (__isnanf(f)); +} diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map index 429a76f..8b33dca 100644 --- a/lib/msun/Symbol.map +++ b/lib/msun/Symbol.map @@ -118,7 +118,6 @@ FBSD_1.0 { __isfinite; __isfinitef; __isfinitel; - isnanf; __isnanl; __isnormal; __isnormalf; @@ -221,5 +220,4 @@ FBSD_1.1 { /* First added in 9.0-CURRENT */ FBSD_1.2 { - __isnanf; };
pgp3oWC0HQUjO.pgp
Description: PGP signature