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/link: -B has no effect when linking externally #10607

Closed
mwhudson opened this issue Apr 29, 2015 · 6 comments
Closed

cmd/link: -B has no effect when linking externally #10607

mwhudson opened this issue Apr 29, 2015 · 6 comments
Assignees
Milestone

Comments

@mwhudson
Copy link
Contributor

@mwhudson mwhudson commented Apr 29, 2015

All notes, including the build id if passed, are not written when -linkmode=external.

I don't really know if this is a problem as I don't know what uses -B is used for but it confused me for a while.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 29, 2015

We should translate -B into -Wl,--build-id when invoking the external linker.

I think I don't notice this because on Ubuntu the external linker defaults to -Wl,--build-id anyhow.

@ianlancetaylor ianlancetaylor added this to the Go1.5 milestone Apr 29, 2015
@ianlancetaylor ianlancetaylor self-assigned this Apr 29, 2015
@mwhudson

This comment has been minimized.

Copy link
Contributor Author

@mwhudson mwhudson commented Apr 29, 2015

We could also write the buildid note ourselves and pass -Wl,--build-id=none.

@rsc rsc changed the title cmd/internal/ld: -B has no effect when linking externally cmd/link: -B has no effect when linking externally Jun 8, 2015
@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Jun 29, 2015

If we translate -B note into -Wl,--build-id, then we lose the note that was requested. It seems to me we should write the buildid note ourselves and pass -Wl,--build-id=none.

Ian, Michael, thoughts? I'm happy to write the CL.

@mwhudson

This comment has been minimized.

Copy link
Contributor Author

@mwhudson mwhudson commented Jun 29, 2015

I filed this bug because I found the behaviour confusing rather than preventing me doing anything. It would be nice to have it fixed and your proposal makes a lot of sense, but I don't know if it's worth doing for 1.5.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 11, 2015

We should translate "-B 0xabcdef" into "-Wl,--build-id=0xabcdef". The format of the value is identical, which is not a coincidence.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 15, 2015

CL https://golang.org/cl/12242 mentions this issue.

@golang golang locked and limited conversation to collaborators Jul 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.