Hi, Vincent Lefevre wrote: > I can notice the following warnings: > > gcc -static -o zsh main.o `cat stamp-modobjs` -lgdbm -lpcre -lcap -lncursesw -ltinfo -ltinfo -lrt -lm -lc > /usr/bin/ld: options.o: in function `dosetopt': > ./obj-static/Src/../../Src/options.c:830: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking [...] > I can see that Src/zsh_system.h has > > #if defined(HAVE_INITGROUPS) && !defined(DISABLE_DYNAMIC_NSS) > # define USE_INITGROUPS > #endif > > #if defined(HAVE_GETGRGID) && !defined(DISABLE_DYNAMIC_NSS) > # define USE_GETGRGID > #endif […] > > But concerning the first warning, Src/options.c contains > > # ifdef HAVE_INITGROUPS > > I suppose that the test should have been > > # ifdef USE_INITGROUPS > > like in Src/params.c, which has > > # ifdef USE_INITGROUPS > initgroups(x, pswd->pw_gid); > # endif > > I suspect that there is the same issue with the other warnings. Not exactly. I tried to go down this route with the attached patch, and it indeed fixes all the "Using '[…] in statically linked applications requires at runtime the shared libraries from the glibc version used for linking" warnings. But copying zsh-static on a system with a different libc6 version still segfaults, so this patch might be necessary but not sufficient. Last line is: zsh-static: dl-call-libc-early-init.c:37: _dl_call_libc_early_init: Assertion `sym != NULL' failed. So the attached patch is at least INCOMPLETE and only thought as base for further debugging, not (yet) for inclusion in git. Full strace of a run of zsh-static compiled with the attached patch on Debian Unstable (glibc 2.32) and run on Debian 11 Bullseye (glibc 2.31) attached, too. Regards, Axel -- ,''`. | Axel Beckert , https://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 `- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE