Re: OpenLDAP: core dump with latest CLANG buildworld.

From: Dimitry Andric <dimitry_at_andric.com>
Date: Fri, 04 May 2012 23:10:28 +0200
On 2012-05-04 10:40, Hartmann, O. wrote:> On all FreeBSD 10-CURRENt boxes, built with CLANG, there is no OpenLDAP
> anymore since yesterday's buildworld!
> OpenLDAP (slapd), the most recent build from the ports (recompiled
> everything in hope to fix the problem) coredumps immediately after it
> tries to start. Examination of the cause with slapd -d256 doesn't work.

Which version of openldap did you use?  I built openldap24-server with
its default settings, and it starts up just fine.


...
> Recompiling everything prerequisit for OpenLDAP/SASL revealed that even
> now databases/db5 isn't compiling with CLANG anymore (which has before
> the last LLVM update).
> 
> What happened? Why is CLANG (3.1?) now so picky about some __atomic_...
> statements?

This is because bdb5 tries to redefine gcc's builtin atomic functions,
which are also supported by clang (this is a feature :).  It is rather
dumb to use names starting with underscores for this, since they are
reserved.

The same problem occurs if you compile with gcc 4.7 or higher, albeit
gcc apparently doesn't think this is serious enough to bail out:

  ./libtool --mode=compile /usr/local/bin/gcc47 -c -I. -I./../src  -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing  ../src/mutex/mut_tas.c
  libtool: compile:  /usr/local/bin/gcc47 -c -I. -I./../src -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing ../src/mutex/mut_tas.c  -fPIC -DPIC -o .libs/mut_tas.o
  In file included from ./../src/dbinc/mutex_int.h:12:0,
		   from ./../src/dbinc/mutex.h:15,
		   from ./db_int.h:1089,
		   from ../src/mutex/mut_tas.c:11:
  ./../src/dbinc/atomic.h:179:19: warning: conflicting types for built-in function '__atomic_compare_exchange' [enabled by default]

In any case, attached is a simple patch to fix the db5 port.

Received on Fri May 04 2012 - 19:10:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:26 UTC