Maya Rashish via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> Some subtargets don't provide the canonical function names as
> the symbol name in C libraries, and libcalls will only work if
> the builtins are patched to emit the correct library name.
>
> For example, on NetBSD, cabsl has the symbol name __c99_cabsl,
> and the patching is done via netbsd_patch_builtin.
>
> With this change, libgfortran.so is correctly built with a
> reference to __c99_cabsl, instead of "cabsl" which is not defined.
>
> gcc/ChangeLog:
>       * config/aarch64/aarch64-builtins.c
>         (aarch64_general_init_builtins): Call SUBTARGET_INIT_BUILTINS.

I think it might be better to do this at the end of the parent function
aarch64_init_builtins instead, if that works.  Although no SVE built-in
functions currently have linkage, the current structure allows more
functions with linkage to be added outside aarch64-builtins.c.

Thanks,
Richard

> ---
>  gcc/config/aarch64/aarch64-builtins.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gcc/config/aarch64/aarch64-builtins.c 
> b/gcc/config/aarch64/aarch64-builtins.c
> index 25ab866ccd4..df13c9be051 100644
> --- a/gcc/config/aarch64/aarch64-builtins.c
> +++ b/gcc/config/aarch64/aarch64-builtins.c
> @@ -1459,6 +1459,10 @@ aarch64_general_init_builtins (void)
>  
>    if (TARGET_MEMTAG)
>      aarch64_init_memtag_builtins ();
> +
> +#ifdef SUBTARGET_INIT_BUILTINS
> +  SUBTARGET_INIT_BUILTINS;
> +#endif
>  }
>  
>  /* Implement TARGET_BUILTIN_DECL for the AARCH64_BUILTIN_GENERAL group.  */

Reply via email to