From owner-freebsd-current Mon Feb 17 6:46:20 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3D7137B401 for ; Mon, 17 Feb 2003 06:46:18 -0800 (PST) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0658F43FAF for ; Mon, 17 Feb 2003 06:46:18 -0800 (PST) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 4C9BD53B5; Mon, 17 Feb 2003 15:46:16 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: current@freebsd.org Subject: -fno-builtin world breaks in gperf From: Dag-Erling Smorgrav Date: Mon, 17 Feb 2003 15:46:15 +0100 Message-ID: User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.2 (i386--freebsd) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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