]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd/tests/std_thread[2].cpp rename execute_native_thread_routine.
authorMark Wielaard <mark@klomp.org>
Sat, 2 Apr 2016 22:07:59 +0000 (22:07 +0000)
committerMark Wielaard <mark@klomp.org>
Sat, 2 Apr 2016 22:07:59 +0000 (22:07 +0000)
Both tests define a execute_native_thread_routine function that we
took from libstdc++. Unfortunately because of a bug this function
is not local in some versions of libstdc++ and so our similar named
function will clash when trying to link.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70476#c2

Simply rename our version to work around this.

Since we don't build this part of the test code for gcc >= 6, this
issue only happens if the buggy libstdc++ thread code is used together
with gcc 5. This is the case with for example devtoolset-4-gcc-5.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15842

drd/tests/std_thread.cpp
drd/tests/std_thread2.cpp

index 6af7455b5b3104c5e266bc5beefee8e23538738f..27f9e2caadd31bce72713e62c5ef81934f5fc73e 100644 (file)
@@ -26,7 +26,7 @@ int main(int argc, char** argv)
 // From libstdc++-v3/src/c++11/thread.cc
 //
 
-extern "C" void* execute_native_thread_routine(void* __p)
+extern "C" void* _v_execute_native_thread_routine(void* __p)
 {
   std::thread::_Impl_base* __t = static_cast<std::thread::_Impl_base*>(__p);
   std::thread::__shared_base_type __local;
@@ -58,7 +58,7 @@ namespace std
 #endif
 
     __b->_M_this_ptr = __b;
-    int __e = __gthread_create(&_M_id._M_thread, execute_native_thread_routine,
+    int __e = __gthread_create(&_M_id._M_thread, _v_execute_native_thread_routine,
                                __b.get());
     if (__e) {
       __b->_M_this_ptr.reset();
index 7de4f9d86241d76546855dec3a872ed9d879e00a..5a4aff929476659c4a47c57af60555700befd00b 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char** argv)
 // From libstdc++-v3/src/c++11/thread.cc
 //
 
-extern "C" void* execute_native_thread_routine(void* __p)
+extern "C" void* _v_execute_native_thread_routine(void* __p)
 {
   std::thread::_Impl_base* __t = static_cast<std::thread::_Impl_base*>(__p);
   std::thread::__shared_base_type __local;
@@ -63,7 +63,7 @@ namespace std
 #endif
 
     __b->_M_this_ptr = __b;
-    int __e = __gthread_create(&_M_id._M_thread, execute_native_thread_routine,
+    int __e = __gthread_create(&_M_id._M_thread, _v_execute_native_thread_routine,
                                __b.get());
     if (__e) {
       __b->_M_this_ptr.reset();