]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
TSAN: avoid new link failure with -pg v3.10
authorJim Meyering <meyering@fb.com>
Wed, 25 Mar 2015 21:40:41 +0000 (14:40 -0700)
committerJim Meyering <meyering@fb.com>
Wed, 25 Mar 2015 21:40:41 +0000 (14:40 -0700)
commitff1ff7c62460f5d019f20997ef2a37191b7a5276
tree040c26fc9b737b6598065c1429491de0c5837a0c
parent39d508e34cfc203552b4a15e4ec78035edb5cea5
TSAN: avoid new link failure with -pg

Summary:
* Makefile (COMPILE_WITH_TSAN): Avoid a link failure by disabling
-pg when building with TSAN enabled.
Now that "make check" builds all $(PROGRAMS), it is linking
a few programs that were not normally linked before.
For example, this would fail to link with the following diagnostic:

  COMPILE_WITH_TSAN=1 make -j40 log_and_apply_bench

    CCLD     log_and_apply_bench
  ld: /usr/lib/../lib64/gcrt1.o: relocation R_X86_64_32S against `__libc_csu_fini' can not be used when making a shared object; recompile with -fPIC
  /usr/lib/../lib64/gcrt1.o: error adding symbols: Bad value
  collect2: error: ld returned 1 exit status
  Makefile:511: recipe for target 'log_and_apply_bench' failed
  make: *** [log_and_apply_bench] Error 1

Since removing -pg is sufficient to get past this link
failure, and no one cares about profiling TSAN-enabled
binaries anyway, we will refrain from linking with -pg
when TSAN testing is enabled.  Use a new variable, "pg"
which is set to "-pg" in most cases, but that is made
empty when COMPILE_WITH_TSAN is set.

Test Plan:
  Now, this succeeds:

    rm -f log_and_apply_bench
    COMPILE_WITH_TSAN=1 make -j40 log_and_apply_bench

Reviewers: igor.sugak, rven, sdong, ljin, igor

Reviewed By: igor

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D35943
Makefile