Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: implement gccgo support for content-based staleness #22472

Closed
rsc opened this issue Oct 28, 2017 · 8 comments
Closed

cmd/go: implement gccgo support for content-based staleness #22472

rsc opened this issue Oct 28, 2017 · 8 comments

Comments

@rsc
Copy link
Contributor

rsc commented Oct 28, 2017

CL 73214 does not contain support for gccgo-based builds
and instead will cause cmd/go to fatal out if used with gccgo.
(The CL is a bit too large already.)

This issue is to make gccgo work again. The main work items are:

  1. Figure out where to store build IDs in package archives and do so.

  2. Write support for buildActionID/linkActionID/linkSharedActionID to record the relevant build configuration input for the gccgo toolchain.

@rsc rsc added this to the Go1.10 milestone Oct 28, 2017
@rsc
Copy link
Contributor Author

rsc commented Oct 28, 2017

Introduced in CL 73214:

$ git grep -n issue/22472
misc/cgo/testshared/shared_test.go:601:	t.Skip("golang.org/issue/22472")
src/cmd/go/go_test.go:735:		t.Skip("golang.org/issue/22472")
src/cmd/go/go_test.go:2655:	t.Skip("golang.org/issue/22472")
$

@gopherbot
Copy link

Change https://golang.org/cl/85555 mentions this issue: cmd/go: add support for build IDs with gccgo

@rsc
Copy link
Contributor Author

rsc commented Jan 4, 2018

With apologies for not doing this myself, I'm going to assign this to you @ianlancetaylor. Your CL is the lion's share I believe.

gopherbot pushed a commit that referenced this issue Jan 5, 2018
This just adds support on ELF systems, which is OK for now since that
is all that gccgo works on.

For the archive file generated by the compiler we add a new file
_buildid.o that has a section .go.buildid containing the build ID.
Using a new file lets us set the SHF_EXCLUDE bit in the section header,
so the linker will discard the section. It would be nicer to use
`objcopy --add-section`, but objcopy doesn't support setting the
SHF_EXCLUDE bit.

For an executable we just use an ordinary GNU build ID. Doing this
required modifying cmd/internal/buildid to look for a GNU build ID,
and use it if there is no other Go-specific note.

This CL fixes a minor bug in gccgoTOolchain.link: it was using .Target
instead of .built, so it failed for a cached file.

This CL fixes a bug reading note segments: the notes are aligned as
reported by the PT_NOTE's alignment field.

Updates #22472

Change-Id: I4d9e9978ef060bafc5b9574d9af16d97c13f3102
Reviewed-on: https://go-review.googlesource.com/85555
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
@ianlancetaylor
Copy link
Contributor

As far as I can tell, this is done. We can open new issues for any problems that arise.

@tklauser
Copy link
Member

TestIssue7573 and the gccgo specific part of TestBuildComplex in src/cmd/go/go_test.go are still skipped with this issue as a log message:

% git grep issue/22472
cmd/go/go_test.go:802:          t.Skip("golang.org/issue/22472")
cmd/go/go_test.go:3087: t.Skip("golang.org/issue/22472")

Should these skips be removed?

@gopherbot
Copy link

Change https://golang.org/cl/120375 mentions this issue: cmd/go: re-enable a couple of tests of gccgo

@ianlancetaylor
Copy link
Contributor

Yes. Sent https://golang.org/cl/120375. Thanks.

gopherbot pushed a commit that referenced this issue Jun 21, 2018
Updates #22472

Change-Id: I526d131f2ef8e0200f7a5634c75b31e0ee083f93
Reviewed-on: https://go-review.googlesource.com/120375
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/120395 mentions this issue: cmd/go: re-enable a couple of tests of gccgo

gopherbot pushed a commit to golang/gofrontend that referenced this issue Jun 21, 2018
Port https://golang.org/cl/120375 over to the gofrontend repo so that
it gets more reliable testing.

Updates golang/go#22472

Change-Id: I314396e49934374a143a025a477f01449ac1812b
Reviewed-on: https://go-review.googlesource.com/120395
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
hubot pushed a commit to gcc-mirror/gcc that referenced this issue Jun 21, 2018
    
    Port https://golang.org/cl/120375 over to the gofrontend repo so that
    it gets more reliable testing.
    
    Updates golang/go#22472
    
    Reviewed-on: https://go-review.googlesource.com/120395


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261871 138bc75d-0d04-0410-961f-82ee72b054a4
@golang golang locked and limited conversation to collaborators Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants