Skip to content

Feature RFC: Orthogonalize ABSPLITDBG and ABSTRIP #99

Description

@CSharperMantle

Rationale

Currently, ! ABSTRIP implies ! ABSPLITDBG:

if ! bool "$ABSTRIP"; then
abinfo 'Not stripping ELF binaries as requested.'
_opts+=('-r')
elif ! bool "$ABSPLITDBG"; then
abinfo 'Not splitting ELF binaries as requested.'
_opts+=('-x')
fi

Also, its underlying abelf_copy_dbg{,_parallel} also implements a similar set of CLI flags:

case 'x':
flags |= AB_ELF_STRIP_ONLY;
break;
case 'r':
flags |= AB_ELF_CHECK_ONLY;
break;
case 'e':
flags |= AB_ELF_USE_EU_STRIP;
break;
case 'p':
flags |= AB_ELF_SAVE_WITH_PATH;
break;

Both points imply that it's not currently possible to split debug information only without stripping all symbols from the ELF file.

However, these two operations are logically independent. There are needs to individually control debug information extraction and symbol stripping. Some applications, like Firefox's F12 toolbox, require unstripped symbols to work. Since Autobuild invokes objcopy(1) and strip(1) to actually perform the split, this is practically feasible.

Implementation

  1. Refactor abelf_copy_dbg{,_parallel} to use an additive set of CLI flags to allow individual enablement, rather than the current subtractive set.
  2. Refactor filter_elf to use the new set of CLI flags.
  3. Test as needed.

Compatibility considerations

  • A survey of https://github.com/AOSC-Dev/aosc-os-abbs is probably needed for all ABSTRIP=0 sites. These should be checked and amended with ABSPLITDBG=0 if necessary. This includes per-arch overrides like ABSTRIP__AMD64.
  • Direct invocations to abelf_copy_dbg{,_parallel} should be assessed and amended with new CLI flags as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions