]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0700: configure: -lrt requirement for timer_create not detected v9.2.0700
authorJessica Clarke <jrtc27@jrtc27.com>
Mon, 22 Jun 2026 17:58:04 +0000 (17:58 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Jun 2026 17:58:04 +0000 (17:58 +0000)
commit98ded081dddc5c5070535b045116eb5f63a11d95
tree58bd154e830ac3568df2f7b62d8b5d4f3b3abe2c
parente31ec2ef06c7cc4ec080f2ec64923e080680128f
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 <jrtc27@jrtc27.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/auto/configure
src/configure.ac
src/version.c