KEMBAR78
Solve musl and glibc compatibility issues · Issue #952 · async-profiler/async-profiler · GitHub
Skip to content

Solve musl and glibc compatibility issues #952

@apangin

Description

@apangin

Describe the feature

Build a single async-profiler package for each of supported architectures: x64 and ARM64.
Binaries should not have external dependencies such as libstdc++ which may not present on Alpine Linux by default. The same binaries should work on any Linux distribution (Ubuntu, Amazon Linux, CentOS, Alpine) regardless of installed libc version.

Use Case

There has been many issues reported recently about glibc-musl compatibility, e.g. #948, #938, #908.
Also, there is a common ask to get rid of libstdc++ dependency: see #729, #793.

Proposed Solution

To achieve the goal of having one reasonably sized package that works both with glibc and musl and does not depend on libstdc++, we will do the following:

  1. Link libstdc++ and libgcc statically into libasyncProfiler.so.
  2. Reduce the size of libasyncProfiler.so with the techniques described in Get rid of libstdc++ dependency #872.
  3. Patch libasyncProfiler.so to remove the dependency on ld-linux-<arch>.so.
  4. Provide an implementation of __sprintf_chk as a weak symbol, since there is no such symbol in musl libc.
  5. Cross-compile asprof and jfrconv as static binaries with musl toolchain.
  6. Allow cross-compilation for ARM64 on x64.
  7. Prepare a docker image with all the required tools to build async-profiler for x64 and ARM64 as described above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions