Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2003 15:46:15 +0100
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        current@freebsd.org
Subject:   -fno-builtin world breaks in gperf
Message-ID:  <xzp1y2755jc.fsf@flood.ping.uio.no>

next in thread | raw e-mail | index | archive | help
c++  -O2 -pipe -fno-builtin -march=k6-2  -g  -I/usr/src/gnu/usr.bin/gperf/../../
../contrib/gperf/lib -I/usr/src/gnu/usr.bin/gperf  -o gperf bool-array.o gen-per
f.o hash-table.o iterator.o key-list.o list-node.o main.o new.o options.o read-l
ine.o trace.o vectors.o version.o hash.o getopt.o getopt1.o
/usr/obj/usr/src/i386/usr/lib/libstdc++.so: undefined reference to `fabsl'
*** Error code 1

Our libm doesn't seem to support long double at all, yet our libstdc++
requires long double support.  It seems to correctly detect the
absence of a "real" fabsl() and the presence of the gcc builtin, but
then goes on to use the fabsl() instead of __builtin_fabsl() in at
least one instance (src/contrib/libstdc++/libmath/stubs.c).  There's a
similar problem with sqrtl().  The following quick hack allows gperf
to build:

Index: libmath/stubs.c
===================================================================
RCS file: /home/ncvs/src/contrib/libstdc++/libmath/stubs.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 stubs.c
--- libmath/stubs.c     28 May 2002 16:16:02 -0000      1.1.1.1
+++ libmath/stubs.c     17 Feb 2003 14:41:38 -0000
@@ -127,9 +127,9 @@
 long double
 hypotl(long double x, long double y)
 {
-  long double s = fabsl(x) + fabsl(y);
+  long double s = __builtin_fabsl(x) + __builtin_fabsl(y);
   x /= s; y /= s;
-  return s * sqrtl(x * x + y * y);
+  return s * __builtin_sqrtl(x * x + y * y);
 }
 #endif

but it's not a good long-term solution since it won't work on !gcc.

DES
-- 
Dag-Erling Smorgrav - des@ofug.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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