koolhazz / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Missing pthread.h include in static_vars.cc blocks compilation on Mac OS 10.9 #583

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
./configure
make -j 4

What is the expected output? What do you see instead?
Compilation fails due to missing decl for pthread_atfork

What version of the product are you using? On what operating system?
2.1, Mac OS 10.9.

Please provide any additional information below.

Original issue reported on code.google.com by drus...@gmail.com on 25 Oct 2013 at 8:07

GoogleCodeExporter commented 9 years ago
Please contribute a patch. Which should be straightforward. I don't have access 
to osx 10.9 box.

Original comment by alkondratenko on 25 Oct 2013 at 8:16

GoogleCodeExporter commented 9 years ago
diff gperftools-2.1/src/static_vars.cc 
gperftools-2.1.patched/src/static_vars.cc --unified
--- gperftools-2.1/src/static_vars.cc   2013-07-30 02:12:11.000000000 -0700
+++ gperftools-2.1.patched/src/static_vars.cc   2013-10-25 12:54:21.000000000 
-0700
@@ -37,6 +37,7 @@
 #include "common.h"
 #include "sampler.h"           // for Sampler
 #include "base/googleinit.h"
+#include <pthread.h>

 namespace tcmalloc {

Original comment by drus...@gmail.com on 25 Oct 2013 at 8:58

GoogleCodeExporter commented 9 years ago
May I ask you to try that patch on latest master ?

Original comment by alkondratenko on 25 Oct 2013 at 9:00

GoogleCodeExporter commented 9 years ago
I get:
drussel@drmbp:gperftools> ./autogen.sh                 
Can't exec "aclocal": No such file or directory at 
/usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory

when I try to generate the config scripts.

Original comment by drus...@gmail.com on 25 Oct 2013 at 9:34

GoogleCodeExporter commented 9 years ago
A slightly cleaner patch (against master)
diff --git a/src/static_vars.cc b/src/static_vars.cc
index 013027d..81e8a79 100644
--- a/src/static_vars.cc
+++ b/src/static_vars.cc
@@ -32,6 +32,7 @@
 // Author: Ken Ashcraft <opensource@google.com>

 #include "static_vars.h"
+#include <pthread.h>                    // for pthread_atfork
 #include <stddef.h>                     // for NULL
 #include <new>                          // for operator new
 #include "internal_logging.h"  // for CHECK_CONDITION

Original comment by drus...@gmail.com on 25 Oct 2013 at 9:34

GoogleCodeExporter commented 9 years ago
>> I get:
>> drussel@drmbp:gperftools> ./autogen.sh                 
>> Can't exec "aclocal": No such file or directory at >> 
/usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
>> autoreconf: failed to run aclocal: No such file or directory

that appears to indicate that automake is missing. You will also need libtool

Original comment by alkondratenko on 25 Oct 2013 at 9:51

GoogleCodeExporter commented 9 years ago
Thanks, I had forgotten that one of the three (I'm in the middle of installing 
things on the machine). 

For master, the second patch above compiles (I did not check the first), 
without the patch does not.

Original comment by drus...@gmail.com on 25 Oct 2013 at 10:06

GoogleCodeExporter commented 9 years ago
Thanks. Will apply tomorrow

Original comment by alkondratenko on 25 Oct 2013 at 10:07

GoogleCodeExporter commented 9 years ago
merged. Thanks.

Original comment by alkondratenko on 27 Oct 2013 at 12:00