Message ID | 20210213122030.GA1488@SDF.ORG |
---|---|
State | New |
Headers | show |
Series | [1/2] aarch64: Run SUBTARGET_INIT_BUILTINS if it exists | expand |
I hope that writing the detailed commit message will encourage someone with better knowledge of GCC internals to point out a better place for this logic. I can follow through with any suggestions :) On Sat, Feb 13, 2021 at 12:20:30PM +0000, Maya Rashish wrote: > 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.
> 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. The change is OK modulo a couple of nits: > gcc/ChangeLog: > * config/sparc/sparc.c > (sparc_init_builtins): Call SUBTARGET_INIT_BUILTINS. The name of the function on the first line. > --- > gcc/config/sparc/sparc.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c > index f3557936114..fe6475f2520 100644 > --- a/gcc/config/sparc/sparc.c > +++ b/gcc/config/sparc/sparc.c > @@ -10962,6 +10962,9 @@ sparc_init_builtins (void) > > if (TARGET_VIS) > sparc_vis_init_builtins (); > +#ifdef SUBTARGET_INIT_BUILTINS > + SUBTARGET_INIT_BUILTINS; > +#endif > } Missing blank line before the change.
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index f3557936114..fe6475f2520 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -10962,6 +10962,9 @@ sparc_init_builtins (void) if (TARGET_VIS) sparc_vis_init_builtins (); +#ifdef SUBTARGET_INIT_BUILTINS + SUBTARGET_INIT_BUILTINS; +#endif } /* Create builtin functions for FPU instructions. */