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
- Refactor
abelf_copy_dbg{,_parallel} to use an additive set of CLI flags to allow individual enablement, rather than the current subtractive set.
- Refactor
filter_elf to use the new set of CLI flags.
- 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.
Rationale
Currently,
! ABSTRIPimplies! ABSPLITDBG:autobuild4/filters/80-elf.sh
Lines 20 to 26 in 94cb1d9
Also, its underlying
abelf_copy_dbg{,_parallel}also implements a similar set of CLI flags:autobuild4/native/abnativefunctions.cpp
Lines 865 to 876 in 94cb1d9
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
abelf_copy_dbg{,_parallel}to use an additive set of CLI flags to allow individual enablement, rather than the current subtractive set.filter_elfto use the new set of CLI flags.Compatibility considerations
ABSTRIP=0sites. These should be checked and amended withABSPLITDBG=0if necessary. This includes per-arch overrides likeABSTRIP__AMD64.abelf_copy_dbg{,_parallel}should be assessed and amended with new CLI flags as well.