From owner-freebsd-toolchain@FreeBSD.ORG Wed Mar 5 20:28:38 2014 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A063EF65; Wed, 5 Mar 2014 20:28:38 +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 1EF32A54; Wed, 5 Mar 2014 20:28:37 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::a4c2:18df:61c3:7c81] (unknown [IPv6:2001:7b8:3a7:0:a4c2:18df:61c3:7c81]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 8937A5C45; Wed, 5 Mar 2014 21:28:28 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_B8682D86-F6FD-4433-8302-FA7C92A2A179"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Various issues with Clang and libc++ while playing with OpenCL (FYI) From: Dimitry Andric In-Reply-To: <53170AD1.4090506@FreeBSD.org> Date: Wed, 5 Mar 2014 21:28:16 +0100 Message-Id: <08932FE2-8FB5-4EAA-A673-07A3A54721C0@FreeBSD.org> References: <53170AD1.4090506@FreeBSD.org> To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= X-Mailer: Apple Mail (2.1874) Cc: Koop Mast , freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 20:28:38 -0000 --Apple-Mail=_B8682D86-F6FD-4433-8302-FA7C92A2A179 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 05 Mar 2014, at 12:30, Jean-S=E9bastien P=E9dron = wrote: > I'm trying to make OpenCL work on FreeBSD, using Mesa 10.1 release > candidate. Very nice to hear! > The implementation of libOpenCL.so in Mesa, called Clover, is in C++. = In > the configure.ac script, they require GCC 4.7+, but I think it's = mainly > for C++11 support. When building Mesa with Clang 3.4 and 11-CURRENT's > libc++, I had the following issues: >=20 > 1. Clang 3.4 fails to build Clover, see this PR: > https://bugs.freedesktop.org/show_bug.cgi?id=3D74098 >=20 > In the last comment, there's a patch to Clover, working around the > problem. Its author opened a ticket on LLVM bug tracker: > http://llvm.org/bugs/show_bug.cgi?id=3D18645 That PR has been languishing a little. I'll see if I can get some attention from the right people upstream. :) > 2. Mesa's configure script is looking for stddef.h here: > /usr/local/llvm34/lib/clang/3.4/include >=20 > LLVM/Clang ports don't install this file. I just added a symlink to > /usr/include/stddef.h and Mesa was happy. I still need to check how > it goes if I remove the check and the symlink. But perhaps Mesa is > right to expect this header (and maybe other) in this directory, I > don't know. Clang provides its own version of a bunch of such headers, such as stddef.h, stdarg.h, and so on, which conflict with our version in base (e.g. /usr/include). Therefore, the base version of clang does not install these, and apparently, neither do the clang ports. On the other hand, I don't really understand why Mesa wants to know *where* a header is exactly located. Normally, in configure scripts or similar, you are only interested in whether the compiler can find it or not. > 3. Our base libc++ has a bug in the header. I posted a PR > on Mesa bug tracker here, before I found out it was a problem with > libc++: > https://bugs.freedesktop.org/show_bug.cgi?id=3D75505 >=20 > Apparently, it's fixed in libc++ upstream, in r199848. I applied that fix to head in r262805, and I will MFC it after 3 days. > 4. At runtime, any OpenCL program segfaults in libc++ (I don't have = the > stack trace at hand and can't remember what it was... Something with > basic_string). >=20 > When using libc++ from ports (devel/libc++, r200683) and the work = around > for problem #1, Clover builds and OpenCL programs run fine. Hm, this is unfortunate. I'm interested in where the difference comes from, and I would ideally like to fix any problem with libc++ in base. Can you point me (privately if you like) to some info on how to build and reproduce? -Dimitry --Apple-Mail=_B8682D86-F6FD-4433-8302-FA7C92A2A179 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) iEYEARECAAYFAlMXiOYACgkQsF6jCi4glqPAiACgtOQTLaayj/sMXiJYbBgjQNFN sXsAn2o9CvMULoRDOTEHdARw1V+C/Dfh =fXiD -----END PGP SIGNATURE----- --Apple-Mail=_B8682D86-F6FD-4433-8302-FA7C92A2A179--