https://bugs.openldap.org/show_bug.cgi?id=10099
--- Comment #4 from Howard Chu hyc@openldap.org --- Yes, understood. But libldap by itself can't cause an entire machine to hang, so that had to be a problem specific to the process that was running. The fact that the behavior depends on the kernel version implies some other problems as well, since libldap doesn't do anything special to the kernel.
As for "hanging somewhere inside the library" please provide a complete stack trace of the offending process when it hangs.
I don't see anything special in the Makefile you attached. Please provide a diff showing the actual flag changes you needed to make.
Right now you've provided no useful details. If you don't provide all the requested information, there's not much we can do to investigate.