Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 945920 - =sys-devel/gcc-15.0.0_pre20241201: build failure: TlsPreTcbSize' was not declared in this scope
Summary: =sys-devel/gcc-15.0.0_pre20241201: build failure: TlsPreTcbSize' was not decl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: gcc-15
  Show dependency tree
 
Reported: 2024-12-05 17:34 UTC by Michael Orlitzky
Modified: 2025-05-07 11:23 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gcc-build.log.xz (gcc-build.log.xz,152.85 KB, application/x-xz)
2024-12-05 20:24 UTC, Michael Orlitzky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2024-12-05 17:34:36 UTC
/var/lib/portage/tmp/portage/sys-devel/gcc-15.0.0_pre20241201/work/gcc-15-20241201/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp: In function 'void __sanitizer::GetTls(uptr*, uptr*)':
/var/lib/portage/tmp/portage/sys-devel/gcc-15.0.0_pre20241201/work/gcc-15-20241201/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:627:29: error: 'TlsPreTcbSize' was not declared in this scope
  627 |   const uptr pre_tcb_size = TlsPreTcbSize();
      |                             ^~~~~~~~~~~~~                                                                                                              
make[4]: *** [Makefile:631: sanitizer_linux_libcdep.lo] Error 1


I had this same problem with an earlier snapshot but was in too much of a hurry to report it, and worked around it by disabling some USE flags:

  $ emerge -pv1 gcc
  [ebuild     U *] sys-devel/gcc-15.0.0_pre20241201:15::gentoo
  [15.0.0_pre20241117-r2:15::gentoo] USE="(cxx) (default-stack-clash-protection)
  (default-znow) fortran* hardened jit* lto* openmp (pie) sanitize* ssp (-ada)
  (-cet) (-custom-cflags) -d -debug -doc (-fixed-point) -go -graphite
  (-ieee-long-double) -libgdiagnostics% (-libssp) -modula2 (-multilib) (-nls)
  -objc -objc++ -objc-gc (-pch) -pgo -rust (-systemtap) -test (-time64)
  (-valgrind) -vanilla (-vtv) -zstd" 0 KiB

As you can see, I disabled fortran, jit, lto, and sanitize to get it to build. From the error it looks like USE=sanitize to me. This is on riscv/musl. My eselected GCC is still hardened 14.2.1.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-05 17:36:17 UTC
There was a libsanitizer import recently (specifically to fix issues on riscv, actually!) so I guess that's to blame.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-05 17:37:17 UTC
Can you give me the full build.log please so I can pass it on?
Comment 3 Michael Orlitzky gentoo-dev 2024-12-05 20:24:12 UTC
Created attachment 913415 [details]
gcc-build.log.xz

Sure thing.
Comment 4 Michael Orlitzky gentoo-dev 2025-02-18 23:13:05 UTC
Let it build again today to see if anything had changed, but same thing:

/var/lib/portage/tmp/portage/sys-devel/gcc-15.0.1_pre20250216/work/gcc-15-2025\
0216/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:627:29: error: \
'TlsPreTcbSize' was not declared in this scope
  627 |   const uptr pre_tcb_size = TlsPreTcbSize();
Comment 5 Larry the Git Cow gentoo-dev 2025-05-07 11:21:10 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=485d5bafcc11703825cb6c3cf7ce2cdd246fb7b1

commit 485d5bafcc11703825cb6c3cf7ce2cdd246fb7b1
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-05-07 11:19:38 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-05-07 11:19:38 +0000

    15.1.0: fix libsanitizer build on riscv/musl
    
    Bug: https://gcc.gnu.org/PR119356
    Bug: https://bugs.gentoo.org/945920
    Signed-off-by: Sam James <sam@gentoo.org>

 .../85_all_PR119356-riscv-libsanitizer.patch       | 102 +++++++++++++++++++++
 15.1.0/gentoo/README.history                       |   1 +
 2 files changed, 103 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2025-05-07 11:23:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ba10a7b8126a5f651a272fa06424d75b1de5be9

commit 3ba10a7b8126a5f651a272fa06424d75b1de5be9
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-05-07 11:21:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-05-07 11:21:32 +0000

    sys-devel/gcc: fix libsanitizer build on riscv/musl for 15
    
    Bug: https://gcc.gnu.org/PR119356
    Bug: https://bugs.gentoo.org/945920
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                    | 4 ++--
 sys-devel/gcc/gcc-15.1.0.ebuild           | 8 ++++----
 sys-devel/gcc/gcc-15.1.1_p20250426.ebuild | 8 ++++----
 sys-devel/gcc/gcc-15.1.1_p20250503.ebuild | 8 ++++----
 4 files changed, 14 insertions(+), 14 deletions(-)