Even on Linux, you can have a C standard library which is not the GNU Glibc. In particular, you can build GCC (or use it) on Linux systems with musl-libc or with Bionic (Android systems) or with with dietlibc, etc. And a Linux system could have the GNU Glibc and use some other C compiler (like Clang or TinyCC).
And details like "how to call a
mainfunction" also depends on the compiler, but in fact, those details are supplied bylibc.soon a Linux system.
.... if I change the compiler to work with another ABI ....
At last, some contributors to or maintainers of GCC (including me) have signed a copyright assignment which covers GCC but not the GNU glibcglibc.
Notice that some standard headers, like <limits.h> or <stdint.h> are provided by GCC; others, like <stdlib.h> are "fixed" during GCC build: the compiler build procedure takes them from the Libc implementation and patches them. Still, other standard headers (probably <stdio.h> and the internal headers it is including) are taken from the libclibc. Read more about GCC FIXINCLUDES and Fixed Header Files.
BTW, you can use a C standard library different of the one your GCC expects or was built for (e.g. musl-libcmusl-libc or some dietlibc), by passingbypassing appropriate extra arguments to gcc ...