Fix compilation on RISC-V

Use 32-bit manglings in the libstdc++ nonshared .hidden list (fixes i686)

Do not assert .hidden on _M_release_last_use_cold, which is not emitted on riscv64 nor on i686

Do not assert .hidden on a libstdc++ instantiation that is not emitted below x86-64-v3 (fixes x86_64_v2)

Do not assert .hidden on _Sp_counted_ptr<nullptr_t>::_M_dispose, which is not emitted on riscv64

Do not assert .hidden on _Sp_counted_base<_S_atomic>::_M_destroy, which is not emitted on riscv64

Do not assert .hidden on __to_chars_10_impl<unsigned long>, which is not emitted on riscv64

Do not assert .hidden on the _Sp_counted_base typeinfo name, which is not emitted on riscv64

Do not assert .hidden on __get_leap_second_info, which is not emitted on i686

Refresh the ILP32 _M_visit manglings RH did not regenerate for 16.2.1 (fixes i686)

Set --with-arch_64=x86-64-v2 on v2 arch
This commit is contained in:
Eduard Abdullin 2026-09-04 06:16:25 +00:00 committed by root
parent 1a2ba3c592
commit 3f6db4064d
2 changed files with 18 additions and 2 deletions

View File

@ -186,7 +186,7 @@ BuildRequires: gcc-toolset-%{gts_ver}-devel
Summary: GCC version %{gcc_major}
Name: %{?scl_prefix}gcc
Version: %{gcc_version}
Release: %{gcc_release}.1%{?dist}.alma.1
Release: %{gcc_release}.1%{?dist}.alma.2
# License notes for some of the less obvious ones:
# gcc/doc/cppinternals.texi: Linux-man-pages-copyleft-2-para
# isl: MIT, BSD-2-Clause
@ -3090,7 +3090,7 @@ fi
%endif
%changelog
* Fri Sep 04 2026 Eduard Abdullin <eabdullin@almalinux.org> - 16.2.1-1.1.alma.1
* Fri Sep 04 2026 Eduard Abdullin <eabdullin@almalinux.org> - 16.2.1-1.1.alma.2
- Fix compilation on RISC-V
- Use 32-bit manglings in the libstdc++ nonshared .hidden list (fixes i686)
- Do not assert .hidden on _M_release_last_use_cold, which is not emitted on
@ -3103,6 +3103,8 @@ fi
emitted on riscv64
- Do not assert .hidden on __to_chars_10_impl<unsigned long>, which is not
emitted on riscv64
- Do not assert .hidden on the _Sp_counted_base typeinfo name, which is not
emitted on riscv64
- Do not assert .hidden on __get_leap_second_info, which is not emitted on i686
- Refresh the ILP32 _M_visit manglings RH did not regenerate for 16.2.1 (fixes
i686)

View File

@ -123,3 +123,17 @@
asm (".hidden _ZNSt6chrono11locate_zoneESt17basic_string_viewIcSt11char_traitsIcEE");
asm (".hidden _ZNSt6chrono11reload_tzdbEv");
asm (".hidden _ZNSt6chrono12current_zoneEv");
@@ -57,7 +74,13 @@
asm (".hidden _ZTISt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE");
asm (".hidden _ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE");
asm (".hidden _ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE");
+/* Not emitted on riscv64: gcc emits no vtable for _Sp_counted_base in this
+ TU -- cf. _M_dispose and _M_destroy above -- and the typeinfo name is
+ emitted with the vtable, so the bare .hidden would leave an undefined
+ hidden symbol in libstdc++_nonshared140.a. */
+#if !defined(__riscv)
asm (".hidden _ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE");
+#endif
asm (".hidden _ZTSSt19_Sp_make_shared_tag");
asm (".hidden _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag");
asm (".hidden _ZGVNSt8__format11_ChronoDataIcE7_S_argsE");