Undefined symbol: __libc_csu_* on RHEL8

Let me preface by knowing, there is a possibility that it’s a botched install (it’s a RHEL8 install deployed by my company), but I thought I’d shoot the shot here to see if anyone has any ideas.

First, making a simple file of:

#include <stdio.h>
int main() { printf("TEST\n"); return 0; }

does compile with gcc example.c -o example. Setting verbosity to high, it outputs that the GCC version is `GCC version 8.5.0 (Red Hat 8.5.0-29). Since this is a C program, I presume it copmiles against glibc.

Now, pivoting to zig. I attempt to link against libC with zig, only to run into the errors of:

error: undefined symbol: __libc_csu_fini
    note: referenced by /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o:.text
error: undefined symbol: __libc_csu_init
    note: referenced by /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o:.text

Now, from what I understand, the expectation of those symbols makes sense. As the default installation on RHEL8 is GCC 8 toolchain, then under /usr/lib64/crt1.o it would still have a runtime start up file that expects those symbols in the corresponding glibc.

Now, it is stated that those symbols only disappear starting with glibc==2.34 according to Google. Performing ldd -v I get ldd (GNU libc) 2.28, which would have those symbols. I.e., both my default GCC toolchain and my default Glibc align (which, to me examples why a normal gcc a.c -o a.out works without issue.

But then, I don’t know why the build is not working over zig. From what I understood, zig does support a wide range of glibc versions, including this old. Does anyone have any insight as to what steps I could perform next to debug? E.g. is there some way to know what glibc zig is referencing? (mind you, adding -target x86_64-linux-gnu.2.28 did not seem to help, but grasping at straws).

(tagged with build-system, but unsure if it falls more so under ‘C’)