]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: trim spaces in pkg-config ldflags output
authorqmuntal <quimmuntal@gmail.com>
Mon, 6 Mar 2023 11:36:31 +0000 (12:36 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 6 Mar 2023 18:19:56 +0000 (18:19 +0000)
Fixes #58889
Updates #35262

Change-Id: I1d51aa03f445faaf4f4e9cc412d5499cad526663
Reviewed-on: https://go-review.googlesource.com/c/go/+/473616
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/cmd/go/internal/work/exec.go

index a14127f260cb06e78bbc791796f58dea32b58555..e72a15950e6075dca058d57916dfe5a4e8c81468 100644 (file)
@@ -1634,7 +1634,7 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string,
                if len(out) > 0 {
                        // We need to handle path with spaces so that C:/Program\ Files can pass
                        // checkLinkerFlags. Use splitPkgConfigOutput here just like we treat cflags.
-                       ldflags, err = splitPkgConfigOutput(out)
+                       ldflags, err = splitPkgConfigOutput(bytes.TrimSpace(out))
                        if err != nil {
                                return nil, nil, err
                        }