On Hurd, do not look for functions unimplemented in libc
authorPino Toscano <pino@debian.org>
Sun, 13 Apr 2025 07:16:12 +0000 (09:16 +0200)
committerPino Toscano <pino@debian.org>
Sun, 13 Apr 2025 07:16:12 +0000 (09:16 +0200)
Last-Update: 2024-05-09
Forwarded: not-needed

The check_function_exists() function of cmake does not keep into account the
defines that glibc provides for the stubs (i.e. unimplemented functions that
always return ENOSYS), so some functions are detected as available.
Unfortunately, due to --fatal-warnings for the linker, linking will fail.
Hence, do not attempt to look for functions that are currently unimplemented
on GNU/Hurd's libc.

Gbp-Pq: Name hurd_disable_unimplemented.diff

src/kioworkers/file/ConfigureChecks.cmake

index c1c04dd3ec52b271b1e27bb065f4e8542b8162c4..b6ce768c48139c51e7d1a156f33945254186c5aa 100644 (file)
@@ -13,8 +13,12 @@ check_include_files(sys/xattr.h   HAVE_SYS_XATTR_H)
 # On FreeBSD extattr.h doesn't compile without manually including sys/types.h
 check_include_files("sys/types.h;sys/extattr.h" HAVE_SYS_EXTATTR_H)
 
-check_function_exists(copy_file_range HAVE_COPY_FILE_RANGE)
+if (NOT (CMAKE_SYSTEM_NAME STREQUAL "GNU"))
+    check_function_exists(copy_file_range HAVE_COPY_FILE_RANGE)
+endif()
 
-check_function_exists(posix_fadvise    HAVE_FADVISE)                  # KIO worker
+if (NOT (CMAKE_SYSTEM_NAME STREQUAL "GNU"))
+    check_function_exists(posix_fadvise    HAVE_FADVISE)                  # KIO worker
+endif()
 
 check_struct_has_member("struct dirent" d_type dirent.h HAVE_DIRENT_D_TYPE LANGUAGE CXX)