From 5bfea9d3e8ea1f25b36441de34feefece1967a8b Mon Sep 17 00:00:00 2001 From: Laurent Cheylus Date: Sun, 26 Jan 2025 06:01:32 +0000 Subject: [PATCH] tools: fix `v doctor` output on OpenBSD: get gcc version from egcc; do not run ldd to get the glibc version (fix #23576) (#23578) --- cmd/tools/vdoctor.v | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/tools/vdoctor.v b/cmd/tools/vdoctor.v index f2bf641f2f24be..d9b9ac4e4d78dc 100644 --- a/cmd/tools/vdoctor.v +++ b/cmd/tools/vdoctor.v @@ -136,7 +136,11 @@ fn (mut a App) collect_info() { a.line('.git/config present', os.is_file('.git/config').str()) a.line('', '') a.line('cc version', a.cmd(command: 'cc --version')) - a.line('gcc version', a.cmd(command: 'gcc --version')) + if os_kind == 'openbsd' { + a.line('gcc version', a.cmd(command: 'egcc --version')) + } else { + a.line('gcc version', a.cmd(command: 'gcc --version')) + } a.line('clang version', a.cmd(command: 'clang --version')) if os_kind == 'windows' { // Check for MSVC on windows @@ -144,7 +148,11 @@ fn (mut a App) collect_info() { } a.report_tcc_version('thirdparty/tcc') a.line('emcc version', a.cmd(command: 'emcc --version')) - a.line('glibc version', a.cmd(command: 'ldd --version')) + if os_kind != 'openbsd' { + a.line('glibc version', a.cmd(command: 'ldd --version')) + } else { + a.line('glibc version', 'N/A') + } } struct CmdConfig {