[go] cmd/cgo: use --no-gc-sections if available

已查看 193 次
跳至第一个未读帖子

Gerrit Bot (Gerrit)

未读,
2022年5月10日 07:49:102022/5/10
收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

cmd/cgo: use --no-gc-sections if available

zig cc passes `--gc-sections` to the underlying linker, which then
causes undefined symbol errors when compiling with cgo but without C
code. Minimal example:

**main.go**
```
package main
import _ "runtime/cgo"
func main() {}
```

Run (works after the patch, doesn't work before):

```
CGO_ENABLED=1 CC="zig cc" go build main.go
```

@ianlancetaylor suggested:

> It would be fine with me if somebody wants to send a cgo patch that
passes -Wl,--no-gc-sections, with a fallback if that option is not
supported.

... and this is what we are doing. Tested with zig
0.10.0-dev.896+e620b692c

Fixes #52690

Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
GitHub-Last-Rev: 136bf8fb4bf143247d6c3c7683f2cdd071aa2e6c
GitHub-Pull-Request: golang/go#52815
---
M src/cmd/go/internal/work/exec.go
1 file changed, 46 insertions(+), 0 deletions(-)

diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 15b9e1e..590a63f 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
@@ -2528,6 +2528,13 @@
a = append(a, "-Qunused-arguments")
}

+ // zig cc passes --gc-sections to the underlying linker, which then causes
+ // undefined symbol errors when compiling with cgo but without C code.
+ // https://github.com/golang/go/issues/52690
+ if b.gccSupportsFlag(compiler, "-Wl,--no-gc-sections") {
+ a = append(a, "-Wl,--no-gc-sections")
+ }
+
// disable word wrapping in error messages
a = append(a, "-fmessage-length=0")


To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
Gerrit-Change-Number: 405414
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newchange

Gopher Robot (Gerrit)

未读,
2022年5月10日 07:49:332022/5/10
收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://go.dev/s/release
for more details.

View Change

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Comment-Date: Tue, 10 May 2022 11:49:29 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Bryan Mills (Gerrit)

    未读,
    2022年5月10日 11:38:162022/5/10
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、Gopher Robot、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    Patch set 1:Run-TryBot +1Code-Review +1

    View Change

    2 comments:

    • Commit Message:

      • Patch Set #1, Line 20: works after the patch, doesn't work before

        This should have a regression test, even if the builders don't run it yet.

        Are there existing `cmd/go` tests that fail when run with
        ```
        CGO_ENABLED=1 CC="zig cc" go test cmd/go
        ```
        ?

        If so, please mention one or more of those tests here. (If not, please add one that fails locally before this change and passes after it.)

    • Patchset:

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Tue, 10 May 2022 15:38:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Bryan Mills (Gerrit)

    未读,
    2022年5月10日 12:12:122022/5/10
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    View Change

    1 comment:

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Tue, 10 May 2022 16:12:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Gopher Robot <go...@golang.org>
    Gerrit-MessageType: comment

    Bryan Mills (Gerrit)

    未读,
    2022年5月10日 12:12:142022/5/10
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    Bryan Mills removed a vote from this change.

    View Change

    Removed TryBot-Result-1 by Gopher Robot <go...@golang.org>

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-MessageType: deleteVote

    Bryan Mills (Gerrit)

    未读,
    2022年5月10日 12:34:082022/5/10
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    View Change

    1 comment:

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Tue, 10 May 2022 16:34:02 +0000

    Bryan Mills (Gerrit)

    未读,
    2022年5月10日 12:43:302022/5/10
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    Bryan Mills removed a vote from this change.

    View Change

    Removed TryBot-Result-1 by Gopher Robot <go...@golang.org>

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-MessageType: deleteVote

    Ian Lance Taylor (Gerrit)

    未读,
    2022年5月10日 17:51:272022/5/10
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    View Change

    1 comment:

    • File src/cmd/go/internal/work/exec.go:

      • Patch Set #1, Line 2534: if b.gccSupportsFlag(compiler, "-Wl,--no-gc-sections") {

        Unfortunately, this won't work. The gccSupportsFlag method just does a compilation using -c, so the -Wl option does nothing.

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Tue, 10 May 2022 21:51:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Bryan Mills (Gerrit)

    未读,
    2022年5月11日 15:02:122022/5/11
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Michael Matloob.

    View Change

    1 comment:

    • Patchset:

      • Ack

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Wed, 11 May 2022 19:02:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Motiejus Jakštys (Gerrit)

    未读,
    2022年5月17日 11:18:362022/5/17
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Michael Matloob.

    View Change

    2 comments:

    • Commit Message:

      • This should have a regression test, even if the builders don't run it yet. […]

        Good suggestion. src/runtime/testprognet fails to build:

        ```
        motiejus ~/code/go/src/runtime/testdata/testprognet $ CC="zig cc" go build .
        # std/runtime/testdata/testprognet
        net(.text): relocation target __errno_location not defined
        net(.text): relocation target getaddrinfo not defined
        net(.text): relocation target freeaddrinfo not defined
        net(.text): relocation target gai_strerror not defined
        runtime/cgo(.text): relocation target stderr not defined
        runtime/cgo(.text): relocation target fwrite not defined
        runtime/cgo(.text): relocation target vfprintf not defined
        runtime/cgo(.text): relocation target fputc not defined
        runtime/cgo(.text): relocation target abort not defined
        runtime/cgo(.text): relocation target pthread_create not defined
        runtime/cgo(.text): relocation target nanosleep not defined
        runtime/cgo(.text): relocation target pthread_detach not defined
        runtime/cgo(.text): relocation target stderr not defined
        runtime/cgo(.text): relocation target strerror not defined
        runtime/cgo(.text): relocation target fprintf not defined
        runtime/cgo(.text): relocation target abort not defined
        runtime/cgo(.text): relocation target pthread_mutex_lock not defined
        runtime/cgo(.text): relocation target pthread_cond_wait not defined
        runtime/cgo(.text): relocation target pthread_mutex_unlock not defined
        runtime/cgo(.text): relocation target pthread_cond_broadcast not defined
        runtime/cgo(.text): relocation target malloc not defined
        /usr/local/go/pkg/tool/linux_amd64/link: too many errors
        motiejus ~/code/go/src/runtime/testdata/testprognet $ CC="zig cc -Wl,--no-gc-sections" go build .
        motiejus ~/code/go/src/runtime/testdata/testprognet $ ./testprognet
        usage: ./testprognet name-of-test
        motiejus ~/code/go/src/runtime/testdata/testprognet $
        ```

        However, the builders can't run it yet, unless we install zig (should we?).

        I guess I'll update the commit message for now. If you decide we should install zig to the builders and run it as a regression test, I can look into it, but as a separate diff.

    • File src/cmd/go/internal/work/exec.go:

      • Unfortunately, this won't work. […]

        Ack

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Tue, 17 May 2022 14:19:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
    Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
    Gerrit-MessageType: comment

    Bryan Mills (Gerrit)

    未读,
    2022年5月17日 17:10:572022/5/17
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Motiejus Jakštys、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Ian Lance Taylor, Michael Matloob, Motiejus Jakštys.

    View Change

    1 comment:

    • Commit Message:

      • Good suggestion. src/runtime/testprognet fails to build: […]

        Just updating the commit message seems fine for now.

        FWIW, if you want to add a builder that uses `zig cc` you might be able to model it on the `linux-amd64-clang` builder, for which the image-creation script is in https://cs.opensource.google/go/x/build/+/master:env/linux-x86-clang/

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Tue, 17 May 2022 21:10:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Motiejus Jakštys <desir...@gmail.com>
    Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
    Gerrit-MessageType: comment

    Gerrit Bot (Gerrit)

    未读,
    2022年5月18日 07:07:352022/5/18
    收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Michael Matloob, Motiejus Jakštys.

    Gerrit Bot uploaded patch set #2 to this change.

    View Change

    The following approvals got outdated and were removed: Run-TryBot+1 by Bryan Mills, TryBot-Result+1 by Gopher Robot

    cmd/cgo: use --no-gc-sections if available

    cmd/cgo: use -Wl,--no-gc-sections if available

    This change adds `--no-gc-sections` to the external linker if the flag
    is understood.


    zig cc passes `--gc-sections` to the underlying linker, which then
    causes undefined symbol errors when compiling with cgo but without C
    code. Minimal example:

    **main.go**
    ```
    package main
    import _ "runtime/cgo"
    func main() {}
    ```

    Run (works after the patch, doesn't work before):

    ```
    CC="zig cc" go build main.go
    ```

    Among the existing code, `src/runtime/testdata/testprognet` fails too:
    ```
    src/runtime/testdata/testprognet$ CC="zig cc" go build .

    net(.text): relocation target __errno_location not defined
    net(.text): relocation target getaddrinfo not defined
    net(.text): relocation target freeaddrinfo not defined
    net(.text): relocation target gai_strerror not defined
    runtime/cgo(.text): relocation target stderr not defined
    runtime/cgo(.text): relocation target fwrite not defined
    runtime/cgo(.text): relocation target vfprintf not defined
    runtime/cgo(.text): relocation target fputc not defined
    runtime/cgo(.text): relocation target abort not defined
    runtime/cgo(.text): relocation target pthread_create not defined
    runtime/cgo(.text): relocation target nanosleep not defined
    runtime/cgo(.text): relocation target pthread_detach not defined
    runtime/cgo(.text): relocation target stderr not defined
    runtime/cgo(.text): relocation target strerror not defined
    runtime/cgo(.text): relocation target fprintf not defined
    runtime/cgo(.text): relocation target abort not defined
    runtime/cgo(.text): relocation target pthread_mutex_lock not defined
    runtime/cgo(.text): relocation target pthread_cond_wait not defined
    runtime/cgo(.text): relocation target pthread_mutex_unlock not defined
    runtime/cgo(.text): relocation target pthread_cond_broadcast not defined
    runtime/cgo(.text): relocation target malloc not defined
    ```

    With the patch both examples build as expected.


    @ianlancetaylor suggested:

    > It would be fine with me if somebody wants to send a cgo patch that
    passes -Wl,--no-gc-sections, with a fallback if that option is not
    supported.

    ... and this is what we are doing. Tested with zig
    0.10.0-dev.2252+a4369918b

    Fixes #52690

    Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    GitHub-Last-Rev: e42ccc7b975382a11c22281f1d1ffbca08ad6bf2

    GitHub-Pull-Request: golang/go#52815
    ---
    M src/cmd/go/internal/work/exec.go
    M src/cmd/go/internal/work/gccgo.go
    2 files changed, 121 insertions(+), 18 deletions(-)

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-MessageType: newpatchset

    Motiejus Jakštys (Gerrit)

    未读,
    2022年5月18日 07:20:382022/5/18
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Michael Matloob.

    View Change

    2 comments:

      • Once this is landed, I will file a separate issue to discuss how to make zig-cc part of the CI process. This will help me focus on the `--no-gc-sections` here for now.

    • Patchset:

      • Patch Set #2:

        Added patchset 2, resolving Ian's concern: we will now have two functions to test compiler/linker flags, respectively.

        I made two commits (one renaming `gccSupportsFlag`) and one fixing the original issue, but Gerrit doesn't seem to like it. At least I can't find the first commit that only does the rename.

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Wed, 18 May 2022 11:20:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Bryan Mills <bcm...@google.com>
    Comment-In-Reply-To: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-MessageType: comment

    Ian Lance Taylor (Gerrit)

    未读,
    2022年5月18日 15:16:292022/5/18
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Motiejus Jakštys、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob, Motiejus Jakštys.

    View Change

    5 comments:

    • Commit Message:

      • Patch Set #2, Line 9: cmd/cgo: use -Wl,--no-gc-sections if available

        This line duplicates the topic line. Please remove (by editing the first comment in the GitHub pull request).

      • Patch Set #2, Line 11: This change adds `--no-gc-sections` to the external linker if the flag

        I think we can remove this sentence also.

    • Patchset:

      • Patch Set #2:

        Added patchset 2, resolving Ian's concern: we will now have two functions to test compiler/linker fl […]

        A stack of commits in a GitHub pull request will be squashed when it is imported into Gerrit. If you want to use a stack of CLs in Gerrit, then I think you have to start in Gerrit. This change is fine as a squashed commit, though.

    • File src/cmd/go/internal/work/exec.go:

      • Patch Set #2, Line 2584: panic(fmt.Sprintf("use gccSupportsLinkerFlag for %q", flag))

        base.Fatalf would be better than panic here. Similarly below.

      • Patch Set #2, Line 2631: cmdArgs = append(cmdArgs, "-c")

        I'm not following this. We already pass -c. Passing -c is not going to cause a link.

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Wed, 18 May 2022 19:16:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Gerrit Bot (Gerrit)

    未读,
    2022年5月18日 22:44:142022/5/18
    收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob, Motiejus Jakštys.

    Gerrit Bot uploaded patch set #3 to this change.

    View Change

    cmd/cgo: use --no-gc-sections if available
    2 files changed, 116 insertions(+), 18 deletions(-)

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 3
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-MessageType: newpatchset

    Gerrit Bot (Gerrit)

    未读,
    2022年5月18日 22:48:152022/5/18
    收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob, Motiejus Jakštys.

    Gerrit Bot uploaded patch set #4 to this change.

    View Change

    cmd/cgo: use --no-gc-sections if available

    zig cc passes `--gc-sections` to the underlying linker, which then
    causes undefined symbol errors when compiling with cgo but without C
    code. Add `-Wl,--no-gc-sections` to make it work with zig cc. Minimal

    example:

    **main.go**

    package main
    import _ "runtime/cgo"
    func main() {}

    Run (works after the patch, doesn't work before):

    CC="zig cc" go build main.go

    Among the existing code, `src/runtime/testdata/testprognet` fails to
    build:
    GitHub-Last-Rev: 856a2e0f356609cf331a88694e0ac311cae89a6f

    GitHub-Pull-Request: golang/go#52815
    ---
    M src/cmd/go/internal/work/exec.go
    M src/cmd/go/internal/work/gccgo.go
    2 files changed, 114 insertions(+), 18 deletions(-)

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 4

    Gerrit Bot (Gerrit)

    未读,
    2022年5月18日 22:52:172022/5/18
    收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob, Motiejus Jakštys.

    Gerrit Bot uploaded patch set #5 to this change.

    View Change

    GitHub-Last-Rev: 55004bc2ce52ed888e8cfa45aa2f494f4718dc0a

    GitHub-Pull-Request: golang/go#52815
    ---
    M src/cmd/go/internal/work/exec.go
    M src/cmd/go/internal/work/gccgo.go
    2 files changed, 114 insertions(+), 18 deletions(-)

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 5

    Motiejus Jakštys (Gerrit)

    未读,
    2022年5月18日 22:55:142022/5/18
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Michael Matloob.

    View Change

    6 comments:

    • Commit Message:

      • This line duplicates the topic line. […]

        Done

      • Patch Set #2, Line 11: This change adds `--no-gc-sections` to the external linker if the flag

        I think we can remove this sentence also.

      • Done

    • Patchset:

      • Patch Set #2:

        A stack of commits in a GitHub pull request will be squashed when it is imported into Gerrit. […]

        Thanks, will squash.

    • Patchset:

      • Patch Set #5:

        Thank you for your findings.

        • Squashed
        • Updated the description in both github and commit.
        • Fixed the `link` param to `gccSupportsFlag`.
    • File src/cmd/go/internal/work/exec.go:

      • Patch Set #2, Line 2584: panic(fmt.Sprintf("use gccSupportsLinkerFlag for %q", flag))

        base.Fatalf would be better than panic here. Similarly below.

      • Done

      • Patch Set #2, Line 2631: cmdArgs = append(cmdArgs, "-c")

        I'm not following this. We already pass -c. Passing -c is not going to cause a link.

      • No, I am the one not following. Thanks.

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 5
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 19 May 2022 02:55:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Motiejus Jakštys <desir...@gmail.com>

    Ian Lance Taylor (Gerrit)

    未读,
    2022年5月19日 19:09:552022/5/19
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Motiejus Jakštys、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob.

    View Change

    1 comment:

    • File src/cmd/go/internal/work/exec.go:

      • Patch Set #5, Line 2592: if !strings.HasPrefix(flag, "-Wl,") {

        Sorry for just noticing this, but with this implementation any option that starts with -Wl must use supportsCompilerFlag and any option that doesn't start with -Wl must use supportsLinkerFlag. It will be simpler to just let gccSupportsFlag decide whether to invoke the linker by examining flag, rather than adding two new functions.

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 5
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 19 May 2022 23:09:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Ian Lance Taylor (Gerrit)

    未读,
    2022年5月19日 19:10:252022/5/19
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Motiejus Jakštys、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob, Motiejus Jakštys.

    View Change

    1 comment:

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 5
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 19 May 2022 23:10:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Motiejus Jakštys (Gerrit)

    未读,
    2022年5月20日 03:22:322022/5/20
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、Ian Lance Taylor、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Michael Matloob.

    View Change

    2 comments:

    • Patchset:

    • File src/cmd/go/internal/work/exec.go:

      • Sorry for just noticing this, but with this implementation any option that starts with -Wl must use […]

        Done

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 5
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Fri, 20 May 2022 07:22:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Gerrit Bot (Gerrit)

    未读,
    2022年5月20日 03:28:312022/5/20
    收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Ian Lance Taylor, Michael Matloob.

    Gerrit Bot uploaded patch set #6 to this change.

    View Change

    GitHub-Last-Rev: 58406b36cabec694003b2c50533220410853e295

    GitHub-Pull-Request: golang/go#52815
    ---
    M src/cmd/go/internal/work/exec.go
    1 file changed, 87 insertions(+), 7 deletions(-)

    To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
    Gerrit-Change-Number: 405414
    Gerrit-PatchSet: 6
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-Attention: Bryan Mills <bcm...@google.com>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-MessageType: newpatchset

    Ian Lance Taylor (Gerrit)

    未读,
    2022年5月20日 13:59:212022/5/20
    收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Ian Lance Taylor、Motiejus Jakštys、Gopher Robot、Bryan Mills、Michael Matloob、Russ Cox、golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills, Michael Matloob.

    Patch set 6:Run-TryBot +1

    View Change

      To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
      Gerrit-Change-Number: 405414
      Gerrit-PatchSet: 6
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Michael Matloob <mat...@golang.org>
      Gerrit-Comment-Date: Fri, 20 May 2022 17:59:17 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      Ian Lance Taylor (Gerrit)

      未读,
      2022年5月20日 17:03:022022/5/20
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Ian Lance Taylor、Motiejus Jakštys、Bryan Mills、Michael Matloob、Russ Cox、golang-co...@googlegroups.com

      Attention is currently required from: Bryan Mills, Michael Matloob.

      Patch set 6:Run-TryBot +1Auto-Submit +1Code-Review +2

      View Change

      1 comment:

      To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
      Gerrit-Change-Number: 405414
      Gerrit-PatchSet: 6
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Michael Matloob <mat...@golang.org>
      Gerrit-Comment-Date: Fri, 20 May 2022 21:02:54 +0000

      Gopher Robot (Gerrit)

      未读,
      2022年5月20日 17:03:302022/5/20
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、golang-...@googlegroups.com、Ian Lance Taylor、Motiejus Jakštys、Bryan Mills、Michael Matloob、Russ Cox、golang-co...@googlegroups.com

      Gopher Robot submitted this change.

      View Change


      Approvals: Ian Lance Taylor: Looks good to me, approved; Run TryBots; Automatically submit change Ian Lance Taylor: Run TryBots Gopher Robot: TryBots succeeded Bryan Mills: Looks good to me, but someone else must approve
      Reviewed-on: https://go-review.googlesource.com/c/go/+/405414
      Reviewed-by: Ian Lance Taylor <ia...@google.com>
      Auto-Submit: Ian Lance Taylor <ia...@google.com>
      Run-TryBot: Ian Lance Taylor <ia...@golang.org>
      Run-TryBot: Ian Lance Taylor <ia...@google.com>
      Reviewed-by: Bryan Mills <bcm...@google.com>
      TryBot-Result: Gopher Robot <go...@golang.org>
      ---
      M src/cmd/go/internal/work/exec.go
      1 file changed, 94 insertions(+), 7 deletions(-)

      diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
      index 15b9e1e..7a45a25 100644

      --- a/src/cmd/go/internal/work/exec.go
      +++ b/src/cmd/go/internal/work/exec.go
      @@ -2528,6 +2528,13 @@
      a = append(a, "-Qunused-arguments")
      }

      + // zig cc passes --gc-sections to the underlying linker, which then causes
      + // undefined symbol errors when compiling with cgo but without C code.
      + // https://github.com/golang/go/issues/52690
      + if b.gccSupportsFlag(compiler, "-Wl,--no-gc-sections") {
      + a = append(a, "-Wl,--no-gc-sections")
      + }
      +
      // disable word wrapping in error messages
      a = append(a, "-fmessage-length=0")

      @@ -2594,13 +2601,21 @@
      defer os.Remove(tmp)
      }

      - // We used to write an empty C file, but that gets complicated with
      - // go build -n. We tried using a file that does not exist, but that
      - // fails on systems with GCC version 4.2.1; that is the last GPLv2
      - // version of GCC, so some systems have frozen on it.
      - // Now we pass an empty file on stdin, which should work at least for
      - // GCC and clang.
      - cmdArgs := str.StringList(compiler, flag, "-c", "-x", "c", "-", "-o", tmp)
      + // We used to write an empty C file, but that gets complicated with go
      + // build -n. We tried using a file that does not exist, but that fails on
      + // systems with GCC version 4.2.1; that is the last GPLv2 version of GCC,
      + // so some systems have frozen on it. Now we pass an empty file on stdin,
      + // which should work at least for GCC and clang.
      + //
      + // If the argument is "-Wl,", then it's testing the linker. In that case,
      + // skip "-c". If it's not "-Wl,", then we are testing the compiler and
      + // can emit the linking step with "-c".
      + cmdArgs := str.StringList(compiler, flag)
      + if !strings.HasPrefix(flag, "-Wl,") /* linker flag */ {
      + cmdArgs = append(cmdArgs, "-c")
      + }
      + cmdArgs = append(cmdArgs, "-x", "c", "-", "-o", tmp)
      +
      if cfg.BuildN || cfg.BuildX {
      b.Showcmd(b.WorkDir, "%s || true", joinUnambiguously(cmdArgs))
      if cfg.BuildN {

      To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
      Gerrit-Change-Number: 405414
      Gerrit-PatchSet: 7
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-MessageType: merged

      Cherry Mui (Gerrit)

      未读,
      2022年5月20日 17:47:542022/5/20
      收件人 Gerrit Bot、Gopher Robot、goph...@pubsubhelper.golang.org、Ian Lance Taylor、Motiejus Jakštys、Bryan Mills、Michael Matloob、Russ Cox、golang-co...@googlegroups.com

      View Change

      2 comments:

      • Patchset:

        • Patch Set #7:

          This CL breaks the AIX builder and the iOS builder.

      • File src/cmd/go/internal/work/exec.go:

        • Patch Set #7, Line 2636: !bytes.Contains(out, []byte("is not supported"))

          Maybe we also need to match "not recognized" and "unknown option".

      To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
      Gerrit-Change-Number: 405414
      Gerrit-PatchSet: 7
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Cherry Mui <cher...@google.com>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Fri, 20 May 2022 21:47:50 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Ian Lance Taylor (Gerrit)

      未读,
      2022年5月20日 18:50:222022/5/20
      收件人 Gerrit Bot、Gopher Robot、goph...@pubsubhelper.golang.org、Cherry Mui、Ian Lance Taylor、Motiejus Jakštys、Bryan Mills、Michael Matloob、Russ Cox、golang-co...@googlegroups.com

      Ian Lance Taylor has created a revert of this change.

      View Change

      To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
      Gerrit-Change-Number: 405414
      Gerrit-PatchSet: 7
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Cherry Mui <cher...@google.com>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-MessageType: revert

      Gerrit Bot (Gerrit)

      未读,
      2022年5月23日 04:57:472022/5/23
      收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

      Gerrit Bot has uploaded this change for review.

      View Change

      This is a continuation of CL 405414: the original one broke AIX and iOS
      builds. To fix that, added `unknown option` to the list of strings
      under lookup.

      Fixes #52690

      Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      GitHub-Last-Rev: b9ef8009dcb4790e541e4a752632d2bd992f8f42
      GitHub-Pull-Request: golang/go#53028
      ---
      M src/cmd/go/internal/work/exec.go
      1 file changed, 96 insertions(+), 8 deletions(-)

      diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
      index 15b9e1e..1401663 100644
      @@ -2613,12 +2628,16 @@
      out, _ := cmd.CombinedOutput()
      // GCC says "unrecognized command line option".
      // clang says "unknown argument".
      + // tcc says "unsupported"
      + // AIX and/or iOS say "not recognized"
      // Older versions of GCC say "unrecognised debug output level".
      // For -fsplit-stack GCC says "'-fsplit-stack' is not supported".
      supported := !bytes.Contains(out, []byte("unrecognized")) &&
      !bytes.Contains(out, []byte("unknown")) &&
      !bytes.Contains(out, []byte("unrecognised")) &&
      - !bytes.Contains(out, []byte("is not supported"))
      + !bytes.Contains(out, []byte("is not supported")) &&
      + !bytes.Contains(out, []byte("not recognized")) &&
      + !bytes.Contains(out, []byte("unsupported"))
      b.flagCache[key] = supported
      return supported
      }

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-MessageType: newchange

      Motiejus Jakštys (Gerrit)

      未读,
      2022年5月23日 04:58:122022/5/23
      收件人 Gerrit Bot、Gopher Robot、goph...@pubsubhelper.golang.org、Cherry Mui、Ian Lance Taylor、Bryan Mills、Michael Matloob、Russ Cox、golang-co...@googlegroups.com

      View Change

      2 comments:

      • Patchset:

      • File src/cmd/go/internal/work/exec.go:

        • Patch Set #7, Line 2636: !bytes.Contains(out, []byte("is not supported"))

          Maybe we also need to match "not recognized" and "unknown option".

      To view, visit change 405414. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ib6d1b2bd59335e9663afefd360ddad7da358a938
      Gerrit-Change-Number: 405414
      Gerrit-PatchSet: 7
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Cherry Mui <cher...@google.com>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Mon, 23 May 2022 08:58:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Cherry Mui <cher...@google.com>
      Gerrit-MessageType: comment

      Motiejus Jakštys (Gerrit)

      未读,
      2022年5月23日 05:00:332022/5/23
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Cherry Mui、Bryan Mills、golang-co...@googlegroups.com

      Attention is currently required from: Bryan Mills, Cherry Mui, Ian Lance Taylor.

      View Change

      1 comment:

      • Patchset:

        • Patch Set #1:

          Adding original reviewers from CL 405414.

          Cherry Mui, I would appreciate if you could double-check this with iOS and AIX.

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Mon, 23 May 2022 09:00:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Bryan Mills (Gerrit)

      未读,
      2022年5月23日 10:01:382022/5/23
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Bryan Mills、Cherry Mui、Motiejus Jakštys、golang-co...@googlegroups.com

      Attention is currently required from: Cherry Mui, Ian Lance Taylor.

      Patch set 1:Run-TryBot +1Code-Review +1

      View Change

      1 comment:

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Mon, 23 May 2022 14:01:34 +0000

      Cherry Mui (Gerrit)

      未读,
      2022年5月23日 10:16:142022/5/23
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Motiejus Jakštys、golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor.

      View Change

      1 comment:

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
      Gerrit-Comment-Date: Mon, 23 May 2022 14:16:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Ian Lance Taylor (Gerrit)

      未读,
      2022年5月23日 20:28:392022/5/23
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Ian Lance Taylor、Gopher Robot、Bryan Mills、Cherry Mui、Motiejus Jakštys、golang-co...@googlegroups.com

      Attention is currently required from: Cherry Mui, Ian Lance Taylor.

      View Change

      1 comment:

      • Patchset:

        • Patch Set #1:

          1 of 32 SlowBots failed. […]

          On the iOS builder the command "$CC -Wl,--no-gc-sections -x c - -o /dev/null < /dev/null" is failing with

          Unable to remove existing file: Invalid argument
          clang-5.0: error: linker command failed with exit code 255 (use -v to see invocation)

          Perhaps it will work to add "ios" to the "windows" case in gccSupportsFlag to use -o with a temporary file.

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Tue, 24 May 2022 00:28:34 +0000

      Gerrit Bot (Gerrit)

      未读,
      2022年5月24日 04:04:252022/5/24
      收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

      Attention is currently required from: Bryan Mills, Cherry Mui, Ian Lance Taylor.

      Gerrit Bot uploaded patch set #2 to this change.

      View Change

      The following approvals got outdated and were removed: Run-TryBot+1 by Bryan Mills, TryBot-Result-1 by Gopher Robot

      GitHub-Last-Rev: 9e1d5b296992a9ca435403565cf4f7f6511e2b9f

      GitHub-Pull-Request: golang/go#53028
      ---
      M src/cmd/go/internal/work/exec.go
      1 file changed, 102 insertions(+), 9 deletions(-)

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 2
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-MessageType: newpatchset

      Motiejus Jakštys (Gerrit)

      未读,
      2022年5月24日 04:09:132022/5/24
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Ian Lance Taylor、Gopher Robot、Bryan Mills、Cherry Mui、golang-co...@googlegroups.com

      Attention is currently required from: Bryan Mills, Cherry Mui, Ian Lance Taylor, Ian Lance Taylor.

      View Change

      2 comments:

      • Patchset:

        • Patch Set #1:

          On the iOS builder the command "$CC -Wl,--no-gc-sections -x c - -o /dev/null < /dev/null" is failing […]

          Done

        • Patch Set #1:

          Thanks for the suggestion, applied.

          Unfortunately, I don't have access to an iOS build(device|farm), thus flying blind from here.

      To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
      Gerrit-Change-Number: 407814
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Tue, 24 May 2022 08:09:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>

      Bryan Mills (Gerrit)

      未读,
      2022年5月24日 08:59:002022/5/24
      收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Bryan Mills、Ian Lance Taylor、Gopher Robot、Cherry Mui、Motiejus Jakštys、golang-co...@googlegroups.com

      Attention is currently required from: Cherry Mui, Ian Lance Taylor, Ian Lance Taylor.

      Patch set 2:Run-TryBot +1Code-Review +1

      View Change

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Cherry Mui <cher...@google.com>
        Gerrit-Comment-Date: Tue, 24 May 2022 12:58:55 +0000

        Cherry Mui (Gerrit)

        未读,
        2022年5月24日 11:44:412022/5/24
        收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Bryan Mills、Ian Lance Taylor、Motiejus Jakštys、golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Ian Lance Taylor.

        Patch set 2:Code-Review +2

        View Change

        1 comment:

        • File src/cmd/go/internal/work/exec.go:

          • Patch Set #2, Line 2637: iOS

            iOS says "unknown option" when the output file is specified. I think we can update this comment (just removing iOS is fine).

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Comment-Date: Tue, 24 May 2022 15:44:38 +0000

        Motiejus Jakštys (Gerrit)

        未读,
        2022年5月24日 22:55:122022/5/24
        收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Cherry Mui、Gopher Robot、Bryan Mills、Ian Lance Taylor、golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Ian Lance Taylor.

        View Change

        1 comment:

        • File src/cmd/go/internal/work/exec.go:

          • iOS says "unknown option" when the output file is specified. […]

            Done

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Comment-Date: Wed, 25 May 2022 02:55:07 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No

        Gerrit Bot (Gerrit)

        未读,
        2022年5月24日 22:55:422022/5/24
        收件人 goph...@pubsubhelper.golang.org、golang-co...@googlegroups.com

        Attention is currently required from: Bryan Mills, Ian Lance Taylor, Ian Lance Taylor.

        Gerrit Bot uploaded patch set #3 to this change.

        View Change

        The following approvals got outdated and were removed: Run-TryBot+1 by Bryan Mills, TryBot-Result+1 by Gopher Robot

        GitHub-Last-Rev: 86f227a14e9f326f1b461b641e4865bc4dc70780

        GitHub-Pull-Request: golang/go#53028
        ---
        M src/cmd/go/internal/work/exec.go
        1 file changed, 102 insertions(+), 9 deletions(-)

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-Attention: Bryan Mills <bcm...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-MessageType: newpatchset

        Ian Lance Taylor (Gerrit)

        未读,
        2022年5月25日 19:26:032022/5/25
        收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Cherry Mui、Gopher Robot、Bryan Mills、Ian Lance Taylor、Motiejus Jakštys、golang-co...@googlegroups.com

        Attention is currently required from: Bryan Mills, Ian Lance Taylor.

        Patch set 3:Run-TryBot +1Auto-Submit +1Code-Review +1

        View Change

        1 comment:

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-Attention: Bryan Mills <bcm...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Comment-Date: Wed, 25 May 2022 23:25:59 +0000

        Ian Lance Taylor (Gerrit)

        未读,
        2022年5月25日 20:50:002022/5/25
        收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、Gopher Robot、Cherry Mui、Bryan Mills、Ian Lance Taylor、Motiejus Jakštys、golang-co...@googlegroups.com

        Attention is currently required from: Bryan Mills, Ian Lance Taylor.

        View Change

        1 comment:

        • Patchset:

          • Patch Set #3:

            1 of 33 SlowBots failed. […]

            Trybot failure is a known problem unrelated to this CL.

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-Attention: Bryan Mills <bcm...@google.com>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Comment-Date: Thu, 26 May 2022 00:49:56 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No

        Ian Lance Taylor (Gerrit)

        未读,
        2022年5月25日 20:50:052022/5/25
        收件人 Gerrit Bot、goph...@pubsubhelper.golang.org、golang-...@googlegroups.com、Gopher Robot、Cherry Mui、Bryan Mills、Ian Lance Taylor、Motiejus Jakštys、golang-co...@googlegroups.com

        Ian Lance Taylor submitted this change.

        View Change



        2 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: src/cmd/go/internal/work/exec.go
        Insertions: 1, Deletions: 1.

        @@ -2634,7 +2634,7 @@

        // GCC says "unrecognized command line option".
        // clang says "unknown argument".
         	// tcc says "unsupported"
        - // AIX and/or iOS say "not recognized"
        + // AIX says "not recognized"

        // Older versions of GCC say "unrecognised debug output level".
        // For -fsplit-stack GCC says "'-fsplit-stack' is not supported".
        supported := !bytes.Contains(out, []byte("unrecognized")) &&
        ```

        Approvals: Bryan Mills: Looks good to me, but someone else must approve Ian Lance Taylor: Looks good to me, but someone else must approve; Run TryBots; Automatically submit change Cherry Mui: Looks good to me, approved Objections: Gopher Robot: TryBots failed
        Reviewed-on: https://go-review.googlesource.com/c/go/+/407814
        Reviewed-by: Cherry Mui <cher...@google.com>

        Auto-Submit: Ian Lance Taylor <ia...@google.com>
        Reviewed-by: Bryan Mills <bcm...@google.com>

        Reviewed-by: Ian Lance Taylor <ia...@google.com>
        Run-TryBot: Ian Lance Taylor <ia...@google.com>
        ---
        M src/cmd/go/internal/work/exec.go
        1 file changed, 108 insertions(+), 9 deletions(-)

        diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
        index 15b9e1e..2becc6d 100644

        --- a/src/cmd/go/internal/work/exec.go
        +++ b/src/cmd/go/internal/work/exec.go
        @@ -2528,6 +2528,13 @@
        a = append(a, "-Qunused-arguments")
        }

        + // zig cc passes --gc-sections to the underlying linker, which then causes
        + // undefined symbol errors when compiling with cgo but without C code.
        + // https://github.com/golang/go/issues/52690
        + if b.gccSupportsFlag(compiler, "-Wl,--no-gc-sections") {
        + a = append(a, "-Wl,--no-gc-sections")
        + }
        +
        // disable word wrapping in error messages
        a = append(a, "-fmessage-length=0")

        @@ -2584,7 +2591,12 @@
        }

        tmp := os.DevNull
        - if runtime.GOOS == "windows" {
        +
        + // On the iOS builder the command
        + // $CC -Wl,--no-gc-sections -x c - -o /dev/null < /dev/null
        + // is failing with:
        + // Unable to remove existing file: Invalid argument
        + if runtime.GOOS == "windows" || runtime.GOOS == "ios" {
        f, err := os.CreateTemp(b.WorkDir, "")
        if err != nil {
        return false
        @@ -2594,13 +2606,21 @@
        @@ -2613,12 +2633,16 @@

        out, _ := cmd.CombinedOutput()
        // GCC says "unrecognized command line option".
        // clang says "unknown argument".
        + // tcc says "unsupported"
        +	// AIX says "not recognized"

        // Older versions of GCC say "unrecognised debug output level".
        // For -fsplit-stack GCC says "'-fsplit-stack' is not supported".
        supported := !bytes.Contains(out, []byte("unrecognized")) &&
        !bytes.Contains(out, []byte("unknown")) &&
        !bytes.Contains(out, []byte("unrecognised")) &&
        - !bytes.Contains(out, []byte("is not supported"))
        + !bytes.Contains(out, []byte("is not supported")) &&
        + !bytes.Contains(out, []byte("not recognized")) &&
        + !bytes.Contains(out, []byte("unsupported"))
        b.flagCache[key] = supported
        return supported
        }

        To view, visit change 407814. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Id6743e1e759a02627b0fc6d2ac89bb69b706d04c
        Gerrit-Change-Number: 407814
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Motiejus Jakštys <desir...@gmail.com>
        Gerrit-MessageType: merged
        回复全部
        回复作者
        转发
        0 个新帖子