gperftools-2.2 can be built (at least the tcmalloc portion) on Linux s390x. These changes are not in upstream gperftools yet.
1. gperftools does not have a stack unwinder for s390x. Add HAVE_DECL_BACKTRACE to CPPDEFINES.
2. Define CACHELINE_ALIGNED in src/base/basictypes.h.
3. Implement a cycle clock in src/base/cycleclock.h.
4. Adapt src/base/linux_syscall_support.h for s390x.
5. Fix a memcmp bug in src/base/sysinfo.cc, around line 124. This code assumes that both *p and name are at least namelen long, which is not always true.
6. Implement do_mmap64 for s390x in src/malloc_hook_mmap_linux.h.
With the above changes, MongoDB can be built without the --allocator=system option.