CMakeParseImplicitLinkInfo: Avoid using GCC's "Configured with" line

The `gcc -v` output includes a "Configured with" line about its own
build environment.  Use it only for the fallback from commit 78b7ba6494
(LinkerId: Fix detection of linker tool for GNU on SunOS sparc32,
2023-12-19, v3.29.0-rc1~176^2~8).
This commit is contained in:
Brad King
2026-09-01 14:42:46 -04:00
parent b56fabdb46
commit baec7315b5
+1 -1
View File
@@ -125,7 +125,7 @@ function(cmake_parse_implicit_link_info2 text log_var obj_regex)
elseif("${line}" MATCHES "^export XL_LINKER=(.*/${linker})[ \t]*$") # IBM XL
set(linker_tool "${CMAKE_MATCH_1}")
string(APPEND log " link line: [${line}] ==> linker [${linker_tool}]\n")
elseif("${line}" MATCHES "--with-ld=") # GNU
elseif("${line}" MATCHES "^Configured with: ") # GNU
# The GNU compiler reports how it was configured.
# This does not account for -fuse-ld= so use it only as a fallback.
if("${line}" MATCHES " --with-ld=([^ ]+/${linker})( |$)")