Description: Build and test fixes for GNU/Hurd and kFreeBSD
 Merged patches for hurd and kfreebsd and updated for 5.7
 Thanks to: 
 Pino Toscano <pino@debian.org>
 Nicholas Bamber <nicholas@periapt.co.uk>
 for original patches.
 .
 See hurd.patch and kfreebsd_tests.patch for more information
Author: Lars Tangvald <lars.tangvald@oracle.com>

---
Forwarded: no
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2016-02-09

--- /dev/null
+++ b/cmake/os/GNU.cmake
@@ -0,0 +1,20 @@
+# This file includes GNU/Hurd specific options and quirks, related to system checks
+
+INCLUDE(CheckSymbolExists)
+
+SET(_GNU_SOURCE 1)
+
+# Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
+FOREACH(LANG C CXX)
+  STRING(REPLACE "-rdynamic" ""
+  CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS
+  "${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}"
+  )
+ENDFOREACH()
+
+# Ensure we have clean build for shared libraries
+# without unresolved symbols
+SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
+
+# 64 bit file offset support flag
+SET(_FILE_OFFSET_BITS 64)
--- a/mysql-test/lib/My/Platform.pm
+++ b/mysql-test/lib/My/Platform.pm
@@ -115,6 +115,11 @@ sub check_socket_path_length {
 
   return 0 if IS_WINDOWS;
 
+  # See Debian bug #651002
+  return 0 if ($^O eq 'gnu');
+  # See Debian bug #670722 - failing on kFreeBSD even after setting short path
+  return 0 if length $path < 40;
+
   require IO::Socket::UNIX;
 
   my $truncated = undef;
