diff --git a/configure.ac b/configure.ac index ad31249528eb..3887db5c395e 100644 --- a/configure.ac +++ b/configure.ac @@ -5217,19 +5217,23 @@ AC_SUBST(LD) dnl =================================================================== dnl Check whether the linker supports -debug:fastlink, which links debug -dnl builds faster. MSVC link.exe does; lld-link currently does not and would -dnl warn on every link, falling back to -debug:full. Probe the selected linker -dnl rather than hardcoding "lld has no fastlink", so a future lld-link that -dnl gains support starts using it automatically. +dnl builds faster. link.exe offered it from VS 2017 to VS 2022 and dropped it +dnl in the VS 2026 toolset; lld-link never had it. Both then warn on every +dnl link and fall back to -debug:full, so probe the linker that will be used, +dnl and only pass the flag when it takes it silently. dnl =================================================================== HAVE_LINK_DEBUG_FASTLINK= if test "$_os" = "WINNT"; then AC_MSG_CHECKING([whether the linker supports -debug:fastlink]) - if test -z "$LLD_LINK"; then - dnl MSVC link.exe supports it natively - HAVE_LINK_DEBUG_FASTLINK=TRUE - elif "$LLD_LINK" -debug:fastlink conftest-nonexistent.obj 2>&1 | grep -iq "debug:fastlink.*debug:full"; then - dnl the fallback warning means fastlink is not supported + if test -n "$LLD_LINK"; then + fastlink_linker=$LLD_LINK + else + dnl PATH doesn't cover the MSVC tools yet; link.exe sits next to cl.exe + fastlink_linker=`win_short_path_for_make "$MSVC_HOST_PATH/link.exe"` + fi + dnl the link fails on the missing input file, and any mention of the flag in + dnl the output is a complaint about the flag itself: not being able to use it + if "$fastlink_linker" -debug:fastlink conftest-nonexistent.obj 2>&1 | grep -iq "debug:fastlink"; then HAVE_LINK_DEBUG_FASTLINK= else HAVE_LINK_DEBUG_FASTLINK=TRUE