title: Enabling jemalloc in Tensorflow 1.0.1 causes XLA tests to fail
body: <p>We are using Tensorflow 1.0.1 on Ubuntu 16.04 Linux ppc64le. We've enabled jemalloc and experimental XLA support. While running bazel test //tensorflow/compiler/... to check XLA support on ppc64le, we found that all the tests are being skipped with "NO STATUS" and with below linker error </p>
  
  <pre><code>usr/bin/ld: bazel-out/local-opt/bin/tensorflow/compiler/aot/codegen_test: hidden symbol 'pthread_atfork' in
        /usr/lib/powerpc64le-linux-gnu/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO
  </code></pre>
  
  <p>Even I tried running a single test like bazel test //tensorflow/compiler/aot:codegen_test and got the same linker error. Only tfcompile_util_test is passing.</p>
  
  <p>Leaving this error, one weird observation I've is, disabling jemalloc makes most of the XLA tests pass. Approximately 70-80% of the total XLA tests passed for me if we disable jemalloc. Rest of the tests still fail with some seg fault. 
  Not sure if jemalloc and XLA are related. Could anyone please confirm if they are related and my observation is possible to hold good? </p>
  
  <p>For above linking error, I read that it's a glibc's bug on ppc64le that does not export dynamic version of pthread_atfork which x86's glibc does but by fluke. And the solution is we add -lpthread in the linking options. Somehow, adding -lpthread as a linkopts in any of .bzl file or BUILD file in tensorflow/compiler is not working. -lpthread does not even appear in the linking command. Any pointers on this error will also be helpful. Kindly help us on this problem.</p>
  
  <p>Thanks,
  Nishidha</p>