# On older systems (like RHEL 6), jemalloc must also link to -lrt for getclock
# On RHEL 7 and greater, this is not  needed as it's part of libc there.
# Ward Poelmans <ward.poelmans@ugent.be>
diff -ur mariadb-10.1.13.orig/cmake/jemalloc.cmake mariadb-10.1.13/cmake/jemalloc.cmake
--- mariadb-10.1.13.orig/cmake/jemalloc.cmake	2016-03-24 10:12:10.000000000 +0100
+++ mariadb-10.1.13/cmake/jemalloc.cmake	2016-04-20 16:21:18.102681504 +0200
@@ -21,6 +21,7 @@
       SET(what bundled)
     ELSE()
       SET(libname jemalloc c)
+      SET(CMAKE_REQUIRED_LIBRARIES rt)
       SET(what system)
     ENDIF()
 
