[all-commits] [llvm/llvm-project] 78cd15: [libc][AArch64] Fix fullbuild when using G++/GCC

David Spickett via All-commits all-commits at lists.llvm.org
Mon Feb 20 00:40:23 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 78cd158cf92ce5abdf5e68230b68b06b57354a0f
      https://github.com/llvm/llvm-project/commit/78cd158cf92ce5abdf5e68230b68b06b57354a0f
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M libc/src/__support/FPUtil/aarch64/FEnvImpl.h
    M libc/src/__support/threads/linux/thread.cpp

  Log Message:
  -----------
  [libc][AArch64] Fix fullbuild when using G++/GCC

The libc uses some functions that GCC does not currently
implement, that come from Arm's ACLE header usually.

These are:
```
__arm_wsr64
__arm_rsr64
__arm_wsr
__arm_rsr
```

This issue was reported to us (https://github.com/llvm/llvm-project/issues/60473)
and I've then reported that back to GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108642).

Even if these functions are added, clang has some non standard extensions
to them that gcc may not take. So we're looking at a fix in gcc 13 at best,
and that may not be enough for what we're doing with them.

So I've added ifdefs to use alternatives with gcc.

For handling the stack pointer, inline assembly is unfortunately the only option.
I have verified that the single mov is essentially what __arm_rsr64 generates.

For fpsr and fpcr the gcc devs suggested using
https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/AArch64-Built-in-Functions.html#AArch64-Built-in-Functions.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D143261




More information about the All-commits mailing list