Skip to content

build: bionic offsets from a file, and attach as a feature - #417

Merged
jwinarske merged 1 commit into
mainfrom
build/bionic-offsets-option
Dec 3, 2026
Merged

jwinarske merged 1 commit into
mainfrom
build/bionic-offsets-option

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

Summary

Per-thread attach needs bionic's internal layout, which the build measured from an AOSP tree at $AOSP, default /mnt/dev/aosp. A packager could neither supply the result nor turn the search off. Built where that tree is absent, a4l compiled attach out and said nothing; built where it is present by chance, a4l took a layout that nothing tied to the bionic it is staged with.

  • -Dbionic_offsets=<file>: use that header, made by tools/gen-bionic-offsets.sh where the AOSP tree is. Nothing on the build machine is read for the layout.
  • -Dbionic_attach: auto is the behavior until now; enabled stops the configure with the reason when no layout can be had; disabled looks at no tree.
  • Architecture line: the header names the architecture it was measured for. The option refuses one for the other architecture, one that says unavailable and one from an older script, and bionic_runtime.cpp refuses to compile against a mismatch. The other architecture's layout builds and then puts every TCB field in the wrong place.
  • The script takes --require and --disabled, and reads ACL_AOSP_ROOT when AOSP is unset.
tools/gen-bionic-offsets.sh --require bionic_offsets.h aarch64    # where the AOSP tree is
meson setup build -Dbionic_offsets=/path/to/bionic_offsets.h      # where a4l is built

Test status (x86-64)

Check Result
Default build Attach available as before; no warning
Suite, default build 134 of 134
bionic_offsets=<x86-64 header>, no tree reachable Builds with attach available; the script is not in the build
Header for aarch64, header saying unavailable, header without the architecture line, missing file, header with bionic_attach=disabled Configure errors that name the cause
bionic_attach=enabled, no tree Configure error with the script's reason
bionic_attach=enabled, tree present Builds, attach available
bionic_attach=disabled Builds, attach compiled out
bionic-offsets test, extended Passes
arm64 cross build Compiles with its header's architecture line

Not run: an app on a build that took the layout from a file. The file is a copy of what the default path generates.

Per-thread attach needs bionic's internal layout, which the build
measured from an AOSP tree at $AOSP, default /mnt/dev/aosp. A packager
could neither supply the result nor turn the search off. Built where
that tree is absent, a4l compiled attach out and said nothing; built
where it is present by chance, a4l took a layout that nothing tied to
the bionic it is staged with.

- -Dbionic_offsets=<file>: use that header, made by
  tools/gen-bionic-offsets.sh where the AOSP tree is. Nothing on the
  build machine is read for the layout.
- -Dbionic_attach: auto is the behavior until now; enabled stops the
  configure with the reason when no layout can be had; disabled looks
  at no tree.
- The header names the architecture it was measured for. The option
  refuses one for the other architecture, one that says unavailable
  and one from an older script, and bionic_runtime.cpp refuses to
  compile against a mismatch. The other architecture's layout builds
  and then puts every TCB field in the wrong place.
- The script takes --require and --disabled, and reads ACL_AOSP_ROOT
  when AOSP is unset.

Tested, x86-64:
- Default: attach available as before. Suite 134 of 134; no warning.
- bionic_offsets=<x86-64 header> with no tree reachable: builds with
  attach available, and the script is not in the build.
- A header for aarch64, one that says unavailable, one without the
  architecture line, a missing file, and a header with
  bionic_attach=disabled: configure errors that name the cause.
- bionic_attach=enabled: a configure error with no tree; builds with
  one. bionic_attach=disabled: builds with attach compiled out.
- bionic-offsets test, extended for --require, --disabled and the
  architecture line: passes.
- The arm64 cross build compiles with its header's architecture line.

Not run: an app on a build that took the layout from a file. The file
is a copy of what the default path generates.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit 6c9fed2 into main Dec 3, 2026
11 checks passed
@jwinarske
jwinarske deleted the build/bionic-offsets-option branch December 3, 2026 03:39
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.

1 participant