Originally reported as https://bugs.gentoo.org/763618 by Yoshihiko Iwama where static linking of a binary for initramfs fails on alpha: ```c $ cat a.c #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> int main() { pid_t pid = 1; int wstatus; int options; struct rusage ru; return wait4(pid, &wstatus, options, &ru); } $ alpha-unknown-linux-gnu-gcc a.c -o a $ LANG=C alpha-unknown-linux-gnu-gcc a.c -o a -static /usr/libexec/gcc/alpha-unknown-linux-gnu/ld: /tmp/cciRui2f.o: in function `main': (.text+0x40): undefined reference to `wait4' collect2: error: ld returned 1 exit status ``` The suspect is https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=09153638cfef9166586b0c21e852ea0d6f15a0fd that misses static library handling.
Fixed on 2.33.
Thank you! Linking patch here for posterity: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6cc992412cd8c8555ca5d67fa2b994e38ccb6c1f