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

--- Comment #21 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <[email protected]>:

https://gcc.gnu.org/g:9d02b118ee10506f90c7cf0e439108f48d370fc1

commit r16-8714-g9d02b118ee10506f90c7cf0e439108f48d370fc1
Author: Jonathan Wakely <[email protected]>
Date:   Wed Mar 11 21:05:13 2026 +0000

    libstdc++: Add module initialization functions to the library [PR124268]

    This tries to ensure that the module init functions are present in
    libstdc++.so and libstdc++.a, so that users of the std and std.compat
    modules don't need to manually link to std.o and/or std.compat.o in
    addition to compiling the CMIs.

    This also adds a clean-local target to remove the generated interface
    units and manifest, and the gcm.cache directory for the CMIs.

    This was previously committed and then reverted because it broke
    bootstrap on a few targets. Most of the reasons the module interface
    units failed to compile have (we believe) now been addressed with G++
    changes, although there's still a problem on amdgcn (PR124554). Due to
    that problem, and any not yet known problems, this version of the patch
    tries to avoid breaking bootstrap again by allowing the modules to fail
    to compile. If compiling std.o or std.compat.o fails then an empty
    translation unit will be compiled and added to libstdc++.so instead.

    This means that we will only export the module initialization functions
    from the library if the module can be compiled for the target. This
    seems fine because we don't need to initialize anything for a module
    that cannot even be compiled! Fixing PR124554 and removing this kluge
    should be done for GCC 17 in stage 1.

    libstdc++-v3/ChangeLog:

            PR libstdc++/124268
            * config/abi/pre/gnu.ver: Export symbols.
            * src/Makefile.am: Add libmodulesconvenience.la to libstdc++
            link.
            * src/Makefile.in: Regenerate.
            * src/c++23/Makefile.am: Create libmodulesconvenience.la
            and populate it with std.o and std.compat.o interface units,
            with empty fallback objects if compiling the interface units
            fails. Add clean-local target.
            * src/c++23/Makefile.in: Regenerate.

Reply via email to