diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-cpp/gtest/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-cpp/gtest/files')
4 files changed, 173 insertions, 0 deletions
diff --git a/dev-cpp/gtest/files/configure-fix-pthread-linking.patch b/dev-cpp/gtest/files/configure-fix-pthread-linking.patch new file mode 100644 index 000000000000..75e5219b7a7c --- /dev/null +++ b/dev-cpp/gtest/files/configure-fix-pthread-linking.patch @@ -0,0 +1,93 @@ +From fb71154012e634a5e780e93af5434bcdafaf2b24 Mon Sep 17 00:00:00 2001 +From: Justin Bronder <jsbronder@gmail.com> +Date: Mon, 15 Oct 2012 17:25:07 -0400 +Subject: [PATCH] configure: fix pthread linking + +- Update the pthread check to make sure that we don't need -lpthread when +compiling with -nostdlib. + +- Make sure that the necessary pthread library is passed to libtool. + +Fixes: + +$ ldd -r /usr/lib/libgtest.so + linux-vdso.so.1 (0x00007fffe7dff000) + libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6 (0x00007fbe09a9f000) + libc.so.6 => /lib64/libc.so.6 (0x00007fbe096f7000) + libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1 (0x00007fbe094e1000) + libm.so.6 => /lib64/libm.so.6 (0x00007fbe091ee000) + /lib64/ld-linux-x86-64.so.2 (0x00007fbe0a005000) +undefined symbol: pthread_key_create (/usr/lib/libgtest.so) +undefined symbol: pthread_getspecific (/usr/lib/libgtest.so) +undefined symbol: pthread_key_delete (/usr/lib/libgtest.so) +undefined symbol: pthread_setspecific (/usr/lib/libgtest.so) +--- + Makefile.am | 1 + + m4/acx_pthread.m4 | 39 ++++++++++++++++++++++++++++++++++++++- + 2 files changed, 39 insertions(+), 1 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index cb350b7..db2606e 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -181,6 +181,7 @@ endif + lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la + + lib_libgtest_la_SOURCES = src/gtest-all.cc ++lib_libgtest_la_LIBADD = $(AM_LIBS) + + pkginclude_HEADERS = \ + include/gtest/gtest-death-test.h \ +diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4 +index 2cf20de..7fba4d9 100644 +--- a/m4/acx_pthread.m4 ++++ b/m4/acx_pthread.m4 +@@ -339,7 +339,44 @@ if test "x$acx_pthread_ok" = xyes; then + # so it's not safe to assume that we may use pthreads + acx_pthread_ok=no + fi +- ++ ++ AC_MSG_CHECKING([whether what we have so far is sufficient with -nostdlib]) ++ CFLAGS="-nostdlib $CFLAGS" ++ # we need c with nostdlib ++ LIBS="$LIBS -lc" ++ AC_TRY_LINK([#include <pthread.h>], ++ [pthread_t th; pthread_join(th, 0); ++ pthread_attr_init(0); pthread_cleanup_push(0, 0); ++ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], ++ [done=yes],[done=no]) ++ ++ if test "x$done" = xyes; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ ++ if test x"$done" = xno; then ++ AC_MSG_CHECKING([whether -lpthread saves the day]) ++ LIBS="-lpthread $LIBS" ++ AC_TRY_LINK([#include <pthread.h>], ++ [pthread_t th; pthread_join(th, 0); ++ pthread_attr_init(0); pthread_cleanup_push(0, 0); ++ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], ++ [done=yes],[done=no]) ++ ++ if test "x$done" = xyes; then ++ AC_MSG_RESULT([yes]) ++ PTHREAD_LIBS="$PTHREAD_LIBS -lpthread" ++ else ++ AC_MSG_RESULT([no]) ++ AC_MSG_WARN([Impossible to determine how to use pthreads with shared libraries and -nostdlib]) ++ fi ++ fi ++ ++ CFLAGS="$save_CFLAGS" ++ LIBS="$save_LIBS" ++ CC="$save_CC" + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" + CC="$save_CC" +-- +1.7.8.6 + diff --git a/dev-cpp/gtest/files/gtest-1.8.0-multilib-strict.patch b/dev-cpp/gtest/files/gtest-1.8.0-multilib-strict.patch new file mode 100644 index 000000000000..c18b58e16fb6 --- /dev/null +++ b/dev-cpp/gtest/files/gtest-1.8.0-multilib-strict.patch @@ -0,0 +1,40 @@ +--- a/googlemock/CMakeLists.txt ++++ b/googlemock/CMakeLists.txt +@@ -11,6 +11,8 @@ + + option(gmock_build_tests "Build all of Google Mock's own tests." OFF) + ++set(LIB_INSTALL_DIR lib CACHE STRING "Library install directory") ++ + # A directory to find Google Test sources. + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt") + set(gtest_dir gtest) +@@ -104,7 +106,7 @@ + # + # Install rules + install(TARGETS gmock gmock_main +- DESTINATION lib) ++ DESTINATION ${LIB_INSTALL_DIR}) + install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock + DESTINATION include) + +--- a/googletest/CMakeLists.txt ++++ b/googletest/CMakeLists.txt +@@ -27,6 +27,8 @@ + "Build gtest with internal symbols hidden in shared libraries." + OFF) + ++set(LIB_INSTALL_DIR lib CACHE STRING "Library install directory") ++ + # Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build(). + include(cmake/hermetic_build.cmake OPTIONAL) + +@@ -103,7 +105,7 @@ + # + # Install rules + install(TARGETS gtest gtest_main +- DESTINATION lib) ++ DESTINATION ${LIB_INSTALL_DIR}) + install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest + DESTINATION include) + diff --git a/dev-cpp/gtest/files/gtest-9999-fix-gcc6-undefined-behavior.patch b/dev-cpp/gtest/files/gtest-9999-fix-gcc6-undefined-behavior.patch new file mode 100644 index 000000000000..eadfe6197389 --- /dev/null +++ b/dev-cpp/gtest/files/gtest-9999-fix-gcc6-undefined-behavior.patch @@ -0,0 +1,21 @@ +Fix build with GCC 6 due to lifetime issues. + +--- a/googletest/src/gtest.cc ++++ b/googletest/src/gtest.cc +@@ -2654,10 +2654,12 @@ + test->Run(); + } + +- // Deletes the test object. +- impl->os_stack_trace_getter()->UponLeavingGTest(); +- internal::HandleExceptionsInMethodIfSupported( +- test, &Test::DeleteSelf_, "the test fixture's destructor"); ++ if (test != NULL) { ++ // Deletes the test object. ++ impl->os_stack_trace_getter()->UponLeavingGTest(); ++ internal::HandleExceptionsInMethodIfSupported( ++ test, &Test::DeleteSelf_, "the test fixture's destructor"); ++ } + + result_.set_elapsed_time(internal::GetTimeInMillis() - start); + diff --git a/dev-cpp/gtest/files/gtest-9999-fix-py-tests.patch b/dev-cpp/gtest/files/gtest-9999-fix-py-tests.patch new file mode 100644 index 000000000000..ba63c7b3eeb3 --- /dev/null +++ b/dev-cpp/gtest/files/gtest-9999-fix-py-tests.patch @@ -0,0 +1,19 @@ +Fix python tests that use broken generator expressions + +--- a/googletest/cmake/internal_utils.cmake ++++ b/googletest/cmake/internal_utils.cmake +@@ -247,12 +247,12 @@ + add_test( + NAME ${name} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py +- --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>) ++ --build_dir=${CMAKE_CURRENT_BINARY_DIR}) + else (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1) + add_test( + ${name} + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py +- --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE}) ++ --build_dir=${CMAKE_CURRENT_BINARY_DIR}) + endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1) + endif() + endfunction() |