-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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/link: load symbols from .syso in external link mode #33140
Conversation
This PR (HEAD: b462020) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Ian Lance Taylor: Patch Set 1: A change like this needs a test case, likely somewhere under misc/cgo. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
This PR (HEAD: 128ec32) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from John Papandriopoulos: Patch Set 2:
I've updated the CL with a new test for Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Ian Lance Taylor: Patch Set 2: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
This PR (HEAD: dceb816) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from John Papandriopoulos: Patch Set 3: (5 comments)
Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Ian Lance Taylor: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
This PR (HEAD: 8565316) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from John Papandriopoulos: Patch Set 4: (5 comments)
Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Ian Lance Taylor: Patch Set 4: Run-TryBot+1 Thanks. At this point in the release cycle this will have to wait until the 1.14 release. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 4: TryBots beginning. Status page: https://farmer.golang.org/try?commit=15e2427f Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 4: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 4: TryBot-Result-1 1 of 21 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from John Papandriopoulos: Patch Set 4: The windows/amd64 build failed because loaded syso host object symbols are emitted into the go.o object file, which are duplicated in the same syso object fed to the external linker. While this also happens on linux and darwin, there is no naming collision in the Mach-O/ELF go.o object file, so it builds and executes without error. However it also leads to some syso symbols being duplicated in the final binary which is undesirable. I am looking into solving this properly and will update the CL soon. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
This PR (HEAD: f33b6b6) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from John Papandriopoulos: Patch Set 5: The updated patch set:
Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Than McIntosh: Patch Set 5: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 5: TryBots beginning. Status page: https://farmer.golang.org/try?commit=b93e9ab4 Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 5: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 5: TryBot-Result-1 4 of 21 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Emmanuel Odeke: Patch Set 5: (1 comment) Thank you for working on this CL John and welcome to the Go project! I've added just a minor suggestion to your CL and I'll defer to the rest Please take a look at the trybot failures, they seem related to this change: misc/cgo/testtls.testloadelf: $WORK/b052/pkg.a(_x003.o): malformed elf file: misc/cgo/testtls(.text)#0: reloc of invalid sym #2 tls shndx=4 type=6 misc/cgo/testtls.testloadelf: /tmp/workdir/go/pkg/obj/go-build/3f/3f8b3279547db8e3876e431c51d4d53de06ce4d20d8146a45a52998225ed175a-d(_x003.o): malformed elf file: misc/cgo/testtls(.text)#0: reloc of invalid sym #2 tls shndx=4 type=6 misc/cgo/testtls.testloadelf: /tmp/workdir/go/pkg/obj/go-build/3f/3f8b3279547db8e3876e431c51d4d53de06ce4d20d8146a45a52998225ed175a-d(_x003.o): malformed elf file: misc/cgo/testtls(.text)#0: reloc of invalid sym #2 tls shndx=4 type=6 Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from John Papandriopoulos: Patch Set 5:
Thank you for your welcome, Emmanuel! I'm very happy to be in your company. :)
It has taken some time for me to set up a few VMs to reproduce the above errors; they've all been addressed off-line except the windows/386 error, which I am working on now. I'll push an update soon. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
This PR (HEAD: d110ae1) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from John Papandriopoulos: Patch Set 6: (1 comment) This CL:
We could limit the host object load to the symbol table only, and report errors, but that work might not be worth the effort in the end..?
Look forward to your review, and happy to make further changes as is recommended. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Ian Lance Taylor: Patch Set 6: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 6: TryBots beginning. Status page: https://farmer.golang.org/try?commit=914327c0 Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 6: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Gobot Gobot: Patch Set 6: TryBot-Result-1 1 of 21 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from John Papandriopoulos: Patch Set 6:
This failure looks to be unrelated to this change, see for example https://build.golang.org/log/d92f47c176a7c2dafb997f40c532ba14afb017ad for the same error. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Fix linking with a package having a .syso file in external link mode, that would otherwise cause an error before executing the external linker because it can't find symbols that are exported in the said .syso file. Fixes #33139
This PR (HEAD: 2f8fbd3) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/186417 to see it. Tip: You can toggle comments from me using the |
Message from John Papandriopoulos: Patch Set 7: Ian, this CL seems to have gone cold. Any chance you could take fresh look at it? I've been using this change myself on MacOS, Windows, and Linux for some weeks now, and haven't had any problems. I'm happy to perform another rebase to bring the branch up-to-date. Please let me know if there is anything else I can address so that it can be merged. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from Ian Lance Taylor: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from John Papandriopoulos: Patch Set 8: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Message from John Papandriopoulos: Patch Set 11: (1 comment) Ian, thanks for taking the time to review the last patch set. With patch set 10, I've started over from scratch, taking the direction you have suggested. It has been manually tested on linux/386,amd64,arm,arm64, darwin/amd64,arm64, freebsd/amd64, windows/386,amd64. I appreciate your feedback on this new approach. Please don’t reply on this GitHub thread. Visit golang.org/cl/186417. |
Moved to using |
Fix linking with a package having a .syso file in external link mode,
that would otherwise cause an error before executing the external
linker because it can't find symbols that are exported in the said
.syso file.
Fixes #33139