I just ran into this issue a few days ago myself. The issue appears to be the latest BookWorm Version of the Raspberry Pi OS. Something changed. I installed the last version of the Bullseye version of Rasberry OS and the issue went away. cgminer installed with no issues and detected my miners right away. Kano jumped on the issue as soon as I mentioned it and verified that the RPI foundation changed something about the gcc library for that latest Bookwork Version.
If it helps I have 2 R909s, 5 Compac-Fs and 2 Newpacs so I run my cgminer like this.
sudo ./cgminer -o stratum+tcp://POOLNAME:3333 -u USERNAME -p x345 --gekko-newpac-freq 375 --gekko-compacf-freq 450 --gekko-r909-freq 600