mremap cannot be defined correctly in terms of mmap and munmap. It is not in the common GNU API/ABI, only in Linux. The malloc code is full of HAVE_REMAP conditionals. Just fix whatever the new case is to properly conditionalize its use.
Thanks, Roland