mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ne...@apache.org
Subject mesos git commit: Added workaround to unbreak the build with glibc <= 2.12.
Date Wed, 10 May 2017 21:19:04 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 17baccf84 -> f0d24c762


Added workaround to unbreak the build with glibc <= 2.12.

In old versions of glibc, the <sys/sysmacros.h> header must be enclosed
in an `extern "C" { ... }` block. This prevents Mesos from linking on
CentOS 6.9 and likely other platforms from the same timeframe.

In more recent versions of glibc, the `extern "C" { ... }` linkage
declaration is not necessary (because the header file specifies this
itself). In this situation, there will now be two linkage declarations,
but that is fine: the inner-most linkage declaration takes precedence.

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


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

Branch: refs/heads/master
Commit: f0d24c76288b9293ebbb1417f93e8a3a074d32a6
Parents: 17baccf
Author: Neil Conway <neil.conway@gmail.com>
Authored: Wed May 10 11:06:24 2017 -0700
Committer: Neil Conway <neil.conway@gmail.com>
Committed: Wed May 10 14:18:29 2017 -0700

----------------------------------------------------------------------
 src/linux/fs.cpp                                              | 6 ++++++
 .../mesos/isolators/cgroups/subsystems/devices.cpp            | 7 +++++++
 src/slave/containerizer/mesos/isolators/gpu/isolator.cpp      | 6 ++++++
 src/tests/containerizer/fs_tests.cpp                          | 6 ++++++
 4 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f0d24c76/src/linux/fs.cpp
----------------------------------------------------------------------
diff --git a/src/linux/fs.cpp b/src/linux/fs.cpp
index 944509f..40c31a3 100644
--- a/src/linux/fs.cpp
+++ b/src/linux/fs.cpp
@@ -23,7 +23,13 @@
 #include <linux/limits.h>
 #include <linux/unistd.h>
 
+// This header include must be enclosed in an `extern "C"` block to
+// workaround a bug in glibc <= 2.12 (see MESOS-7378).
+//
+// TODO(neilc): Remove this when we no longer support glibc <= 2.12.
+extern "C" {
 #include <sys/sysmacros.h>
+}
 
 #include <list>
 #include <set>

http://git-wip-us.apache.org/repos/asf/mesos/blob/f0d24c76/src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp
index e995ff4..ddf2a4d 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp
@@ -15,7 +15,14 @@
 // limitations under the License.
 
 #include <sys/stat.h>
+
+// This header include must be enclosed in an `extern "C"` block to
+// workaround a bug in glibc <= 2.12 (see MESOS-7378).
+//
+// TODO(neilc): Remove this when we no longer support glibc <= 2.12.
+extern "C" {
 #include <sys/sysmacros.h>
+}
 
 #include <process/id.hpp>
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/f0d24c76/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp b/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
index 3fd1495..25636b5 100644
--- a/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
@@ -16,7 +16,13 @@
 
 #include <stdint.h>
 
+// This header include must be enclosed in an `extern "C"` block to
+// workaround a bug in glibc <= 2.12 (see MESOS-7378).
+//
+// TODO(neilc): Remove this when we no longer support glibc <= 2.12.
+extern "C" {
 #include <sys/sysmacros.h>
+}
 
 #include <algorithm>
 #include <list>

http://git-wip-us.apache.org/repos/asf/mesos/blob/f0d24c76/src/tests/containerizer/fs_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/fs_tests.cpp b/src/tests/containerizer/fs_tests.cpp
index 0fa9451..1022b82 100644
--- a/src/tests/containerizer/fs_tests.cpp
+++ b/src/tests/containerizer/fs_tests.cpp
@@ -18,7 +18,13 @@
 
 #include <gmock/gmock.h>
 
+// This header include must be enclosed in an `extern "C"` block to
+// workaround a bug in glibc <= 2.12 (see MESOS-7378).
+//
+// TODO(neilc): Remove this when we no longer support glibc <= 2.12.
+extern "C" {
 #include <sys/sysmacros.h>
+}
 
 #include <stout/foreach.hpp>
 #include <stout/gtest.hpp>


Mime
View raw message