summary refs log tree commit diff
path: root/pkgs/development/libraries/protobuf
diff options
context:
space:
mode:
authorCharles Strahan <charles@cstrahan.com>2016-12-28 00:19:51 -0500
committerCharles Strahan <charles@cstrahan.com>2016-12-29 20:09:46 -0500
commit7ebcada02028e5ce8199cc123fda6aa1aba72e64 (patch)
treefc4a4c2c31aeddf0625593ee5be48caa30741d4f /pkgs/development/libraries/protobuf
parentda70d3da0f11b22eac77756b39b349215e06b2e3 (diff)
downloadnixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.tar
nixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.tar.gz
nixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.tar.bz2
nixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.tar.lz
nixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.tar.xz
nixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.tar.zst
nixpkgs-7ebcada02028e5ce8199cc123fda6aa1aba72e64.zip
mesos: 1.0.1 -> 1.1.0
Diffstat (limited to 'pkgs/development/libraries/protobuf')
-rw-r--r--pkgs/development/libraries/protobuf/generic.nix22
1 files changed, 21 insertions, 1 deletions
diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix
index 47f66c83ff5..2e962298550 100644
--- a/pkgs/development/libraries/protobuf/generic.nix
+++ b/pkgs/development/libraries/protobuf/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, src
+{ stdenv, lib, version, src
 , autoreconfHook, zlib, gtest
 , ...
 }:
@@ -21,6 +21,26 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ autoreconfHook zlib ];
 
+  # The generated C++ code uses static initializers which mutate a global data
+  # structure. This causes problems for an executable when:
+  #
+  # 1) it dynamically links to two libs, both of which contain generated C++ for
+  #    the same proto file, and
+  # 2) the two aforementioned libs both dynamically link to libprotobuf.
+  #
+  # One solution is to statically link libprotobuf, that way the global
+  # variables are not shared; in fact, this is necessary for the python Mesos
+  # binding to not crash, as the python lib contains two C extensions which
+  # both refer to the same proto schema.
+  #
+  # See: https://github.com/NixOS/nixpkgs/pull/19064#issuecomment-255082684
+  #      https://github.com/google/protobuf/issues/1489
+  dontDisableStatic = true;
+  configureFlags = [
+    "CFLAGS=-fPIC"
+    "CXXFLAGS=-fPIC"
+  ];
+
   doCheck = true;
 
   meta = {