Skip to content

Commit

Permalink
Revert D61490661: cxx: Remove preferred_linkage = "static" on bridges
Browse files Browse the repository at this point in the history
Differential Revision:
D61490661

Original commit changeset: d4a7f6f69571

Original Phabricator Diff: D61490661

fbshipit-source-id: 3692eafac7920b555d2749dd2d8fe86eddccdeca
  • Loading branch information
capickett authored and facebook-github-bot committed Aug 20, 2024
1 parent 7bbae67 commit b5adb8a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
9 changes: 0 additions & 9 deletions decls/rust_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ def _linker_flags_arg():
"""),
}

def _exported_linker_flags_arg():
return {
"exported_linker_flags": attrs.list(attrs.arg(anon_target_compatible = True), default = [], doc = """
A set of additional flag to pass before this item on the link line, even if
this items is compiled to a DSO.
"""),
}

def _crate(crate_type):
return {
"crate": crate_type,
Expand Down Expand Up @@ -165,7 +157,6 @@ rust_common = struct(
edition_arg = _edition_arg,
rustc_flags_arg = _rustc_flags_arg,
linker_flags_arg = _linker_flags_arg,
exported_linker_flags_arg = _exported_linker_flags_arg,
crate = _crate,
crate_root = _crate_root,
env_arg = _env_arg,
Expand Down
1 change: 0 additions & 1 deletion decls/rust_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ rust_library = prelude_rule(
# don't have to know whether we're building a rust_binary or a
# rust_library.
rust_common.linker_flags_arg() |
rust_common.exported_linker_flags_arg() |
rust_common.env_arg() |
rust_common.crate(crate_type = attrs.option(attrs.string(), default = None)) |
rust_common.crate_root() |
Expand Down
2 changes: 2 additions & 0 deletions rust/link_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ def inherited_exported_link_deps(ctx: AnalysisContext, dep_ctx: DepCollectionCon
if dep.proc_macro_marker != None:
continue

if dep_ctx.advanced_unstable_linking:
deps[dep.label] = dep.dep
for dep in dep.info.exported_link_deps:
deps[dep.label] = dep

Expand Down
4 changes: 0 additions & 4 deletions rust/rust_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,10 @@ def _link_infos(
default = LinkInfo(
linkables = [SharedLibLinkable(lib = lib.output)],
external_debug_info = external_debug_info,
pre_flags = ctx.attrs.exported_linker_flags,
),
stripped = LinkInfo(
linkables = [SharedLibLinkable(lib = lib.stripped_output)],
external_debug_info = external_debug_info,
pre_flags = ctx.attrs.exported_linker_flags,
),
)
else:
Expand All @@ -441,14 +439,12 @@ def _link_infos(
linker_type = linker_type,
)],
external_debug_info = external_debug_info,
pre_flags = ctx.attrs.exported_linker_flags,
),
stripped = LinkInfo(
linkables = [ArchiveLinkable(
archive = Archive(artifact = lib.stripped_output),
linker_type = linker_type,
)],
pre_flags = ctx.attrs.exported_linker_flags,
),
)
return link_infos
Expand Down

0 comments on commit b5adb8a

Please sign in to comment.