kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aw...@apache.org
Subject [kudu] branch master updated: thirdparty: fix memkind build on el6 machines
Date Tue, 28 May 2019 01:06:11 GMT
This is an automated email from the ASF dual-hosted git repository.

awong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c3d45f  thirdparty: fix memkind build on el6 machines
7c3d45f is described below

commit 7c3d45f000c08579c861fed0dc67dfbec707cdb8
Author: Adar Dembo <adar@cloudera.com>
AuthorDate: Sun May 26 14:06:14 2019 -0700

    thirdparty: fix memkind build on el6 machines
    
    - The configure.ac shipped with the bundled jemalloc generates a broken
      configure script when invoked with autoconf 2.63 (i.e. the version of
      autoconf found on el6). Here's a patch that works around the issue and
      allows the build to proceed.
    - The configure.ac in memkind requires autoconf 2.64. With a little
      finagling, we can drop that dependency to 2.63.
    - The memkind build assumes that clock_gettime (needed by jemalloc) is found
      in glibc, but that's only true for new versions of glibc. In old versions,
      it's actually in librt. [1]
    
    1. https://github.com/memkind/memkind/issues/48
    
    Change-Id: I02f3acebde7e3ea5400fe342c9c62736b8b43118
    Reviewed-on: http://gerrit.cloudera.org:8080/13440
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
    Reviewed-by: Andrew Wong <awong@cloudera.com>
    Tested-by: Kudu Jenkins
---
 thirdparty/download-thirdparty.sh                  |  7 +++--
 .../memkind-fix-build-with-old-autoconf.patch      | 32 +++++++++++++++++++
 .../patches/memkind-fix-build-with-old-glibc.patch | 24 +++++++++++++++
 ...kind-fix-jemalloc-build-with-old-autoconf.patch | 36 ++++++++++++++++++++++
 4 files changed, 97 insertions(+), 2 deletions(-)

diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh
index d883884..dd51678 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -354,11 +354,14 @@ fetch_and_patch \
  $NUMACTL_SOURCE \
  $NUMACTL_PATCHLEVEL
 
-MEMKIND_PATCHLEVEL=0
+MEMKIND_PATCHLEVEL=3
 fetch_and_patch \
  memkind-${MEMKIND_VERSION}.tar.gz \
  $MEMKIND_SOURCE \
- $MEMKIND_PATCHLEVEL
+ $MEMKIND_PATCHLEVEL \
+ "patch -p1 < $TP_DIR/patches/memkind-fix-jemalloc-build-with-old-autoconf.patch" \
+ "patch -p1 < $TP_DIR/patches/memkind-fix-build-with-old-autoconf.patch" \
+ "patch -p1 < $TP_DIR/patches/memkind-fix-build-with-old-glibc.patch"
 
 BOOST_PATCHLEVEL=1
 fetch_and_patch \
diff --git a/thirdparty/patches/memkind-fix-build-with-old-autoconf.patch b/thirdparty/patches/memkind-fix-build-with-old-autoconf.patch
new file mode 100644
index 0000000..0f99b98
--- /dev/null
+++ b/thirdparty/patches/memkind-fix-build-with-old-autoconf.patch
@@ -0,0 +1,32 @@
+commit c8dbc9f
+Author: Adar Dembo <adar@cloudera.com>
+Date:   Sun May 26 14:20:51 2019 -0700
+
+    configure.ac: fixes for autoconf 2.63
+
+diff --git a/configure.ac b/configure.ac
+index 64c3200..ec5dbb1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,10 +25,10 @@
+ #                                               -*- Autoconf -*-
+ # Process this file with autoconf to produce a configure script.
+ 
+-AC_PREREQ([2.64])
++AC_PREREQ([2.63])
+ AC_INIT([memkind],m4_esyscmd([tr -d '\n' < VERSION]))
+ 
+-AC_CONFIG_MACRO_DIRS([m4])
++AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_HEADERS([config.h])
+ AC_CONFIG_SRCDIR([memkind.spec.mk])
+ 
+@@ -36,7 +36,7 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects
paralle
+ AM_SILENT_RULES([yes])
+ 
+ # Checks for programs and libraries.
+-AM_PROG_AR
++m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+ AC_PROG_CXX
+ AC_PROG_CC
+ AC_OPENMP
diff --git a/thirdparty/patches/memkind-fix-build-with-old-glibc.patch b/thirdparty/patches/memkind-fix-build-with-old-glibc.patch
new file mode 100644
index 0000000..06dd525
--- /dev/null
+++ b/thirdparty/patches/memkind-fix-build-with-old-glibc.patch
@@ -0,0 +1,24 @@
+commit 2113b6b
+Author: Adar Dembo <adar@cloudera.com>
+Date:   Sun May 26 14:39:46 2019 -0700
+
+    Makefile.am: fixes for building against older glibc
+    
+    In older versions of glibc (such as the version found on el6 machines),
+    the clock_gettime function is in librt rather than in libc directly. Our
+    bundled jemalloc depends on clock_gettime and may link against librt, so
+    let's make sure the memkind library links against librt too.
+
+diff --git a/Makefile.am b/Makefile.am
+index f791ce7..de57d90 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -44,7 +44,7 @@ libmemkind_la_SOURCES = src/hbwmalloc.c \
+ 
+ 
+ libmemkind_la_LIBADD = jemalloc/obj/lib/libjemalloc_pic.a
+-libmemkind_la_LDFLAGS = -version-info 0:1:0 -ldl
++libmemkind_la_LDFLAGS = -version-info 0:1:0 -ldl -lrt
+ include_HEADERS = include/hbw_allocator.h \
+                   include/hbwmalloc.h \
+                   include/memkind.h \
diff --git a/thirdparty/patches/memkind-fix-jemalloc-build-with-old-autoconf.patch b/thirdparty/patches/memkind-fix-jemalloc-build-with-old-autoconf.patch
new file mode 100644
index 0000000..fc6129f
--- /dev/null
+++ b/thirdparty/patches/memkind-fix-jemalloc-build-with-old-autoconf.patch
@@ -0,0 +1,36 @@
+commit 608c2eb
+Author: Adar Dembo <adar@cloudera.com>
+Date:   Sun May 26 14:00:50 2019 -0700
+
+    jemalloc: unroll dlsym checking logic in configure.ac
+    
+    The nested calls here cause autoconf 2.63 to generate a broken script[1].
+    The upstream jemalloc response has been to require autoconf 2.68, but that
+    means we can't build jemalloc (and thus memkind) on el6.6. As a workaround,
+    we can simply unroll these nested calls.
+    
+    1. https://github.com/jemalloc/jemalloc/issues/912
+
+diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac
+index 5bd5442..cbc1e5d 100644
+--- a/jemalloc/configure.ac
++++ b/jemalloc/configure.ac
+@@ -1454,10 +1454,14 @@ if test "x$abi" != "xpecoff" ; then
+   have_pthread="1"
+   dnl Check if we have dlsym support.
+   have_dlsym="1"
+-  AC_CHECK_HEADERS([dlfcn.h],
+-    AC_CHECK_FUNC([dlsym], [],
+-      [AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"], [have_dlsym="0"])]),
+-    [have_dlsym="0"])
++  AC_CHECK_HEADERS([dlfcn.h], , [have_dlsym="0"])
++  check_dlsym_in_libdl="0"
++  if test "x$have_dlsym" = "x1" ; then
++    AC_CHECK_FUNC([dlsym], [], [check_dlsym_in_libdl="1"])
++  fi
++  if test "x$check_dlsym_in_libdl" = "x1" ; then
++    AC_CHECK_LIB([dl], [dlsym], [LIBS="$LIBS -ldl"], [have_dlsym="0"])
++  fi
+   if test "x$have_dlsym" = "x1" ; then
+     AC_DEFINE([JEMALLOC_HAVE_DLSYM], [ ])
+   fi


Mime
View raw message