I found a workaround.
I'm posting it here in case if anyone ever wanted to cross-compile Samba
with LDAP support for Linux / mipsel / uclibc.
"lutil_memcmp" comes from OpenLDAP (2.3.18).
It is defined in openldap-2.3.18/include/ac/string.h
To get around this issue, you have to comment out lines 92-95 in that file:
int (lutil_memcmp)(const void *b1, const void *b2, size_t len);
#define memcmp lutil_memcmp
Interestingly, it isn't used anywhere else.
Then, compile OpenLDAP once again, and Samba's ./configure (gcc really)
script shouldn't complain again.
Of course, I don't know if it doesn't break things...