Bug 27945 - build-many-glibcs.py doesn't configure GCC with --enable-initfini-array
Summary: build-many-glibcs.py doesn't configure GCC with --enable-initfini-array
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: 2.34
: P2 normal
Target Milestone: 2.35
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-03 01:00 UTC by H.J. Lu
Modified: 2021-11-05 23:35 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2021-06-03 01:00:51 UTC
There is no reason for build-many-glibcs.py not to configure GCC with
--enable-initfini-array.
Comment 1 jsm-csl@polyomino.org.uk 2021-06-03 18:04:49 UTC
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.
Comment 2 H.J. Lu 2021-06-03 19:40:57 UTC
I opened

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100896

In the meantime, --enable-initfini-array should be passed to GCC configure.
Comment 3 Sourceware Commits 2021-11-05 22:30:29 UTC
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.
Comment 4 H.J. Lu 2021-11-05 23:35:03 UTC
Fixed for 2.35.