From: Jessica Clarke Date: Mon, 22 Jun 2026 17:58:04 +0000 (+0000) Subject: patch 9.2.0700: configure: -lrt requirement for timer_create not detected X-Git-Tag: v9.2.0700^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ded081dddc5c5070535b045116eb5f63a11d95;p=thirdparty%2Fvim.git patch 9.2.0700: configure: -lrt requirement for timer_create not detected Problem: configure does not actually check whether -lrt is needed for timer_create(); the test only compiles instead of linking, so the requirement is missed when cross-compiling Solution: Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE for the timer_create checks so the link actually decides whether -lrt is required (Jessica Clarke) AC_COMPILE_IFELSE won't try to link, so if the function exists in the system headers, we will always detect that -lrt is not needed, as the code will compile regardless of linker flags. If not cross-compiling, the following AC_RUN_IFELSE will end up trying to link, so if -lrt is needed it will fail to link and we will interpret timer_create as not working, rather than that we just need to link with -lrt. But when we are cross-compiling we will skip the AC_RUN_IFELSE and assume that it works, failing to link when we later build if -lrt is in fact needed. closes: #20605 related: 2cf145b78b88 ("patch 9.1.0837: cross-compiling has some issues") Signed-off-by: Jessica Clarke Signed-off-by: Christian Brabandt --- diff --git a/src/auto/configure b/src/auto/configure index a20eea1667..f5d6dea01c 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -15078,7 +15078,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : vim_cv_timer_create=yes else case e in #( @@ -15086,7 +15086,8 @@ else case e in #( ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create" >&5 @@ -15117,7 +15118,7 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : vim_cv_timer_create_with_lrt=yes else case e in #( @@ -15125,7 +15126,8 @@ else case e in #( ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create_with_lrt" >&5 diff --git a/src/configure.ac b/src/configure.ac index 710cb317fc..b71e553394 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -4037,7 +4037,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM( dnl Check for timer_create. It probably requires the 'rt' library. AC_CACHE_CHECK([for timer_create without -lrt], [vim_cv_timer_create], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include ], [ timer_create(CLOCK_MONOTONIC, NULL, NULL); @@ -4051,7 +4051,7 @@ if test "x$vim_cv_timer_create" = "xno" ; then save_LIBS="$LIBS" LIBS="$LIBS -lrt" AC_CACHE_CHECK([for timer_create with -lrt], [vim_cv_timer_create_with_lrt], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include ], [ timer_create(CLOCK_MONOTONIC, NULL, NULL); diff --git a/src/version.c b/src/version.c index b93bdd9e1c..ddd8a02ca6 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 700, /**/ 699, /**/