<p>When I attempt to build rpm 4.14 for macOS with the ndb rpmdb backend enabled, it fails to compile due to the Linux-specific <a href="http://man7.org/linux/man-pages/man2/mremap.2.html"><code>mremap(2)</code></a> syscall missing.</p>
<pre><code>depbase=`echo backend/ndb/rpmxdb.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H   -I.. -I.. -I../include/  -I../misc -DLOCALEDIR="\"/usr/local/share/locale\"" -DSYSCONFDIR="\"/usr/local/etc\"" -DLOCALSTATEDIR="\"/usr/local/var\"" -DLIBRPMALIAS_FILENAME="\"rpmpopt-4.14.0\"" -DLIBRPMALIAS_EXECPATH="\"/usr/local/bin\"" -I/usr/local/include  -I/usr/local/include -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes  -fno-strict-aliasing -fstack-protector -Wempty-body -DLUA_COMPAT_ALL -DLUA_COMPAT_MODULE -MT backend/ndb/rpmxdb.lo -MD -MP -MF $depbase.Tpo -c -o backend/ndb/rpmxdb.lo backend/ndb/rpmxdb.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I.. -I.. -I../include/ -I../misc -DLOCALEDIR=\"/usr/local/share/locale\" -DSYSCONFDIR=\"/usr/local/etc\" -DLOCALSTATEDIR=\"/usr/local/var\" -DLIBRPMALIAS_FILENAME=\"rpmpopt-4.14.0\" -DLIBRPMALIAS_EXECPATH=\"/usr/local/bin\" -I/usr/local/include -I/usr/local/include -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -fno-strict-aliasing -fstack-protector -Wempty-body -DLUA_COMPAT_ALL -DLUA_COMPAT_MODULE -MT backend/ndb/rpmxdb.lo -MD -MP -MF backend/ndb/.deps/rpmxdb.Tpo -c backend/ndb/rpmxdb.c  -fno-common -DPIC -o backend/ndb/.libs/rpmxdb.o
backend/ndb/rpmxdb.c:168:11: warning: implicit declaration of function 'mremap' is invalid in C99 [-Wimplicit-function-declaration]
        mapped = mremap(slot->mapped - shift, oldsize, newsize, MREMAP_MAYMOVE);
                 ^
backend/ndb/rpmxdb.c:168:58: error: use of undeclared identifier 'MREMAP_MAYMOVE'
        mapped = mremap(slot->mapped - shift, oldsize, newsize, MREMAP_MAYMOVE);
                                                                ^
backend/ndb/rpmxdb.c:764:65: error: use of undeclared identifier 'MREMAP_MAYMOVE'
    newaddr = mremap(xdb->mapped, xdb->mappedlen, newmappedlen, MREMAP_MAYMOVE);
                                                                ^
1 warning and 2 errors generated.
make[3]: *** [backend/ndb/rpmxdb.lo] Error 1
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/334">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ANb80zbtyTNyLYQrd74hjGsB_it_Krrnks5sskjvgaJpZM4P51Tw">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ANb80z7S6nTs8if9PvHAl4grPeqy9JZOks5sskjvgaJpZM4P51Tw.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/rpm-software-management/rpm/issues/334"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/rpm-software-management/rpm","title":"rpm-software-management/rpm","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/rpm-software-management/rpm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"rpm with ndb fails to build on macOS due to missing \"mremap()\" (#334)"}],"action":{"name":"View Issue","url":"https://github.com/rpm-software-management/rpm/issues/334"}}}</script>