]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/ld: handle "\r" in MinGW "--print-prog-name" output
authorDavis Goodin <dagood@microsoft.com>
Fri, 21 Jun 2024 23:44:44 +0000 (16:44 -0700)
committerGopher Robot <gobot@golang.org>
Sun, 23 Jun 2024 00:52:20 +0000 (00:52 +0000)
commite8ee1dc4f9e2632ba1018610d1a1187743ae397f
tree95af434fff96c18f5e30099b7967e72a6501c5ca
parent44f18706661db8b865719d15a5cfa0515d1a4fca
cmd/link/internal/ld: handle "\r" in MinGW "--print-prog-name" output

Fix the "gcc --print-prog-name" output parser to handle "\r\n", not only
"\n". The MinGW compiler on Windows uses "\r\n" as line endings, causing
the existing parser to create paths like
".../x86_64-w64-mingw32/bin/ar.exe\r", which is not correct. By trimming
the "\r\n" cutset, both types of line endings are handled correctly.

Fixes #68121

Change-Id: I04b8bf9b6a5b29a1e59a6aa07fa4faa4c5bdeee6
Reviewed-on: https://go-review.googlesource.com/c/go/+/593916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
src/cmd/link/internal/ld/lib.go