Hallvard Breien Furuseth wrote:
On 23/01/15 18:10, hyc(a)symas.com wrote:
>> LMDB should not be pulled separately from OpenLDAP. I.e., only the
>> bundled
>> version of LMDB should be used with a given version of OpenLDAP.
>
> I've already had this conversation with the gentoo maintainers; they
> refuse to listen to reason. It's all their problem now.
Still, memalign() is a problem. mdb.c defines HAVE_MEMALIGN,
but it may be wrong for the user to -D"HAVE_MEMALIGN" since that
may omit whatever #include file declares it. <malloc/malloc.h>
(some Apple stuff I think), <malloc.h> dunno what else.
We could drop memalign. malloc(desired space + 1 OS page), then
adjust for alignment. On machines with a sane linear address
space where we can tell alignment from the address, anyway.
Such an address space is already a requirement for LMDB, since mmaps are
page-aligned.
On weirder hosts, you care about them, omit alignment altogether
if posix_memalign is missing. And omit O_DIRECT/F_NOCACHE in
mdb_env_copy2(). I gather those are why we need alignment.
Right.
Branch "mdb/memalign" in
<git://git.uio.no/u/hbf/openldap.git>
has draft code.
Still don't have time to check this myself, may have an opportunity
tomorrow.
Daniel: You can try that branch, and configure with
CPPFLAGS="-DMDB_MEMALIGN_METHOD=2".
I guess the preprocessor test should be "defined(a test for
Darwin: __APPLE__, _MACOSX_ or..?)" and not __PPC__. PowerPC is
an architecture, while features like posix_memalign are defined
by compilers/operating systems. The macports issue disables mdb
for Darwin. Or maybe not, I don't know Mac, Darwin, PPC or
Gentoo, or if you just said this has been resolved, so I'll stay
out of of that issue.
Right. I thought you (OP) were talking about Gentoo Linux on PPC, not
MacOSX on PPC. Linux on PPC should be using the same glibc as any other
architecture, and as such ought to already have posix_memalign.
--
-- Howard Chu
CTO, Symas Corp.
http://www.symas.com
Director, Highland Sun
http://highlandsun.com/hyc/
Chief Architect, OpenLDAP
http://www.openldap.org/project/