0001: There is no point in searching -lrt and -lposix4 for fdatasync() if it's supposed to help Solaris only. They moved all the realtime stuff into the main C library at least as far back as Solaris 10/OpenSolaris.
0002: There is no point in probing -lposix4 for anything. That was superseded by -lrt even longer ago. We could go further: I suspect the only remaining -lrt search we still need in practice is for shm_open() on glibc < 2.34, but here I just wanted to clean out some old Sun stuff that was called out by name.
From 9c8663239ff44a75a615ec5ad81bd8dcad3378a6 Mon Sep 17 00:00:00 2001 From: Thomas Munro <thomas.mu...@gmail.com> Date: Mon, 7 Aug 2023 13:54:54 +1200 Subject: [PATCH 1/2] Don't probe extra libraries for fdatasync. Commit d2e15083 got rid of the main configure probe and HAVE_FDATASYNC macro, but we still searched -lrt and -lposix4 for old Solaris systems. It's in the C library on modern Solaris, as on other supported systems. --- configure | 57 ---------------------------------------------------- configure.ac | 2 -- meson.build | 1 - 3 files changed, 60 deletions(-) diff --git a/configure b/configure index 2e518c8007..9ea188bc9b 100755 --- a/configure +++ b/configure @@ -12195,63 +12195,6 @@ if test "$ac_res" != no; then : fi -# Solaris: -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5 -$as_echo_n "checking for library containing fdatasync... " >&6; } -if ${ac_cv_search_fdatasync+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char fdatasync (); -int -main () -{ -return fdatasync (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt posix4; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_fdatasync=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_fdatasync+:} false; then : - break -fi -done -if ${ac_cv_search_fdatasync+:} false; then : - -else - ac_cv_search_fdatasync=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5 -$as_echo "$ac_cv_search_fdatasync" >&6; } -ac_res=$ac_cv_search_fdatasync -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - # Cygwin: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5 $as_echo_n "checking for library containing shmget... " >&6; } diff --git a/configure.ac b/configure.ac index 3ebe1a796d..e36c1aee5a 100644 --- a/configure.ac +++ b/configure.ac @@ -1286,8 +1286,6 @@ AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) AC_SEARCH_LIBS(shm_open, rt) AC_SEARCH_LIBS(shm_unlink, rt) AC_SEARCH_LIBS(clock_gettime, [rt posix4]) -# Solaris: -AC_SEARCH_LIBS(fdatasync, [rt posix4]) # Cygwin: AC_SEARCH_LIBS(shmget, cygipc) # *BSD: diff --git a/meson.build b/meson.build index 04ea348852..b7e67264e1 100644 --- a/meson.build +++ b/meson.build @@ -2405,7 +2405,6 @@ func_checks = [ # required. Just checking for dlsym() ought to suffice. ['dlsym', {'dependencies': [dl_dep], 'define': false}], ['explicit_bzero'], - ['fdatasync', {'dependencies': [rt_dep, posix4_dep], 'define': false}], # Solaris ['getifaddrs'], ['getopt', {'dependencies': [getopt_dep, gnugetopt_dep], 'skip': always_replace_getopt}], ['getopt_long', {'dependencies': [getopt_dep, gnugetopt_dep], 'skip': always_replace_getopt_long}], -- 2.41.0
From 865bb8a85627c14ec69a8a919486f06cbd45b0fb Mon Sep 17 00:00:00 2001 From: Thomas Munro <thomas.mu...@gmail.com> Date: Mon, 7 Aug 2023 13:56:41 +1200 Subject: [PATCH 2/2] Remove traces of Sun -lposix4. This was a library on ancient Solaris systems, which was eventually replaced with -lrt. Both are obsolete, as the relevant symbols moved into the C library long ago. --- configure | 2 +- configure.ac | 2 +- meson.build | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 9ea188bc9b..3ee4801a35 100755 --- a/configure +++ b/configure @@ -12163,7 +12163,7 @@ return clock_gettime (); return 0; } _ACEOF -for ac_lib in '' rt posix4; do +for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else diff --git a/configure.ac b/configure.ac index e36c1aee5a..314bdb5273 100644 --- a/configure.ac +++ b/configure.ac @@ -1285,7 +1285,7 @@ AC_SEARCH_LIBS(socket, [socket ws2_32]) AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) AC_SEARCH_LIBS(shm_open, rt) AC_SEARCH_LIBS(shm_unlink, rt) -AC_SEARCH_LIBS(clock_gettime, [rt posix4]) +AC_SEARCH_LIBS(clock_gettime, rt) # Cygwin: AC_SEARCH_LIBS(shmget, cygipc) # *BSD: diff --git a/meson.build b/meson.build index b7e67264e1..734ad37906 100644 --- a/meson.build +++ b/meson.build @@ -2364,7 +2364,6 @@ rt_dep = cc.find_library('rt', required: false) dl_dep = cc.find_library('dl', required: false) util_dep = cc.find_library('util', required: false) -posix4_dep = cc.find_library('posix4', required: false) getopt_dep = cc.find_library('getopt', required: false) gnugetopt_dep = cc.find_library('gnugetopt', required: false) @@ -2398,7 +2397,7 @@ endif func_checks = [ ['_configthreadlocale', {'skip': host_system != 'windows'}], ['backtrace_symbols', {'dependencies': [execinfo_dep]}], - ['clock_gettime', {'dependencies': [rt_dep, posix4_dep], 'define': false}], + ['clock_gettime', {'dependencies': [rt_dep], 'define': false}], ['copyfile'], # gcc/clang's sanitizer helper library provides dlopen but not dlsym, thus # when enabling asan the dlopen check doesn't notice that -ldl is actually -- 2.41.0