diff options
author | Sid Nayyar <sidnayyar@google.com> | 2024-03-11 19:14:56 +0000 |
---|---|---|
committer | Giuliano Procida <gprocida@google.com> | 2024-03-12 09:25:23 +0000 |
commit | d9c6092def932aaaeb9189df26ea1b76eac317fd (patch) | |
tree | a7b4400c9af72547c45775bf38caef43e1dbe2bd | |
parent | 90811bd7b2eea26298ea5f1ee4e0e5e4cf1df89a (diff) | |
download | build-d9c6092def932aaaeb9189df26ea1b76eac317fd.tar.gz |
Revert "kleaf: Disable STG restriction of types to header files for Rust builds"
This reverts commit 6f60ca4166544719723b6154aa9aca48ab9c27e3.
Reason for revert: The original change was temporary and was intended to prevent STG from crashing while trying to process DWARF compilation units generated by the Rust compiler while file filters enabled. STG can now ignore file filtering for Rust compilation units and hence does not crash anymore.
Change-Id: I17a1cf0dc0dd6041e35de86a0fe0fbc587621e9c
-rw-r--r-- | kleaf/impl/abi/abi_dump.bzl | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/kleaf/impl/abi/abi_dump.bzl b/kleaf/impl/abi/abi_dump.bzl index bf2e06d..96f574d 100644 --- a/kleaf/impl/abi/abi_dump.bzl +++ b/kleaf/impl/abi/abi_dump.bzl @@ -14,7 +14,6 @@ """Rules for ABI extraction.""" -load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") load(":abi/abi_transitions.bzl", "abi_common_attrs", "with_vmlinux_transition") load( ":common_providers.bzl", @@ -73,22 +72,6 @@ def _find_vmlinux(ctx): required = True, ) -def _stg_file_filter(ctx): - # Do not apply any file filters when Rust is enabled. This is because STG - # requires DW_AT_decl_file to be present for all types emitted in DWARF - # dump when file filtering is used. - # - # TODO(b/325423395): Always apply file filters when STG starts handling - # file filters with Rust types. - if ctx.attr._rust[BuildSettingInfo].value: - # buildifier: disable=print - print( - "\nWARNING: '--rust' flag currently inhibits ABI leak prevention", - "of private C type", - ) - return "" - return "--files '*.h'" - def _abi_dump_full_stg(ctx): hermetic_tools = hermetic_toolchain.get(ctx) full_abi_out_file = ctx.actions.declare_file("{}/abi-full.stg".format(ctx.attr.name)) @@ -106,10 +89,9 @@ def _abi_dump_full_stg(ctx): ) command = hermetic_tools.setup + """ - {stg} {file_filter} --output {full_abi_out_file} --elf {vmlinux} {all_modules} + {stg} --files '*.h' --output {full_abi_out_file} --elf {vmlinux} {all_modules} """.format( stg = ctx.file._stg.path, - file_filter = _stg_file_filter(ctx), full_abi_out_file = full_abi_out_file.path, vmlinux = vmlinux.path, all_modules = all_modules, @@ -180,7 +162,6 @@ abi_dump = rule( cfg = "exec", executable = True, ), - "_rust": attr.label(default = "//build/kernel/kleaf:rust"), } | abi_common_attrs(), cfg = with_vmlinux_transition, toolchains = [hermetic_toolchain.type], |