]> Cypherpunks repositories - gostls13.git/commit
cmd/link: add more clang driver flags when testing flag
authorCorentin Kerisit <corentin.kerisit@gmail.com>
Tue, 16 Dec 2025 23:53:01 +0000 (23:53 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 5 Feb 2026 16:01:38 +0000 (08:01 -0800)
commit99d7121934a9cfa7963d3a9bfd840779fd2869f6
tree450cf4e4437ccbf3c0e0b3388414cc7f268c5ceb
parentb8bccb97982a7dc340f64d0ad522843418db8810
cmd/link: add more clang driver flags when testing flag

This changes does 2 things:

- Move `-L` to `prefixesToKeep` since it allows providing a custom
default libs search path.

- Allow various flags that impact the behaviour of the clang driver.

The latter allows for LLVM only toolchains to be compatible with
linkerFlagSupported checks.

The end goal of this PR is to allow fully hermetic toolchains,
especially pure LLVM ones, to be used to cross-compile CGO.

Fixes #76825

Change-Id: I2311c9566ce9c7e8f6b325258af58eb333663cf0
GitHub-Last-Rev: 74342aae35124cf174a3f8b888999ffd4cea191f
GitHub-Pull-Request: golang/go#76858
Reviewed-on: https://go-review.googlesource.com/c/go/+/730561
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go