From owner-freebsd-testing@FreeBSD.ORG Sun Feb 16 12:11:37 2014 Return-Path: Delivered-To: freebsd-testing@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0EAEDA5; Sun, 16 Feb 2014 12:11:36 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB1101848; Sun, 16 Feb 2014 12:11:36 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::21c3:44c8:db38:e11b] (unknown [IPv6:2001:7b8:3a7:0:21c3:44c8:db38:e11b]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 84A935C45; Sun, 16 Feb 2014 13:11:32 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_E1EE7649-678C-4FDF-9414-5CCF67D3D728"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Compile error with gcc From: Dimitry Andric In-Reply-To: Date: Sun, 16 Feb 2014 13:11:19 +0100 Message-Id: References: <695E42A3-2009-4DD7-B10E-BF8465C89D39@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1827) Cc: Julio Merino , freebsd-testing@FreeBSD.org, David Chisnall X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 12:11:37 -0000 --Apple-Mail=_E1EE7649-678C-4FDF-9414-5CCF67D3D728 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 16 Feb 2014, at 08:28, Garrett Cooper wrote: > On Feb 15, 2014, at 9:25 PM, Garrett Cooper = wrote: >=20 >> Hi Julio, >> I ran into this error when trying to compile ATF with gcc on = code based off of r261958: >>=20 >> --- application.So --- >> /usr/src/contrib/atf/atf-c++/detail/application.cpp: In constructor = 'atf::application::usage_error::usage_error(const char*, ...)': >> /usr/src/contrib/atf/atf-c++/detail/application.cpp:71: error: = 'vsnprintf' is not a member of 'std' >> *** [application.So] Error code 1 >>=20 >> I haven=92t dug into why this is occurring yet, but I assume = it=92s because of the ATF 0.20 upgrade. >> I=92m compiling with gcc/g++ of course, and not clang/libcxxrt. >=20 > This patch seems to work with gcc and clang/libcxxrt. I didn=92t = try it without clang/libcxxrt though... > Thanks! > -Garrett >=20 > <0001-Unbreak-compiling-ATF-after-the-0.20-upgrade-with-gc.patch> I don't think this will always work correctly. If MK_LIBCPLUSPLUS is defined in bsd.own.mk, it only means libc++ is being *built*, not that it is being used. It is probably easier and more fool-proof to check if _LIBCPP_VERSION is defined (which is the case when you use libc++) in bconfig.h, like so: Index: contrib/atf/bconfig.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- contrib/atf/bconfig.h (revision 261974) +++ contrib/atf/bconfig.h (working copy) @@ -56,7 +56,9 @@ #define HAVE_UNSETENV 1 /* Define to 1 if vsnprintf is in std */ +#ifdef _LIBCPP_VERSION #define HAVE_VSNPRINTF_IN_STD 1 +#endif /* Define to the sub-directory in which libtool stores uninstalled = libraries. */ Finally, please note that libstdc++'s cstdio header *does* have a declaration for vsnprintf(), but it is only active when _GLIBCXX_USE_C99 is defined. Unfortunately, the libstdc++ configure script does not define that variable when you run it, since according to the script, we lack a few C99 maths functions. -Dimitry --Apple-Mail=_E1EE7649-678C-4FDF-9414-5CCF67D3D728 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMAqvAACgkQsF6jCi4glqNzBgCfdDUjfxA7jhMNz95QsV+p4+0g DQYAn2+kREo6Yl0M9GG6H3LEgtvdWiy9 =Urju -----END PGP SIGNATURE----- --Apple-Mail=_E1EE7649-678C-4FDF-9414-5CCF67D3D728--