Package: libgtest-dev
Version: 1.7.0-3
Severity: normal

Dear Maintainer,

Current libgtest-dev has two different means to determine if
GTEST_HAS_PTHREAD is defined: one in CMake rules [1] and second one in
the header [2]. When they don't match [3], the static library and the
client code might be compiled with different "value" of this define.
This, in turn, leads to the crashes because the definition of
ThreadLocal class are different depending on the value of
GTEST_HAS_PTHREAD.

A possible solution would be to always declare CMake-determined defines
as a public interface of gtest target, so everything which links gtest
will get those defines as well. For this case, something along the lines

"target_compile_definitions(gtest PUBLIC -DGTEST_HAS_PTHREAD)"

If you prefer, I can try to produce a patch.

[1] /usr/src/gtest/cmake/internal_utils.cmake:108
[2] /usr/include/gtest/internal/gtest-port.h:(473-481)
[3] e.g. on our non-linux architectures

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to