Add AS_NEEDED libstdc++.so.6 when only needed through libstdc++_nonshared

Resolves: RHEL-84606
This commit is contained in:
Siddhesh Poyarekar 2025-05-22 06:24:07 -04:00 committed by Siddhesh Poyarekar
parent cea7e675cb
commit 5f42e0e25f

View File

@ -11,7 +11,7 @@ BuildRequires: scl-utils-build
%global gcc_major 14
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 8
%global gcc_release 9
%global nvptx_tools_gitrev 87ce9dc5999e5fca2e1d3478a30888d9864c9804
%global newlib_cygwin_gitrev d45261f62a15f8abd94a1031020b9a9f455e4eed
%global isl_version 0.24
@ -1041,11 +1041,13 @@ make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z
make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z,now profiledbootstrap
%endif
%define libstdcxx_so %{?scl:%{_root_prefix}}%{!?scl:%{_prefix}}/%{_lib}/libstdc++.so.6
echo '/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
%{oformat}
INPUT ( %{?scl:%{_root_prefix}}%{!?scl:%{_prefix}}/%{_lib}/libstdc++.so.6 -lstdc++_nonshared%{nonsharedver} )' \
INPUT ( %{libstdcxx_so} -lstdc++_nonshared%{nonsharedver} AS_NEEDED (%{libstdcxx_so}) )' \
> %{gcc_target_platform}/libstdc++-v3/src/.libs/libstdc++_system.so
%if 0
@ -2801,6 +2803,10 @@ fi
%endif
%changelog
* Thu May 22 2025 Siddhesh Poyarekar <siddhesh@redhat.com> 14.2.1-9
- Add AS_NEEDED libstdc++.so.6 when only needed through libstdc++_nonshared
(RHEL-84606)
* Thu May 22 2025 Siddhesh Poyarekar <siddhesh@redhat.com> 14.2.1-8
- libstdc++: Fix -Warray-bounds warning in std::vector<bool> (RHEL-49861)