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

Propagate linkmode into the binary rules #1278

Merged
merged 2 commits into from
Jan 29, 2018

Conversation

ianthehat
Copy link
Contributor

Related to #1264 and #54 and #539

@@ -48,15 +48,19 @@ def emit_link(go,
gc_linkopts, extldflags = _extract_extldflags(gc_linkopts, extldflags)

# Add in any mode specific behaviours
if archive.source.mode.race:
linkExternal = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Snake case

@@ -67,6 +70,8 @@ def emit_compile(go,
args.add(go.toolchain.flags.compile)
if go.mode.debug:
args.add(["-N", "-l"])
if go.mode.link in [LINKMODE_PLUGIN]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just go.mode.link == LINKMODE_PLUGIN until there are other modes that require this flag. I'm guessing other modes will need additional flags, so they'll probably have their own cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent was to have one if per flag rather than one if per mode, hence the list will include the other modes (C_SHARED and C_ARCHIVE will both do this flag).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll open a PR on top of this one for C_ARCHIVE and C_SHARED if you want (they also expose headers)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been working mostly on plugin mode, but hit a wall with not being able to build the standard library in a way that is ready for it.
You may hit the same problem... but feel free to try!

@ianthehat
Copy link
Contributor Author

jenkins test this please

@ianthehat ianthehat merged commit 1b31823 into bazel-contrib:master Jan 29, 2018
@ianthehat ianthehat deleted the linkmode branch January 29, 2018 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants