You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/07/02 21:51:07 UTC

[1/5] mesos git commit: Added ELFIO as bundled dependency in Mesos.

Repository: mesos
Updated Branches:
  refs/heads/master ad4556f79 -> 8912a7ba2


Added ELFIO as bundled dependency in Mesos.

This includes a patch file to ELFIO to fix 2 off-by-one errors in the
parsing of NOTE sections. Patches for these bugs have been submitted
upstream. Details of the patches are below:

1) Fixed off-by-one error in 'name' of add_note() function.

Previously, when assigning 'name' as a string, its length was
specified using the full length of 'namesz'. However, this length
includes the trailing '\0' of the underlying char[]. This ultimately
causes the C++ string that is created to (incorrectly) contain the
'\0' character as well. This leads to problems where e.g. the
following will return false, even when 'name' itself contains the
string "GNU\0":

  if (name == "GNU") {
    return true;
  }
  return false;

To fix this, we should only include the length of the string minus the
trailing '\0'.

2) Fixed alignment of 'desc' in add_note() function.

The ELF spec specifically lists the alignment of the namez char[] to
be 4 bytes. To quote it:

"Padding is present, if necessary, to ensure 4-byte alignment for the
descriptor. Such padding is not included in namesz."

However, the current implementation sets the alignment to either 4 or
8 bytes depending on the class of the ELF file (CLASS32 or CLASS64).
This commit fixes the alignment to only 4 bytes in all cases.

Review: https://reviews.apache.org/r/49559/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5deb7729
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5deb7729
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5deb7729

Branch: refs/heads/master
Commit: 5deb77294f8accee619dccd8407e202220353929
Parents: ad4556f
Author: Kevin Klues <kl...@gmail.com>
Authored: Sat Jul 2 13:44:41 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Sat Jul 2 14:46:56 2016 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt       |  11 +++++++++
 3rdparty/Makefile.am          |  48 +++++++++++++++++++++++++++++++++++++
 3rdparty/cmake/Versions.cmake |   1 +
 3rdparty/elfio-3.1.patch      |  21 ++++++++++++++++
 3rdparty/elfio-3.1.tar.gz     | Bin 0 -> 2619869 bytes
 3rdparty/versions.am          |   1 +
 LICENSE                       |  29 ++++++++++++++++++++++
 configure.ac                  |  35 +++++++++++++++++++++++++++
 src/Makefile.am               |   5 ++++
 support/coverage.sh           |   1 +
 10 files changed, 152 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 15f3171..a7ae76a 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -28,6 +28,7 @@ set(UPSTREAM_URL ${3RDPARTY_DEPENDENCIES})
 set(REBUNDLED_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 if (REBUNDLED)
   set(BOOST_URL       ${REBUNDLED_DIR}/boost-${BOOST_VERSION}.tar.gz)
+  set(ELFIO_URL       ${REBUNDLED_DIR}/elfio-${ELFIO_VERSION}.tar.gz)
   set(GLOG_URL        ${REBUNDLED_DIR}/glog-${GLOG_VERSION}.tar.gz)
   set(PICOJSON_URL    ${REBUNDLED_DIR}/picojson-${PICOJSON_VERSION}.tar.gz)
   set(NVML_URL        ${REBUNDLED_DIR}/nvml-${NVML_VERSION}.tar.gz)
@@ -35,6 +36,7 @@ if (REBUNDLED)
   set(LIBEV_URL       ${REBUNDLED_DIR}/libev-${LIBEV_VERSION}.tar.gz)
 else (REBUNDLED)
   set(BOOST_URL       ${UPSTREAM_URL}/boost-${BOOST_VERSION}.tar.gz)
+  set(ELFIO_URL       ${UPSTREAM_URL}/elfio-${ELFIO_VERSION}.tar.gz)
   set(GLOG_URL        ${UPSTREAM_URL}/glog-${GLOG_VERSION}.tar.gz)
   set(PICOJSON_URL    ${UPSTREAM_URL}/picojson-${PICOJSON_VERSION}.tar.gz)
   set(NVML_URL        ${UPSTREAM_URL}/nvml-${NVML_VERSION}.tar.gz)
@@ -148,6 +150,15 @@ ExternalProject_Add(
   URL               ${BOOST_URL}
   )
 
+ExternalProject_Add(
+  ${ELFIO_TARGET}
+  PREFIX            ${ELFIO_CMAKE_ROOT}
+  CONFIGURE_COMMAND ${CMAKE_NOOP}
+  BUILD_COMMAND     ${CMAKE_NOOP}
+  INSTALL_COMMAND   ${CMAKE_NOOP}
+  URL               ${ELFIO_URL}
+  )
+
 # The patch, configure, build, and install commands are stubbed out on Windows
 # builds so that it defaults to build using CMake. This is for the same reason
 # as the GMock code library build, see the call to `ExternalProject_Add` for

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am
index bd990cc..97c2f92 100644
--- a/3rdparty/Makefile.am
+++ b/3rdparty/Makefile.am
@@ -43,6 +43,7 @@ pkg3rdpartydir = $(pkglibdir)/3rdparty
 include versions.am
 
 BOOST = boost-$(BOOST_VERSION)
+ELFIO = elfio-$(ELFIO_VERSION)
 GLOG = glog-$(GLOG_VERSION)
 GMOCK = gmock-$(GMOCK_VERSION)
 GPERFTOOLS = gperftools-$(GPERFTOOLS_VERSION)
@@ -60,6 +61,7 @@ ZOOKEEPER = zookeeper-$(ZOOKEEPER_VERSION)
 
 EXTRA_DIST =		\
   $(BOOST).tar.gz	\
+  $(ELFIO).tar.gz	\
   $(GLOG).tar.gz	\
   $(GMOCK).tar.gz	\
   $(GPERFTOOLS).tar.gz	\
@@ -74,6 +76,11 @@ EXTRA_DIST =		\
   $(WHEEL).tar.gz	\
   $(ZOOKEEPER).tar.gz
 
+# We need to patch ELFIO in order to deal with some off-by-one errors
+# in parsing the NOTE sections of a binary.
+EXTRA_DIST +=		\
+  $(ELFIO).patch
+
 # We need to patch glog in order to deal with a compilation issue when
 # compiling with clang (and C++11); see MESOS-860, MESOS-966.
 EXTRA_DIST +=		\
@@ -103,6 +110,7 @@ EXTRA_DIST +=		\
 
 CLEAN_EXTRACTED =	\
   $(BOOST)		\
+  $(ELFIO)		\
   $(GLOG)		\
   $(GMOCK)		\
   $(GPERFTOOLS)		\
@@ -146,6 +154,41 @@ if WITH_BUNDLED_BOOST
   ALL_LOCAL += $(BOOST)-stamp
 endif
 
+if WITH_BUNDLED_ELFIO
+# Stout depends on ELFIO. Install ELFIO into $PREFIX/include
+# but don't add it to the source tarball.
+elfiodir = $(includedir)/elfio
+
+nodist_elfio_HEADERS =			\
+  $(ELFIO)/elfio/elf_types.hpp		\
+  $(ELFIO)/elfio/elfio.hpp		\
+  $(ELFIO)/elfio/elfio_dump.hpp		\
+  $(ELFIO)/elfio/elfio_dynamic.hpp	\
+  $(ELFIO)/elfio/elfio_header.hpp	\
+  $(ELFIO)/elfio/elfio_note.hpp		\
+  $(ELFIO)/elfio/elfio_relocation.hpp	\
+  $(ELFIO)/elfio/elfio_section.hpp	\
+  $(ELFIO)/elfio/elfio_segment.hpp	\
+  $(ELFIO)/elfio/elfio_strings.hpp	\
+  $(ELFIO)/elfio/elfio_symbols.hpp	\
+  $(ELFIO)/elfio/elfio_utils.hpp
+
+$(ELFIO)/elfio/elf_types.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_dump.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_dynamic.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_header.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_note.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_relocation.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_section.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_segment.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_strings.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_symbols.hpp: $(ELFIO)-stamp
+$(ELFIO)/elfio/elfio_utils.hpp: $(ELFIO)-stamp
+
+ALL_LOCAL += $(ELFIO)-stamp
+endif
+
 if WITH_BUNDLED_GLOG
 LIB_GLOG = $(GLOG)/libglog.la
 GLOG_LDFLAGS = # Initialize to empty
@@ -295,6 +338,11 @@ if WITH_BUNDLED_BOOST
 	  rm -rf $(INSTALLDIR)/include/boost
 	cp -fpR $(BOOST)/boost $(INSTALLDIR)/include/
 endif
+if WITH_BUNDLED_ELFIO
+	@test -d $(INSTALLDIR)/include/elfio || \
+	  rm -rf $(INSTALLDIR)/include/elfio /
+	cp -fpR $(ELFIO)/elfio $(INSTALLDIR)/include/
+endif
 if WITH_BUNDLED_GLOG
 	cd $(GLOG) && \
 	  $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$(INSTALLDIR) install

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/3rdparty/cmake/Versions.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Versions.cmake b/3rdparty/cmake/Versions.cmake
index 7b73f8f..e5cf7d0 100644
--- a/3rdparty/cmake/Versions.cmake
+++ b/3rdparty/cmake/Versions.cmake
@@ -1,5 +1,6 @@
 set(BOOST_VERSION       "1.53.0")
 set(CURL_VERSION        "7.43.0")
+set(ELFIO_VERSION       "3.1")
 set(GLOG_VERSION        "0.3.3")
 set(GMOCK_VERSION       "1.7.0")
 set(HTTP_PARSER_VERSION "2.6.2")

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/3rdparty/elfio-3.1.patch
----------------------------------------------------------------------
diff --git a/3rdparty/elfio-3.1.patch b/3rdparty/elfio-3.1.patch
new file mode 100644
index 0000000..f8c20e9
--- /dev/null
+++ b/3rdparty/elfio-3.1.patch
@@ -0,0 +1,21 @@
+diff -ruN elfio-3.1/elfio/elfio_note.hpp elfio-3.1-repo/elfio/elfio_note.hpp
+--- elfio-3.1/elfio/elfio_note.hpp	2016-04-23 07:58:34.000000000 -0700
++++ elfio-3.1-repo/elfio/elfio_note.hpp	2016-07-02 10:32:59.165999433 -0700
+@@ -66,15 +66,12 @@
+              namesz + descSize > max_name_size ) {
+             return false;
+         }
+-        name.assign( pData + 3 * sizeof( Elf_Word ), namesz );
++        name.assign( pData + 3 * sizeof( Elf_Word ), namesz - 1);
+         if ( 0 == descSize ) {
+             desc = 0;
+         }
+         else {
+-            int align = sizeof( Elf_Xword );
+-            if ( elf_file.get_class() == ELFCLASS32 ) {
+-                align = sizeof( Elf_Word );
+-            }
++            int align = sizeof( Elf_Word );
+             desc = const_cast<char*> ( pData + 3*sizeof( Elf_Word ) +
+                                        ( ( namesz + align - 1 ) / align ) * align );
+         }

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/3rdparty/elfio-3.1.tar.gz
----------------------------------------------------------------------
diff --git a/3rdparty/elfio-3.1.tar.gz b/3rdparty/elfio-3.1.tar.gz
new file mode 100644
index 0000000..c0e60f3
Binary files /dev/null and b/3rdparty/elfio-3.1.tar.gz differ

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/3rdparty/versions.am
----------------------------------------------------------------------
diff --git a/3rdparty/versions.am b/3rdparty/versions.am
index 203656c..08e47b6 100644
--- a/3rdparty/versions.am
+++ b/3rdparty/versions.am
@@ -20,6 +20,7 @@
 # still need to update version numbers in src/python/setup.py.in too!
 
 BOOST_VERSION = 1.53.0
+ELFIO_VERSION = 3.1
 GLOG_VERSION = 0.3.3
 GMOCK_VERSION = 1.7.0
 GPERFTOOLS_VERSION = 2.5

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 5de1396..7946d1d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -239,6 +239,35 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 DEALINGS IN THE SOFTWARE.
 
+
+======================================================================
+For the ELFIO header files
+(3rdparty/elfio-3.1.tar.gz):
+======================================================================
+
+MIT License
+
+Copyright (C) 2001-2011 by Serge Lamikhov-Center
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
 ======================================================================
 For setuptools-20.9.0 (3rdparty/setuptools-20.9.0.tar.gz):
 ======================================================================

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 321436b..ecc2758 100644
--- a/configure.ac
+++ b/configure.ac
@@ -272,6 +272,13 @@ AC_ARG_WITH([curl],
                            [specify where to locate the curl library]),
             [], [])
 
+AC_ARG_WITH([elfio],
+            AS_HELP_STRING([--with-elfio@<:@=DIR@:>@],
+                           [excludes building and using the bundled ELFIO
+                           package in lieu of an installed version at a
+                           location prefixed by the given path]),
+            [without_bundled_elfio=yes], [])
+
 AC_ARG_WITH([glog],
             AS_HELP_STRING([--with-glog@<:@=DIR@:>@],
                            [excludes building and using the bundled glog
@@ -728,6 +735,34 @@ libcurl is required for mesos to build.
 ])])
 
 
+# If the user has asked not to include the bundled ELFIO headers,
+# check to see if the path to the ELFIO headers has been specified. If
+# it has, make sure that the path is absolute. If everything is in
+# order, add this path to the CPPFLAGS.
+if test "x$without_bundled_elfio" = "xyes" || \
+   test "x$enable_bundled" != "xyes"; then
+  if test -n "`echo $with_elfio`"; then
+    if test "$with_elfio" = "${with_elfio#/}"; then
+      AC_MSG_ERROR([The path passed to --with-elfio must be absolute.])
+    fi
+     CPPFLAGS="-I${with_elfio} $CPPFLAGS"
+  fi
+
+  AC_CHECK_HEADERS([elfio/elfio.h], [],
+                   [AC_MSG_ERROR([Cannot find the ELFIO headers
+-------------------------------------------------------------------
+You have requested the use of a non-bundled ELFIO but no suitable
+ELFIO headers could be found. Make sure these headers are either
+installed on the system or the path passed via --with-elfio is correct.
+-------------------------------------------------------------------
+  ])])
+else
+  with_bundled_elfio=yes
+fi
+
+AM_CONDITIONAL([WITH_BUNDLED_ELFIO], [test "x$with_bundled_elfio" = "xyes"])
+
+
 # Check if glog prefix path was supplied and if so, add it to CPPFLAGS
 # while extending it by /include and to LDFLAGS while extending it by
 # /lib.

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 52d63f2..aefbd1d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,7 @@ ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VE
 LIBPROCESS = 3rdparty/libprocess
 STOUT = 3rdparty/stout
 BOOST = 3rdparty/boost-$(BOOST_VERSION)
+ELFIO = 3rdparty/elfio-$(ELFIO_VERSION)
 GLOG = 3rdparty/glog-$(GLOG_VERSION)
 GMOCK = 3rdparty/gmock-$(GMOCK_VERSION)
 GTEST = $(GMOCK)/gtest
@@ -130,6 +131,10 @@ if WITH_BUNDLED_BOOST
 MESOS_CPPFLAGS += -isystem ../$(BOOST)
 endif
 
+if WITH_BUNDLED_ELFIO
+MESOS_CPPFLAGS += -I../$(ELFIO)
+endif
+
 if WITH_BUNDLED_GLOG
 MESOS_CPPFLAGS += -I../$(GLOG)/src
 LIB_GLOG = ../$(GLOG)/libglog.la

http://git-wip-us.apache.org/repos/asf/mesos/blob/5deb7729/support/coverage.sh
----------------------------------------------------------------------
diff --git a/support/coverage.sh b/support/coverage.sh
index ab9564b..4879b3f 100755
--- a/support/coverage.sh
+++ b/support/coverage.sh
@@ -42,6 +42,7 @@ LCOV_FILTERS+=" build/3rdparty/setuptools-*"
 LCOV_FILTERS+=" build/3rdparty/leveldb*"
 LCOV_FILTERS+=" build/3rdparty/zookeeper-*"
 LCOV_FILTERS+=" */boost-*"
+LCOV_FILTERS+=" */elfio-*"
 LCOV_FILTERS+=" */glog-*"
 LCOV_FILTERS+=" */gmock-*"
 LCOV_FILTERS+=" */picojson-*"


[2/5] mesos git commit: Added ELFIO as bundled dependency in stout.

Posted by bm...@apache.org.
Added ELFIO as bundled dependency in stout.

Review: https://reviews.apache.org/r/49561/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/03496668
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/03496668
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/03496668

Branch: refs/heads/master
Commit: 03496668fde640a38f3eddff8bea65c8b1344be0
Parents: 4d24651
Author: Kevin Klues <kl...@gmail.com>
Authored: Sat Jul 2 13:54:45 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Sat Jul 2 14:46:58 2016 -0700

----------------------------------------------------------------------
 3rdparty/stout/Makefile.am                |  6 +++++
 3rdparty/stout/cmake/StoutConfigure.cmake |  2 ++
 3rdparty/stout/configure.ac               | 35 ++++++++++++++++++++++++++
 3 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/03496668/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/stout/Makefile.am b/3rdparty/stout/Makefile.am
index eeaca48..6769130 100644
--- a/3rdparty/stout/Makefile.am
+++ b/3rdparty/stout/Makefile.am
@@ -22,6 +22,7 @@ SUBDIRS = . include
 include ../versions.am
 
 BOOST = ../boost-$(BOOST_VERSION)
+ELFIO = ../elfio-$(ELFIO_VERSION)
 GLOG = ../glog-$(GLOG_VERSION)
 GMOCK = ../gmock-$(GMOCK_VERSION)
 GTEST = $(GMOCK)/gtest
@@ -35,6 +36,10 @@ if WITH_BUNDLED_BOOST
 BOOST_INCLUDE_FLAGS = -isystem $(BOOST)
 endif
 
+if WITH_BUNDLED_ELFIO
+ELFIO_INCLUDE_FLAGS = -I$(ELFIO)
+endif
+
 if WITH_BUNDLED_GLOG
 GLOG_INCLUDE_FLAGS = -I$(GLOG)/src
 LIB_GLOG = $(GLOG)/libglog.la
@@ -128,6 +133,7 @@ endif
 stout_tests_CPPFLAGS =			\
   -I$(srcdir)/include			\
   $(BOOST_INCLUDE_FLAGS)		\
+  $(ELFIO_INCLUDE_FLAGS)		\
   $(GLOG_INCLUDE_FLAGS)			\
   $(GMOCK_INCLUDE_FLAGS)		\
   $(GTEST_INCLUDE_FLAGS)		\

http://git-wip-us.apache.org/repos/asf/mesos/blob/03496668/3rdparty/stout/cmake/StoutConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutConfigure.cmake b/3rdparty/stout/cmake/StoutConfigure.cmake
index e4e3217..7e483aa 100644
--- a/3rdparty/stout/cmake/StoutConfigure.cmake
+++ b/3rdparty/stout/cmake/StoutConfigure.cmake
@@ -33,6 +33,7 @@ endif (NOT WIN32)
 set(STOUT_DEPENDENCIES
   ${STOUT_DEPENDENCIES}
   ${BOOST_TARGET}
+  ${ELFIO_TARGET}
   ${GLOG_TARGET}
   ${NVML_TARGET}
   ${PROTOBUF_TARGET}
@@ -55,6 +56,7 @@ set(STOUT_INCLUDE_DIRS
   ${STOUT_INCLUDE_DIR}
   ${APR_INCLUDE_DIR}
   ${BOOST_INCLUDE_DIR}
+  ${ELFIO_INCLUDE_DIR}
   ${GLOG_INCLUDE_DIR}
   ${NVML_INCLUDE_DIR}
   ${PICOJSON_INCLUDE_DIR}

http://git-wip-us.apache.org/repos/asf/mesos/blob/03496668/3rdparty/stout/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/stout/configure.ac b/3rdparty/stout/configure.ac
index ca6f041..dab005b 100644
--- a/3rdparty/stout/configure.ac
+++ b/3rdparty/stout/configure.ac
@@ -102,6 +102,13 @@ AC_ARG_WITH([boost],
                            location prefixed by the given path]),
             [without_bundled_boost=yes], [])
 
+AC_ARG_WITH([elfio],
+            AS_HELP_STRING([--with-elfio@<:@=DIR@:>@],
+                           [excludes building and using the bundled ELFIO
+                           package in lieu of an installed version at a
+                           location prefixed by the given path]),
+            [without_bundled_elfio=yes], [])
+
 AC_ARG_WITH([glog],
             AS_HELP_STRING([--with-glog@<:@=DIR@:>@],
                            [excludes building and using the bundled glog
@@ -281,6 +288,34 @@ fi
 AM_CONDITIONAL([WITH_BUNDLED_BOOST], [test "x$with_bundled_boost" = "xyes"])
 
 
+# If the user has asked not to include the bundled ELFIO headers,
+# check to see if the path to the ELFIO headers has been specified. If
+# it has, make sure that the path is absolute. If everything is in
+# order, add this path to the CPPFLAGS.
+if test "x$without_bundled_elfio" = "xyes" || \
+   test "x$enable_bundled" != "xyes"; then
+  if test -n "`echo $with_elfio`"; then
+    if test "$with_elfio" = "${with_elfio#/}"; then
+      AC_MSG_ERROR([The path passed to --with-elfio must be absolute.])
+    fi
+     CPPFLAGS="-I${with_elfio} $CPPFLAGS"
+  fi
+
+  AC_CHECK_HEADERS([elfio/elfio.h], [],
+                   [AC_MSG_ERROR([Cannot find the ELFIO headers
+-------------------------------------------------------------------
+You have requested the use of a non-bundled ELFIO but no suitable
+ELFIO headers could be found. Make sure these headers are either
+installed on the system or the path passed via --with-elfio is correct.
+-------------------------------------------------------------------
+  ])])
+else
+  with_bundled_elfio=yes
+fi
+
+AM_CONDITIONAL([WITH_BUNDLED_ELFIO], [test "x$with_bundled_elfio" = "xyes"])
+
+
 # Include directories used by package managers (e.g., MacPorts).
 if test "x$enable_bundled" != "xyes" && \
    test "x$OS_NAME" = "xdarwin"; then


[4/5] mesos git commit: Re-implemented the stout ELF abstraction in terms of ELFIO.

Posted by bm...@apache.org.
Re-implemented the stout ELF abstraction in terms of ELFIO.

As part of this, we updated the API to include functions written in
snake_case (as is standard for stout). We also removed the 'close()'
call, as the new ELFIO library doesn't require it (as it loads the
file into memory!).

Review: https://reviews.apache.org/r/49562/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4e2bbdd8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4e2bbdd8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4e2bbdd8

Branch: refs/heads/master
Commit: 4e2bbdd8f11cd31e0d5218aeb7079a55a9306681
Parents: 0349666
Author: Kevin Klues <kl...@gmail.com>
Authored: Sat Jul 2 13:55:23 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Sat Jul 2 14:46:58 2016 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/elf.hpp | 202 ++++++++----------------------
 1 file changed, 51 insertions(+), 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4e2bbdd8/3rdparty/stout/include/stout/elf.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/elf.hpp b/3rdparty/stout/include/stout/elf.hpp
index 5382acc..67d8962 100644
--- a/3rdparty/stout/include/stout/elf.hpp
+++ b/3rdparty/stout/include/stout/elf.hpp
@@ -17,218 +17,118 @@
 #ifndef __STOUT_ELF_HPP__
 #define __STOUT_ELF_HPP__
 
-#include <fcntl.h>
-#include <gelf.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <unistd.h>
-
 #include <map>
 #include <string>
 #include <vector>
 
+#include <elfio/elfio.hpp>
+
 #include <stout/error.hpp>
 #include <stout/foreach.hpp>
-#include <stout/nothing.hpp>
-#include <stout/option.hpp>
-#include <stout/stringify.hpp>
 #include <stout/try.hpp>
 
 namespace elf {
 
-enum Class {
+enum Class
+{
   CLASSNONE = ELFCLASSNONE,
   CLASS32 = ELFCLASS32,
   CLASS64 = ELFCLASS64,
 };
 
-enum class SectionType {
+enum class SectionType
+{
   DYNAMIC = SHT_DYNAMIC,
 };
 
-enum class DynamicTag {
+enum class DynamicTag
+{
   STRTAB = DT_STRTAB,
   SONAME = DT_SONAME,
   NEEDED = DT_NEEDED,
 };
 
+
 // This class is used to represent the contents of a standard ELF
 // binary. The current implementation is incomplete.
 //
-// TODO(klueska): For now, we only include functionality to extract
-// the SONAME from shared libraries and read their external library
-// dependencies. In the future, we will expand this class to include
-// helpers for full access to an ELF file's contents.
-class File {
+// NOTE: We use ELFIO under the hood to do our elf parsing for us.
+// Unfortunately, ELFIO reads the *entire* elf file into memory when
+// it is first loaded instead of relying on something like `mmap` to
+// only page in the parts of the file we are interested in. If this
+// becomes a problem, we will have to use something like `libelf`
+// instead (but note that libelf is not header-only and will
+// therefore introduce a runtime library dependency).
+class File
+{
 public:
-  // Open an ELF binary. We do some preliminary parsing as part of
-  // opening the ELF to get quick references to all of its internal
-  // sections for all future calls.
-  //
-  // TODO(klueska): Consider adding a 'stout::Owned' type to avoid
-  // returning a raw pointer here.
-  static Try<File*> open(const std::string& path)
+  // TODO(klueska): Return a unique_ptr here.
+  static Try<File*> load(const std::string& path)
   {
-    // Set the elf library operating version.
-    if (elf_version(EV_CURRENT) == EV_NONE) {
-      return Error("Failed to set ELF library version: " +
-                   stringify(elf_errmsg(-1)));
-    }
-
     File* file = new File();
 
-    file->fd = ::open(path.c_str(), O_RDONLY);
-    if (file->fd < 0) {
+    if (!file->elf.load(path.c_str())) {
       delete file;
-      return ErrnoError("Failed to open file");
+      return Error("Unknown error during elfio::load");
     }
 
-    file->elf = elf_begin(file->fd, ELF_C_READ, nullptr);
-    if (file->elf == nullptr) {
-      delete file;
-      return Error("elf_begin() failed: " + stringify(elf_errmsg(-1)));
-    }
-
-    if (elf_kind(file->elf) != ELF_K_ELF) {
-      delete file;
-      return Error("File is not an ELF binary");
-    }
-
-    // Create the mapping from section type to section locations.
-    Elf_Scn* section = nullptr;
-    while ((section = elf_nextscn(file->elf, section)) != nullptr) {
-      GElf_Shdr section_header;
-      if (gelf_getshdr(section, &section_header) == nullptr) {
-        delete file;
-        return Error("gelf_getshdr() failed: " + stringify(elf_errmsg(-1)));
-      }
-
-      SectionType section_type = (SectionType) section_header.sh_type;
-      switch (section_type) {
-        case SectionType::DYNAMIC:
-          file->sections[section_type].push_back(section);
-      }
+    // Create the mapping from section type to sections.
+    foreach (ELFIO::section* section, file->elf.sections) {
+      SectionType section_type = (SectionType) section->get_type();
+      file->sections_by_type[section_type].push_back(section);
     }
 
     return file;
   }
 
-  void close()
-  {
-    if (elf != nullptr) {
-      elf_end(elf);
-      elf = nullptr;
-    }
-
-    if (fd >= 0) {
-      ::close(fd);
-      fd = -1;
-    }
-  }
-
-  ~File()
-  {
-    close();
-  };
-
-
-  // Returns the ELF class of an
-  // ELF file (CLASS32, or CLASS64).
-  Try<Class> GetClass() const
+  // Returns the ELF class of an ELF file (CLASS32, or CLASS64).
+  Try<Class> get_class() const
   {
-    Class c = (Class)gelf_getclass(elf);
+    Class c = Class(elf.get_class());
     if (c == CLASSNONE) {
-      return Error("gelf_getclass() failed: " + stringify(elf_errmsg(-1)));
+      return Error("Unknown error");
     }
     return c;
   }
 
 
-  // Extract the strings associated with the provided `DynamicTag`
-  // from the DYNAMIC section of the ELF binary.
-  Try<std::vector<std::string>> GetDynamicStrings(DynamicTag tag) const
+  // Extract the strings associated with the provided
+  // `DynamicTag` from all DYNAMIC sections in the ELF binary.
+  Try<std::vector<std::string>> get_dynamic_strings(DynamicTag tag) const
   {
-    if (sections.count(SectionType::DYNAMIC) == 0) {
+    if (sections_by_type.count(SectionType::DYNAMIC) == 0) {
       return Error("No DYNAMIC sections found in ELF");
     }
 
-    if (sections.count(SectionType::DYNAMIC) != 1) {
-      return Error("Multiple DYNAMIC sections found in ELF");
-    }
-
-    Elf_Scn* dynamic_section = sections.at(SectionType::DYNAMIC)[0];
-
-    // Walk through the entries in the dynamic section and look for
-    // entries with the provided tag. These entries contain offsets to
-    // strings in the dynamic section's string table. Consequently, we
-    // also have to look for an entry containing a pointer to the
-    // dynamic section's string table so we can resolve the strings
-    // associated with the provided tag later on.
-    Elf_Data* dynamic_data = elf_getdata(dynamic_section, nullptr);
-    if (dynamic_data == nullptr) {
-      return Error("elf_getdata() failed: " + stringify(elf_errmsg(-1)));
-    }
-
-    Option<uintptr_t> strtab_pointer = None();
-    std::vector<uintptr_t> strtab_offsets;
-
-    for (size_t i = 0; i < dynamic_data->d_size / sizeof(GElf_Dyn); i++) {
-      GElf_Dyn entry;
-      if (gelf_getdyn(dynamic_data, i, &entry) == nullptr) {
-          return Error("gelf_getdyn() failed: " + stringify(elf_errmsg(-1)));
-      }
-
-      if ((DynamicTag)entry.d_tag == DynamicTag::STRTAB) {
-        strtab_pointer = entry.d_un.d_ptr;
-      }
-
-      if ((DynamicTag)entry.d_tag == tag) {
-        strtab_offsets.push_back(entry.d_un.d_ptr);
-      }
-    }
-
-    if (strtab_offsets.empty()) {
-      return std::vector<std::string>();
-    }
+    std::vector<std::string> strings;
 
-    if (strtab_pointer.isNone()) {
-      return Error("Failed to find string table");
-    }
+    foreach (ELFIO::section* section,
+             sections_by_type.at(SectionType::DYNAMIC)) {
+      auto accessor = ELFIO::dynamic_section_accessor(elf, section);
 
-    // Get a reference to the actual string table so we can index into it.
-    Elf_Scn* string_table_section = gelf_offscn(elf, strtab_pointer.get());
-    if (string_table_section == nullptr) {
-      return Error("gelf_offscn() failed: " + stringify(elf_errmsg(-1)));
-    }
+      for (ELFIO::Elf_Xword i = 0; i < accessor.get_entries_num(); ++i) {
+        ELFIO::Elf_Xword entry_tag;
+        ELFIO::Elf_Xword entry_value;
+        std::string entry_string;
 
-    size_t strtab_index = elf_ndxscn(string_table_section);
-    if (strtab_index == SHN_UNDEF) {
-      return Error("elf_ndxscn() failed: " + stringify(elf_errmsg(-1)));
-    }
+        if (!accessor.get_entry(i, entry_tag, entry_value, entry_string)) {
+          return Error("Failed to get entry from DYNAMIC section of elf");
+        }
 
-    // Find the strings in the string table from their offsets and return them.
-    std::vector<std::string> strings;
-    foreach (uintptr_t offset, strtab_offsets) {
-      char* string = elf_strptr(elf, strtab_index, offset);
-      if (string == nullptr) {
-        return Error("elf_strptr() failed: " + stringify(elf_errmsg(-1)));
+        if (tag == DynamicTag(entry_tag)) {
+          strings.push_back(entry_string);
+        }
       }
-
-      strings.push_back(string);
     }
 
     return strings;
   }
 
 private:
-  explicit File()
-    : fd(-1),
-      elf(nullptr) {}
+  explicit File() {}
 
-  int fd;
-  Elf* elf;
-  std::map<SectionType, std::vector<Elf_Scn*>> sections;
+  ELFIO::elfio elf;
+  std::map<SectionType, std::vector<ELFIO::section*>> sections_by_type;
 };
 
 } // namespace elf {


[5/5] mesos git commit: Reimplemented ldcache_test.cpp using the new ELF abstraction in stout.

Posted by bm...@apache.org.
Reimplemented ldcache_test.cpp using the new ELF abstraction in stout.

We also reenabled this test to run as part of the standard Linux test
suite. It had been disabled due to its dependence on the external
libelf library. Now that we bundle ELFIO instead of relying on this
external dependence, we can always have it enabled now.

Review: https://reviews.apache.org/r/49563/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8912a7ba
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8912a7ba
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8912a7ba

Branch: refs/heads/master
Commit: 8912a7ba285e556aaa7058bd872b71bb6400fd7d
Parents: 4e2bbdd
Author: Kevin Klues <kl...@gmail.com>
Authored: Sat Jul 2 14:48:22 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Sat Jul 2 14:48:22 2016 -0700

----------------------------------------------------------------------
 src/Makefile.am             |  1 +
 src/tests/ldcache_tests.cpp | 14 ++++++--------
 2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8912a7ba/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index aefbd1d..53f21cc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2160,6 +2160,7 @@ mesos_tests_DEPENDENCIES =					\
 
 if OS_LINUX
 mesos_tests_SOURCES +=						\
+  tests/ldcache_tests.cpp					\
   tests/containerizer/cgroups_isolator_tests.cpp		\
   tests/containerizer/cgroups_tests.cpp				\
   tests/containerizer/cni_isolator_tests.cpp			\

http://git-wip-us.apache.org/repos/asf/mesos/blob/8912a7ba/src/tests/ldcache_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/ldcache_tests.cpp b/src/tests/ldcache_tests.cpp
index b387a8b..8e24e94 100644
--- a/src/tests/ldcache_tests.cpp
+++ b/src/tests/ldcache_tests.cpp
@@ -44,26 +44,24 @@ TEST(LdcacheTest, Parse)
   ASSERT_GT(cache->size(), 1u);
 
   foreach (const ldcache::Entry& entry, cache.get()) {
-    Try<elf::File*> open = elf::File::open(entry.path);
-    ASSERT_SOME(open);
+    Try<elf::File*> load = elf::File::load(entry.path);
+    ASSERT_SOME(load);
 
-    Owned<elf::File> file(open.get());
+    Owned<elf::File> file(load.get());
 
-    Try<elf::Class> c = file->GetClass();
+    Try<elf::Class> c = file->get_class();
     ASSERT_SOME(c);
     ASSERT_TRUE(c.get() == elf::CLASS32 || c.get() == elf::CLASS64);
 
     Try<vector<string>> soname =
-      file->GetDynamicStrings(elf::DynamicTag::SONAME);
+      file->get_dynamic_strings(elf::DynamicTag::SONAME);
     ASSERT_SOME(soname);
     ASSERT_LE(soname->size(), 1u);
 
     Try<vector<string>> needed =
-      file->GetDynamicStrings(elf::DynamicTag::NEEDED);
+      file->get_dynamic_strings(elf::DynamicTag::NEEDED);
     ASSERT_SOME(needed);
     ASSERT_LE(needed->size(), cache->size());
-
-    file->close();
   }
 }
 


[3/5] mesos git commit: Added ELFIO as bundled dependency in libprocess.

Posted by bm...@apache.org.
Added ELFIO as bundled dependency in libprocess.

Review: https://reviews.apache.org/r/49560/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4d24651c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4d24651c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4d24651c

Branch: refs/heads/master
Commit: 4d24651cf1493a93e97f73e9df9b02d77e8fd097
Parents: 5deb772
Author: Kevin Klues <kl...@gmail.com>
Authored: Sat Jul 2 13:48:27 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Sat Jul 2 14:46:58 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/Makefile.am                 |  6 ++++
 .../cmake/Process3rdpartyConfigure.cmake        |  2 ++
 3rdparty/libprocess/configure.ac                | 35 ++++++++++++++++++++
 3 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4d24651c/3rdparty/libprocess/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/Makefile.am b/3rdparty/libprocess/Makefile.am
index 41bd8f4..05499a8 100644
--- a/3rdparty/libprocess/Makefile.am
+++ b/3rdparty/libprocess/Makefile.am
@@ -27,6 +27,7 @@ include ../versions.am
 
 STOUT = ../stout
 BOOST = ../boost-$(BOOST_VERSION)
+ELFIO = ../elfio-$(ELFIO_VERSION)
 GLOG = ../glog-$(GLOG_VERSION)
 GMOCK = ../gmock-$(GMOCK_VERSION)
 GPERFTOOLS = ../gperftools-$(GPERFTOOLS_VERSION)
@@ -39,6 +40,10 @@ if WITH_BUNDLED_BOOST
 BOOST_INCLUDE_FLAGS = -isystem $(BOOST)
 endif
 
+if WITH_BUNDLED_ELFIO
+ELFIO_INCLUDE_FLAGS = -I$(ELFIO)
+endif
+
 if WITH_BUNDLED_GLOG
 GLOG_INCLUDE_FLAGS = -I$(GLOG)/src
 LIB_GLOG = $(GLOG)/libglog.la
@@ -139,6 +144,7 @@ libprocess_la_CPPFLAGS =			\
   -DBUILD_DIR=\"$(LIBPROCESS_BUILD_DIR)\"	\
   -I$(srcdir)/include				\
   $(BOOST_INCLUDE_FLAGS)			\
+  $(ELFIO_INCLUDE_FLAGS)			\
   $(GLOG_INCLUDE_FLAGS)				\
   $(GPERFTOOLS_INCLUDE_FLAGS)			\
   $(HTTP_PARSER_INCLUDE_FLAGS)			\

http://git-wip-us.apache.org/repos/asf/mesos/blob/4d24651c/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
index fa84e7c..d34ea40 100644
--- a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -19,6 +19,7 @@
 set(STOUT ${MESOS_3RDPARTY_SRC}/stout)
 
 EXTERNAL("boost"       ${BOOST_VERSION}       "${MESOS_3RDPARTY_BIN}")
+EXTERNAL("elfio"       ${ELFIO_VERSION}       "${MESOS_3RDPARTY_BIN}")
 EXTERNAL("picojson"    ${PICOJSON_VERSION}    "${MESOS_3RDPARTY_BIN}")
 EXTERNAL("http_parser" ${HTTP_PARSER_VERSION} "${MESOS_3RDPARTY_BIN}")
 EXTERNAL("libev"       ${LIBEV_VERSION}       "${MESOS_3RDPARTY_BIN}")
@@ -53,6 +54,7 @@ set(PROCESS_INCLUDE_DIR     ${MESOS_3RDPARTY_SRC}/libprocess/include)
 set(STOUT_INCLUDE_DIR       ${STOUT}/include)
 
 set(BOOST_INCLUDE_DIR       ${BOOST_ROOT})
+set(ELFIO_INCLUDE_DIR       ${ELFIO_ROOT})
 set(GPERFTOOLS_INCLUDE_DIR  ${GPERFTOOLS}/src)
 set(HTTP_PARSER_INCLUDE_DIR ${HTTP_PARSER_ROOT})
 set(LIBEV_INCLUDE_DIR       ${LIBEV_ROOT})

http://git-wip-us.apache.org/repos/asf/mesos/blob/4d24651c/3rdparty/libprocess/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/configure.ac b/3rdparty/libprocess/configure.ac
index 41f4537..f5ed6c8 100644
--- a/3rdparty/libprocess/configure.ac
+++ b/3rdparty/libprocess/configure.ac
@@ -140,6 +140,13 @@ AC_ARG_WITH([curl],
                            [specify where to locate the curl library]),
             [], [])
 
+AC_ARG_WITH([elfio],
+            AS_HELP_STRING([--with-elfio@<:@=DIR@:>@],
+                           [excludes building and using the bundled ELFIO
+                           package in lieu of an installed version at a
+                           location prefixed by the given path]),
+            [without_bundled_elfio=yes], [])
+
 AC_ARG_WITH([glog],
             AS_HELP_STRING([--with-glog@<:@=DIR@:>@],
                            [excludes building and using the bundled glog
@@ -489,6 +496,34 @@ libcurl is required for libprocess to build.
 ])])
 
 
+# If the user has asked not to include the bundled ELFIO headers,
+# check to see if the path to the ELFIO headers has been specified. If
+# it has, make sure that the path is absolute. If everything is in
+# order, add this path to the CPPFLAGS.
+if test "x$without_bundled_elfio" = "xyes" || \
+   test "x$enable_bundled" != "xyes"; then
+  if test -n "`echo $with_elfio`"; then
+    if test "$with_elfio" = "${with_elfio#/}"; then
+      AC_MSG_ERROR([The path passed to --with-elfio must be absolute.])
+    fi
+     CPPFLAGS="-I${with_elfio} $CPPFLAGS"
+  fi
+
+  AC_CHECK_HEADERS([elfio/elfio.h], [],
+                   [AC_MSG_ERROR([Cannot find the ELFIO headers
+-------------------------------------------------------------------
+You have requested the use of a non-bundled ELFIO but no suitable
+ELFIO headers could be found. Make sure these headers are either
+installed on the system or the path passed via --with-elfio is correct.
+-------------------------------------------------------------------
+  ])])
+else
+  with_bundled_elfio=yes
+fi
+
+AM_CONDITIONAL([WITH_BUNDLED_ELFIO], [test "x$with_bundled_elfio" = "xyes"])
+
+
 if test -n "`echo $with_glog`"; then
   CPPFLAGS="$CPPFLAGS -I${with_glog}/include"
   LDFLAGS="$LDFLAGS -L${with_glog}/lib"