Skip to content

Add Soong support and fix various issues - #16

Open
huku- wants to merge 1 commit into
trailofbits:mainfrom
huku-:soong
Open

Add Soong support and fix various issues#16
huku- wants to merge 1 commit into
trailofbits:mainfrom
huku-:soong

Conversation

@huku-

@huku- huku- commented Aug 15, 2026

Copy link
Copy Markdown

Made the following changes to btfparse to make it compile within the AOSP source tree:

  • Added Soong blueprints.

  • Use size_t instead of uint64_t for file offsets to avoid compilation errors on 32-bit architectures (Soong builds both primary and secondary ABIs).

    Using off_t would be the proper solution, but it introduces several compilation errors. Since only positive offsets are used, size_t is sufficient. Most offsets are uint32_t and are truncated before being promoted anyway.

  • Add missing return statement in BTFHeaderGenerator::setTypeName().

With these modifications, dump-btf compiles fine and can be executed on an Android device.

However, more updates are required to make it recognize additional BTF kinds. Will work on this and submit a different PR.

* Added Soong blueprints to allow using btfparse within the AOSP source
  tree.

* Use size_t instead of uint64_t for file offsets to avoid compilation
  errors on 32-bit architectures (Soong builds both primary and secondary
  ABIs).

  Using off_t would be the proper solution, but it introduces several
  compilation errors. Since only positive offsets are used, size_t is
  sufficient. Most offsets are uint32_t and are truncated before being
  promoted anyway.

* Add missing return statement in BTFHeaderGenerator::setTypeName().
@CLAassistant

CLAassistant commented Aug 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants