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.