From owner-freebsd-ports@FreeBSD.ORG Tue Jul 23 21:39:17 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AAB4C96F for ; Tue, 23 Jul 2013 21:39:17 +0000 (UTC) (envelope-from freebsd@grem.de) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id 1889B26C3 for ; Tue, 23 Jul 2013 21:39:16 +0000 (UTC) Received: (qmail 2091 invoked by uid 89); 23 Jul 2013 21:39:09 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@93.215.182.205) by mail.grem.de with ESMTPA; 23 Jul 2013 21:39:09 -0000 Date: Tue, 23 Jul 2013 23:39:08 +0200 From: Michael Gmelin To: Matthias Andree Subject: Re: Building db5 with clang 3.3 Message-ID: <20130723233908.31c405c8@bsd64.grem.de> In-Reply-To: <51EEDDFE.5070009@FreeBSD.org> References: <20130613031535.4087d7f9@bsd64.grem.de> <20130722003246.5a05635d@bsd64.grem.de> <51EEDDFE.5070009@FreeBSD.org> X-Mailer: Claws Mail 3.9.1 (GTK+ 2.24.18; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Dimitry Andric , "freebsd-ports@freebsd.org Ports" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 21:39:17 -0000 On Tue, 23 Jul 2013 21:48:14 +0200 Matthias Andree wrote: > Am 22.07.2013 00:32, schrieb Michael Gmelin: > > > I just tested building databases/db5 on 9.2-BETA1 (which ships with > > clang 3.3) using c++11 and libc++ and ran into the same problem. > > Dimitry's patch applied cleanly and resolved the issue. Do you think > > you could commit his patch to db5? > > Generally speaking yes, > but what do I need to do to reproduce the problem on > 9.1-RELEASE-mumble? > That's a good question. Since the problem is caused by db5's redefinition of atomic_init, which is used in current versions of libc++ you'll need clang++ 3.3 and a matching libc++ (/usr/ports/devel/libc++ uses SVN Rev 185324 right now). Unfortunately libc++ won't build on 9.1-RELEASE by default, since it requires at least OS version 901502 (which means 9.1-STABLE as of Nov 28 2012 or later) due to the lack of aligned_alloc in earlier versions of the OS. Fortunately a patch for the sake of demonstrating the problem is not too hard. So what you can do to reproduce this is the following (just tested this on a 9.1-RELEASE machine): 1. Install clang33 cd /usr/ports/lang/clang33 make install 2. Extract, modify and install libc++ cd /usr/ports/devel/libc++ make -DNO_IGNORE extract Modify work/libc++-185324/include/cstdlib and add the following snipped at line 87 (right after #include ): --- snippet begin --- #include inline void * aligned_alloc(size_t alignment, size_t size) { void *memptr; int ret; ret = posix_memalign(&memptr, alignment, size); if (ret != 0) { errno = ret; return (NULL); } return (memptr); } --- snippet end --- make install 3. Add the following lines to /etc/make.conf CC=clang33 CXX=clang++33 -std=c++11 -stdlib=libc++ -I/usr/local/include/c++/v1 -L/usr/local/lib 4. Build databases/db5 and see it fail cd /usr/ports/databases/db5 make .... /usr/local/include/c++/v1/atomic:1447:28: error: unknown type name 'atomic_flag' atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT ... Cheers, Michael -- Michael Gmelin