[compiler-rt] f445be9 - Reland "[compiler-rt][aarch64] Add SME ABI support routines." (#68875)

Stephan Bergmann via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 02:38:22 PDT 2023


On 10/12/23 15:58, Sander de Smalen via llvm-commits wrote:
> Author: Sander de Smalen
> Date: 2023-10-12T13:56:58Z
> New Revision: f445be9790f9998e9048fc2a12402f3e213c079f
> 
> URL: https://github.com/llvm/llvm-project/commit/f445be9790f9998e9048fc2a12402f3e213c079f
> DIFF: https://github.com/llvm/llvm-project/commit/f445be9790f9998e9048fc2a12402f3e213c079f.diff
> 
> LOG: Reland "[compiler-rt][aarch64] Add SME ABI support routines." (#68875)
> 
> Resolved issue with green dragon build by fixing relocations for
> MachO/Darwin which doesn't compile without @page/@pageoff directives.
[...]
> diff  --git a/compiler-rt/lib/builtins/aarch64/sme-abi-init.c b/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
> new file mode 100644
> index 000000000000000..b6ee12170d56dbd
> --- /dev/null
> +++ b/compiler-rt/lib/builtins/aarch64/sme-abi-init.c
> @@ -0,0 +1,52 @@
[...]
> +// We have multiple ways to check that the function has SME, depending on our
> +// target.
> +// * For Linux we can use __getauxval().
> +// * For newlib we can use __aarch64_sme_accessible().
[...]
> +#if defined(COMPILER_RT_SHARED_LIB)
> +__attribute__((weak))
> +#endif
> +extern _Bool __aarch64_sme_accessible(void);
> +
> +static _Bool has_sme(void)  {
> +#if defined(COMPILER_RT_SHARED_LIB)
> +  if (!__aarch64_sme_accessible)
> +    return 0;
> +#endif
> +  return __aarch64_sme_accessible();
> +}
[...]

On macOS, where my local LLVM 18 trunk build only has 
~/llvm/inst/lib/clang/18/lib/darwin/libclang_rt.osx.a, but no 
corresponding .dylib, linking executables built against that LLVM 18 
trunk toolchain started to fail for me now with

> ld64.lld: error: undefined symbol: __aarch64_sme_accessible
>>>> referenced by sme-abi-init.c:41 (~/github.com/llvm/llvm-project/compiler-rt/lib/builtins/aarch64/sme-abi-init.c:41)
>>>>               ~/llvm/inst/lib/clang/18/lib/darwin/libclang_rt.osx.a(sme-abi-init.c.o):(symbol init_aarch64_has_sme+0x4)

Not sure how things are meant to work there?



More information about the llvm-commits mailing list