From owner-freebsd-toolchain@FreeBSD.ORG Sun Feb 3 22:33:57 2013 Return-Path: Delivered-To: toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9A97D3B8; Sun, 3 Feb 2013 22:33:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 19315DAD; Sun, 3 Feb 2013 22:33:57 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id ACC8E5C5A; Sun, 3 Feb 2013 23:33:55 +0100 (CET) Message-ID: <510EE5D2.4050409@FreeBSD.org> Date: Sun, 03 Feb 2013 23:33:54 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Pedro Giffuni , Andriy Gapon Subject: Re: base gcc and _GLIBCXX_USE_C99 References: <5106953E.2020907@FreeBSD.org> <510BBCAD.3070705@FreeBSD.org> <510BD53D.1070209@FreeBSD.org> In-Reply-To: <510BD53D.1070209@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------070202030408030402030001" Cc: toolchain@FreeBSD.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 22:33:57 -0000 This is a multi-part message in MIME format. --------------070202030408030402030001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2013-02-01 15:46, Pedro Giffuni wrote: > On 02/01/2013 08:01, Andriy Gapon wrote: >> on 28/01/2013 17:11 Andriy Gapon said the following: >>> I wonder why the following is the case for the base gcc. >>> /usr/include/c++/4.2/bits/c++config.h: >>> >>> /* Define if C99 functions or macros from , , , >>> , and can be used or exposed. */ >>> /* #undef _GLIBCXX_USE_C99 */ >>> >>> Because of this undef there is no e.g. std::strtoll(). >>> Ditto for other things in stdlib.h. >>> > I looked at this very briefly and it looks like it would fix a nasty > issue we have been working around in OpenOffice. > > I suggest to enable it first on a gcc port though (it's tied to a > configure flag, but don't remember which). I had a bit more in-depth look at our current libstdc++ configuration. I took the original gcc 4.2.1 release tarball, modified a few autoconf related scripts to cope with "freebsd10.0" being the current version, and did a full three-stage build, though only targeting C and C++. The libstdc++ configure script in 4.2.1 does detect a few new features that are not in our shipping config.h, but is does not detect any different settings regarding C99. The reason it does not turn on _GLIBCXX_USE_C99, is that not all of the C99 requirements are met, specifically checks fail: checking for ISO C99 support in ... yes checking for ISO C99 support in ... no checking for ISO C99 support in ... yes checking for ISO C99 support in ... yes checking for ISO C99 support in ... yes checking for fully enabled ISO C99 support... no The exact failure testcase goes like this: configure:7435: checking for ISO C99 support in configure:7492: /home/dim/obj/gcc-4.2.1/./gcc/xgcc -shared-libgcc -B/home/dim/obj/gcc-4.2.1/./gcc -nostdinc++ -L/home/dim/obj/gcc-4.2.1/i386-unknown-freebsd10.0/libstdc++-v3/src -L/home/dim/obj/gcc-4.2.1/i386-unknown-freebsd10.0/libstdc++-v3/src/.libs -B/home/dim/ins/gcc-4.2.1/i386-unknown-freebsd10.0/bin/ -B/home/dim/ins/gcc-4.2.1/i386-unknown-freebsd10.0/lib/ -isystem /home/dim/ins/gcc-4.2.1/i386-unknown-freebsd10.0/include -isystem /home/dim/ins/gcc-4.2.1/i386-unknown-freebsd10.0/sys-include -c -g -O2 conftest.cc >&5 conftest.cc: In function 'int main()': conftest.cc:41: error: 'clogf' was not declared in this scope conftest.cc:47: error: 'cpowf' was not declared in this scope conftest.cc:54: error: 'clog' was not declared in this scope conftest.cc:60: error: 'cpow' was not declared in this scope conftest.cc:64: error: 'ccosl' was not declared in this scope conftest.cc:65: error: 'ccoshl' was not declared in this scope conftest.cc:66: error: 'cexpl' was not declared in this scope conftest.cc:67: error: 'clogl' was not declared in this scope conftest.cc:68: error: 'csinl' was not declared in this scope conftest.cc:69: error: 'csinhl' was not declared in this scope conftest.cc:71: error: 'ctanl' was not declared in this scope conftest.cc:72: error: 'ctanhl' was not declared in this scope conftest.cc:73: error: 'cpowl' was not declared in this scope configure:7498: $? = 1 So until we actually implement and declare those functions, we should probably not enable _GLIBCXX_USE_C99_COMPLEX and _GLIBCXX_USE_C99. I have attached a diff of the other changes that can be applied on our current libstdc++ config file, as detected by the configure script. I will probably commit that soonish, if there are no objections. As to the missing complex functions, I am not sure. Maybe these can be imported from somewhere else, e.g. NetBSD? This is probably something to ask the lib/msun specialists... -Dimitry --------------070202030408030402030001 Content-Type: text/x-diff; name="libstdcxx-reconfig-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libstdcxx-reconfig-1.diff" Index: gnu/lib/libstdc++/config.h =================================================================== --- gnu/lib/libstdc++/config.h (revision 246297) +++ gnu/lib/libstdc++/config.h (working copy) @@ -22,7 +22,7 @@ #define HAVE_ATAN2F 1 /* Define to 1 if you have the `atan2l' function. */ -/* #undef HAVE_ATAN2L */ +#define HAVE_ATAN2L 1 /* Define to 1 if you have the `atanf' function. */ #define HAVE_ATANF 1 @@ -67,7 +67,7 @@ #define HAVE_EXPF 1 /* Define to 1 if you have the `expl' function. */ -/* #undef HAVE_EXPL */ +#define HAVE_EXPL 1 /* Define to 1 if you have the `fabsf' function. */ #define HAVE_FABSF 1 @@ -100,7 +100,7 @@ #define HAVE_FMODF 1 /* Define to 1 if you have the `fmodl' function. */ -/* #undef HAVE_FMODL */ +#define HAVE_FMODL 1 /* Define to 1 if you have the `fpclass' function. */ /* #undef HAVE_FPCLASS */ @@ -134,7 +134,7 @@ #define HAVE_HYPOTF 1 /* Define to 1 if you have the `hypotl' function. */ -/* #undef HAVE_HYPOTL */ +#define HAVE_HYPOTL 1 /* Define to 1 if you have the `iconv' function. */ /* #undef HAVE_ICONV */ @@ -293,7 +293,7 @@ #define HAVE_SQRTF 1 /* Define to 1 if you have the `sqrtl' function. */ -/* #undef HAVE_SQRTL */ +#define HAVE_SQRTL 1 /* Define to 1 if you have the header file. */ #define HAVE_STDBOOL_H 1 @@ -304,6 +304,12 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 +/* Define if strerror_l is available in . */ +/* #undef HAVE_STRERROR_L */ + +/* Define if strerror_r is available in . */ +#define HAVE_STRERROR_R 1 + /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 @@ -316,6 +322,9 @@ /* Define to 1 if you have the `strtold' function. */ #define HAVE_STRTOLD 1 +/* Define if strxfrm_l is available in . */ +/* #undef HAVE_STRXFRM_L */ + /* Define to 1 if you have the header file. */ #define HAVE_SYS_FILIO_H 1 --------------070202030408030402030001--