Skip to content

Conversation

@jonathonpenix
Copy link
Contributor

@jonathonpenix jonathonpenix commented Jan 20, 2026

Arm/AArch64 now follow the same general pattern as RISC-V and are building
against our own tools (llvm tools, musl, etc.)

Note that this again isn't a 1:1 port of our old cpullvm Arm/AArch64
libraries (or what we used to do downstream) even besides the llvm/musl
changes:

  • Baseline C flags used to build compiler-rt/musl/libc++ have changed
    slightly--musl used to have slightly different variations, but these
    have been made consistent across the projects.
  • The subset of compiler-rt builtins we build for AArch64 Linux is now
    slightly different--we build only the same variants as we build for
    musl/libc++ (rather than sharing some of the same configs with
    baremetal).
  • Profile, sanitizer libraries are now building for Arm/AArch64 (they were
    coincidentally disabled in cpullvm previously). There's caveats though,
    see next point.
  • We are disabling a few sanitizers/sanitizer-related projects in
    compiler-rt due to either a) upstream issues between LLVM and musl or
    b) our musl version underlying musl-embedded being particularly old. A
    brief survey of the issues (see inline comments for details):
    • sanitizer_common dependent projects have issues for Arm due to
      disagreement about the size of time_t. I don't think this is worth
      fixing, so just disable the projects.
    • rtsan relies on fopencookie, which our musl-embedded is too old to
      support. I don't think this is worth backporting, so disable this.
    • gwp_asan relies on execinfo.h and musl (even upstream musl) does not
      have this header or an equivalent. This is a known issue in upstream
      LLVM. Just disable the project.
  • Fix a bug (that also impacts RISC-V!) that meant the extra (non-builtins)
    compiler-rt libraries weren't making it into the final install.

@jonathonpenix jonathonpenix marked this pull request as ready for review January 20, 2026 19:08
@jonathonpenix jonathonpenix marked this pull request as draft January 20, 2026 19:08
@jonathonpenix jonathonpenix force-pushed the arm-linux-rework branch 2 times, most recently from 574aafe to 76857a5 Compare January 21, 2026 06:18
@jonathonpenix jonathonpenix changed the title [DO NOT MERGE] WIP Arm support [cpullvm] Build Arm/AArch64 Linux libraries under the same framework as RISC-V Jan 21, 2026
@jonathonpenix jonathonpenix marked this pull request as ready for review January 21, 2026 06:20
…as RISC-V

Arm/AArch64 now follow the same general pattern as RISC-V and are building
against our own tools (llvm tools, musl, etc.)

Note that this again isn't a 1:1 port of our old cpullvm Arm/AArch64
libraries (or what we used to do downstream) even besides the llvm/musl
changes:
* Baseline C flags used to build compiler-rt/musl/libc++ have changed
  slightly--musl used to have slightly different variations, but these
  have been made consistent across the projects.
* The subset of compiler-rt builtins we build for AArch64 Linux is now
  slightly different--we build only the same variants as we build for
  musl/libc++ (rather than sharing some of the same configs with
  baremetal).
* Profile, sanitizer libraries are now building for Arm/AArch64 (they were
  coincidentally disabled in cpullvm previously). There's caveats though,
  see next point.
* We are disabling a few sanitizers/sanitizer-related projects in
  compiler-rt due to either a) upstream issues between LLVM and musl or
  b) our musl version underlying musl-embedded being particularly old. A
  brief survey of the issues (see inline comments for details):
    * sanitizer_common dependent projects have issues for Arm due to
      disagreement about the size of time_t. I don't think this is worth
      fixing, so just disable the projects.
    * rtsan relies on fopencookie, which our musl-embedded is too old to
      support. I don't think this is worth backporting, so disable this.
    * gwp_asan relies on execinfo.h and musl (even upstream musl) does not
      have this header or an equivalent. This is a known issue in upstream
      LLVM. Just disable the project.
* Fix a bug (that also impacts RISC-V!) that meant the extra (non-builtins)
  compiler-rt libraries weren't making it into the final install.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
@jonathonpenix
Copy link
Contributor Author

jonathonpenix commented Jan 21, 2026

FWIW, test-specific flags were also removed as part of this--we weren't running those in cpullvm anyway and there's some work that will be needed to re-enable them. So, I just discarded those flags for now (and it is in our list of TODOs for the release)

VARIANT_MUSL_CONFIGS["rv32imac_ilp32"]=""
VARIANT_MUSL_CONFIGS["rv64imac_lp64"]=""
VARIANT_MUSL_CONFIGS["rv64gc_lp64d"]=""
VARIANT_MUSL_CONFIGS["aarch64a"]="--quic-aarch64-optmem"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need clarification: if quic_aarch64_optmem is not specified, do we need to still set quic-aarch64-mark-bti?

# * For rtsan, our musl-embedded is too old to support the fopencookie
# extension, which rtsan relies on.
# * For gwp_asan, it requires execinfo.h which is a glibc-specific
# header--no musl version ships this (or an equivalent).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check whether we disabled rtsan in addition to gwp_asan in RISC-V build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming rtsan isn't supported for riscv, so this should be ok--forgot about that earlier, sorry

pushd "${WORKSPACE}/musl-embedded" >/dev/null
git checkout "${MUSL_PINNED_COMMIT}"
popd >/dev/null
# FIXME: once the musl-embedded changes settle, we need to bump this accordingly
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be removed and the musl-embedded commit updated, but I don't want to mess with that until support settles.

I'm just removing this until then so that test builds are unblocked.

@jonathonpenix jonathonpenix marked this pull request as draft January 22, 2026 03:31
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