There is no reason for build-many-glibcs.py not to configure GCC with --enable-initfini-array.
Please fix this in GCC by defaulting to --enable-initfini-array for a much wider range of configurations (including all *-*-linux* and *-*-gnu*, for example, if not all ELF configurations) for cross compilation, rather than only in the native case; build-many-glibcs.py is not a good place to fix a GCC issue.
I opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100896 In the meantime, --enable-initfini-array should be passed to GCC configure.
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a586fe9c80f7cf2c9a5a6ccdbc572e7b5ec816b8 commit a586fe9c80f7cf2c9a5a6ccdbc572e7b5ec816b8 Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed Jun 9 05:29:16 2021 -0700 Configure GCC with --enable-initfini-array [BZ #27945] Starting from GCC 12, the .init_array and .fini_array sections are enabled unconditionally by commit 13a39886940331149173b25d6ebde0850668d8b9 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Jun 8 16:09:24 2021 -0700 Always enable DT_INIT_ARRAY/DT_FINI_ARRAY on Linux configure GCC with --enable-initfini-array to enable them when using GCC release branches. Fixes BZ #27945.
Fixed for 2.35.