-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: clear up the Shlib record when building a pkg #26540
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
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
Message from Gerrit User 5976: 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/125441. |
Message from Gerrit User 5065: Patch Set 1: Please file a bug about this so we can assign this to a release. Also, include details of how to reproduce the failure. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
The scene of recurring faults is rare. Somehow, #16602 can cause a link failure. failure details: Bug reason: The Shlib record of the pkg "expvar" should be cleaned once the expvar pkg being rebuilt. Otherwise, the "packageshlib" key word in importcfg.link file will render the "packagefile" ineffective, in which the "packagefile" indicate the path of pkg.a( or cached pkg.a) and the "packageshlib" indicate the path of it's shlib( antiquated path: pkg/linux_amd64_dynlink/libstd.so ). |
Message from Gerrit User 28471: Patch Set 1: Code-Review+1
The scene of recurring faults is rare. Somehow, #16602 can cause a link failure. failure details: expvar (testmain)main.statictmp_0: relocation target expvar.TestNil·f not defined Bug reason: The Shlib record of the pkg "expvar" should be cleaned once the expvar pkg being rebuilt. Otherwise, the "packageshlib" key word in importcfg.link file will render the "packagefile" ineffective, in which the "packagefile" indicate the path of pkg.a( or cached pkg.a) and the "packageshlib" indicate the path of it's shlib( antiquated path: pkg/linux_amd64_dynlink/libstd.so ). Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 5065: Patch Set 1:
Please put these details on a new bug in GitHub. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 28471: Patch Set 1:
Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 5206: Patch Set 1: (3 comments) Thanks for sending this.
Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 28502: Patch Set 1:
1、 There will be an "importcfg.link" file created when user is building program by go1.10.3. It seems the new feture of go1.10.3, not even go1.9 have it! 2、 As this little changes that I think it is to tiny to add a test. 3、 Will the gccgo create importcfg.link file??? I really think it have no business with gccgo. Gccgo is good:) Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 12446: Uploaded patch set 2: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 12446: Uploaded patch set 3: New patch set was added with same tree, parent, and commit message as Patch Set 2. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 12446: Uploaded patch set 4: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 12446: Uploaded patch set 5: New patch set was added with same tree, parent, and commit message as Patch Set 4. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 12446: Uploaded patch set 6: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 12446: Uploaded patch set 7: New patch set was added with same tree, parent, and commit message as Patch Set 6. Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 5206: Patch Set 7:
Thanks, but I don't really understand this explanation. I understand the importcfg.link file. And I understand that it contains a packageshlib entry. But why is the packageshlib entry not correct? Why should we ignore it in this case but not others? What is different here?
I'm sorry, I disagree. The change may be small but the effect is large. If we don't have a test, the behavior could break again in the future.
gccgo doesn't use the importcfg.link file, but my concern is that there is code in cmd/go/internal/work/gccgo.go that looks at the Shlib field. If the Shlib field is cleared, will that code continue to work correctly? Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
0090c13
to
8fbbf63
Compare
Message from Gerrit User 28502: Patch Set 7:
Because the golang will compile the pkg first in the the "build" functon, and the result is _pkg_.a if the pkg need to be built. That means it only updated the "packagefile" entry only, and keep the dirty value of "packageshlib". I think the packageshlib should be cleaned at that moment in case the new _pkg_.a file be ignored to link in, if the packageshlib entry won't be updated since then. It is not an exception, but a general operation process flow. And i think there have no negative impact to packageshlib entry if it will be updated in the later processing. But it do have influences if the packageshlib entry won't be updated after "build function", like #26582 showed.
i can append it later if you aggree to this patch:)
Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 6320: Patch Set 7: I tried this patch on ppc64le, and it results in an error when running misc/cgo/testshared: ../misc/cgo/testshared--- FAIL: TestTrivialExecutable (4.26s) Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Message from Gerrit User 28502: Patch Set 7:
Perhaps there is something chaos and the patch may make "go install" failed in this test case. The output(intercepted fragment):
That log is the building log of libruntime,sync-atomic.so when doing the test. And, the libruntime,sync-atomic.so is being included in importcfg.link file before generated??? Please don’t reply on this GitHub thread. Visit golang.org/cl/125441. |
Replace `addu` with a `sll` instruction with a definite behavior (`sll` will discard the upper 32 bits of the 64 bits, then do sign extensions, with certain behavior). It won't have any UNPREDICTABLE expectation.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
This PR (HEAD: 1f5f489) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/125441 to see it. Tip: You can toggle comments from me using the |
I closed this meaningless pull request. |
The Shlib record of a pkg should be cleaned once the pkg is being built and packed to pkg.a(or using cached file pkg.a).
Otherwise, the "packageshlib" key word in importcfg.link file will render the "packagefile" ineffective, in which the "packagefile" indicate the path of pkg.a( or cached pkg.a) and the "packageshlib" indicate the path of it's shlib( pkg's antiquated libXXX.so path ).
Fixes #26582