Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933282 - app-arch/xz-utils-5.6.2 and previous version fails to build with sys-devel/gcc:13 but builds with sys-devel/gcc:11 (../../src/liblzma/.libs/liblzma.so: undefined reference to `__pthread_cond_timedwait64')
Summary: app-arch/xz-utils-5.6.2 and previous version fails to build with sys-devel/gc...
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PullRequest
: 933528 936633 946483 948023 948582 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-31 21:10 UTC by Andreas
Modified: 2025-01-25 15:39 UTC (History)
12 users (show)

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


Attachments
dev-qt/qtcore-5.15.14 build log (build.log.xz,22.00 KB, application/x-xz)
2024-05-31 21:15 UTC, Andreas
Details
xz-utils build log (build.log,264.56 KB, text/x-log)
2024-05-31 21:35 UTC, Andreas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas 2024-05-31 21:10:39 UTC
app-arch/xz-utils-5.6.2 and previous version
Fails to build with gcc:13 but builds with gcc:11

https://pastebin.com/njhy11xz
build log 

https://pastebin.com/GARXixCr
emerge --info

dev-qt/qtcore-5.15.14
builds with gcc:11
please find the build.log attached.

net-p2p/transmission-4.0.6 and ANY other version of it does NOT build with any gcc,but it was finally built with clang:18

It must be something else.
Plz forward it to whomever appropriate.

Thanks a lot
Andreas
Comment 1 Andreas 2024-05-31 21:15:28 UTC
Created attachment 894759 [details]
dev-qt/qtcore-5.15.14 build log
Comment 2 Greg Kubaryk 2024-05-31 21:20:19 UTC
We need emerge --info as a comment and build.log attached (but it seems you already did the second part); pastebin.com links are no good.
Comment 3 Greg Kubaryk 2024-05-31 21:21:12 UTC
And by already did the second part, I meant that you uploaded a build.log for the incorrect package, so we still need that too. :)
Comment 4 Andreas 2024-05-31 21:35:13 UTC
Created attachment 894760 [details]
xz-utils build log
Comment 5 Andreas 2024-05-31 21:36:36 UTC
Portage 3.0.64 (python 3.11.9-final-0, default/linux/amd64/17.1/desktop, gcc-13, glibc-2.39-r7, 6.1.67-gentoo x86_64)
=================================================================
System uname: Linux-6.1.67-gentoo-x86_64-Intel-R-_Core-TM-_i7-4710HQ_CPU_@_2.50GHz-with-glibc2.39
KiB Mem:    16268848 total,   9138312 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Fri, 31 May 2024 15:15:00 +0000
Head commit of repository gentoo: 44d137b171ab419fd073f3496cb03d5eccd1e6e0
Head commit of repository gentoo-zh: 179380aa434e9bdeee422c2e823de587d706c843

sh bash 5.2_p26-r3
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r3::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.29.3::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.0-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r6::gentoo
dev-lang/python:           3.11.9-r1::gentoo, 3.12.3-r1::gentoo, 3.13.0_beta1_p3::gentoo
dev-lang/rust-bin:         1.77.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           18.1.6::gentoo
sys-devel/gcc:             11.3.0::gentoo, 13.2.1_p20230826::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.6::gentoo
sys-devel/llvm:            18.1.6::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

gentoo-zh
    location: /var/db/repos/gentoo-zh
    sync-type: git
    sync-uri: https://github.com/microcai/gentoo-zh
    masters: gentoo
    volatile: False

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus dri dts dvd dvdr elogind encode exif flac fortran gdbm gif gles2 gpm gtk gui iconv ipv6 jpeg lcms libnotify libtirpc mad matroska mng mp3 mp4 mpeg multilib ncurses nls ogg opengl openmp openssl pam pango pcre pdf pipewire png policykit ppds pulseaudio readline screencast sdl seccomp sound spell split-usr ssl startup-notification svg test-rust theora tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis vpx vulkan wayland wxwidgets x264 xattr xcb xfce xft xml xv xvid xwayland zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="intel nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS



[ebuild   R    ] app-arch/xz-utils-5.6.2::gentoo  USE="extra-filters nls -doc -pgo -static-libs -verify-sig" ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild   R    ] dev-qt/qtcore-5.15.14:5/5.15.14::gentoo  USE="-debug -icu -old-kernel -test" 0 KiB
[ebuild   R    ] net-p2p/transmission-4.0.6::gentoo  USE="cli gtk nls -appindicator -debug -mbedtls -qt5 -qt6 -systemd -test" 0 KiB
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 21:37:21 UTC
Please run the following and share its output in full: echo '#include <pthread.h>' | cpp -dM - | grep USE_TIME.

Is there anything interesting about your system?
Comment 7 Andreas 2024-05-31 21:43:57 UTC
echo '#include <pthread.h>' | cpp -dM - | grep USE_TIME
#define __USE_TIME_BITS64 1


No there is nothing special about my system other than being testing.
Comment 8 Andreas 2024-05-31 22:01:14 UTC
This is any reference of pthread i could find.

eqb pthread.h
 * Searching for pthread.h ... 
sys-devel/gcc-13.2.1_p20230826 (/usr/lib/gcc/x86_64-pc-linux-gnu/13/include-fixed/pthread.h)
sys-libs/glibc-2.39-r7 (/usr/include/pthread.h)

Should I maybe update gcc:13?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 22:39:38 UTC
My guess is that this (somehow) broke with sys-libs/glibc-2.39-r7 which contains https://sourceware.org/git/?p=glibc.git;a=commit;h=dd535f4f19ef2b5c367a362af445ecadcf45401e.

What I don't yet get is why, or why I can't reproduce it.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-31 22:41:03 UTC
(In reply to Andreas from comment #8)
> This is any reference of pthread i could find.
> 
> eqb pthread.h
>  * Searching for pthread.h ... 
> sys-devel/gcc-13.2.1_p20230826
> (/usr/lib/gcc/x86_64-pc-linux-gnu/13/include-fixed/pthread.h)
> sys-libs/glibc-2.39-r7 (/usr/include/pthread.h)
> 
> Should I maybe update gcc:13?

AH, it might make sense if it's caused by fixincludes!!!! Can you try emerge -v1 sys-devel/gcc:13?

(Also, why do you have such an old GCC 13 if you're on ~arch?)
Comment 11 José de Paula Rodrigues 2024-06-03 00:30:31 UTC
I was having this issue when building net-dns/c-ares (undefined reference to `__pthread_cond_timedwait64') as part of upgrading the profile from 17.0 to 23.0. Rebuilding gcc:13 solved the issue (don't forget bug #915389 if you are on amd64 with an Intel *-lake CPU).
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-07 08:59:27 UTC
ago mentioned he hit this the other day to me but I've not had a chance to look yet.

See also https://inbox.sourceware.org/libc-stable/e3ca5f81-b650-4803-92ad-315724a259db@reillybrogan.com/.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-07 09:07:06 UTC
Ah, ago clarified it was upgrading an old chroot. So, the fixincludes theory stands.

We only had fixincludes enabled for a period for new glibc compatibility (been off for years, was on for a bit, now off again).
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-09 09:42:27 UTC
*** Bug 933528 has been marked as a duplicate of this bug. ***
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-09 09:44:22 UTC
I'm somewhat stuck on what the best course of action here is (had another dupe).

I suppose someone (probably me) needs to reproduce this with a fixincludes gcc to prove it's the fault of it. But even then, how do we actually fix this easily on our end? News item and ask people to rebuild? News item asking people to delete the pthreads.h header from the fixincs dir?

On the upstream side, if fixincludes is to blame, we should probably recommend removing/fixing the rule which causes pthreads.h to be mangled (I bet it's at least not relevant on modern Linux systems, so could be made more specific so it's not always applied).
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-25 14:24:10 UTC
*** Bug 936633 has been marked as a duplicate of this bug. ***
Comment 17 LE GARREC Vincent 2024-10-19 16:34:58 UTC
I has this problem for nodejs. My computer wasn't updated for months.

Switching to gcc-14 fixed it. I didn't had to rebuild glibc / libtool.
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 06:51:50 UTC
OK, I found some time after another case came up on IRC to dig into what's happening.

Obviously, there's a lot of lines like:
```
--- pthread.h-fixincludes       2024-12-12 06:49:06.918089635 +0000
+++ /usr/include/pthread.h      2024-12-06 16:49:09.306028087 +0000
[...]
@@ -232,7 +223,7 @@
    the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL.  */
 extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;

-# ifndef __USE_TIME_BITS64
+# ifndef __USE_TIME64_REDIRECTS
```
which is where the build failures come from, which is expected because the fixincludes copy is older. Fine.

(i.e. the changes above aren't from fixincludes but simply old vs new glibc pthread.h.)

The question for me was "why is fixincludes doing anything to this file to begin with", and the answer is:
```
@@ -779,7 +770,7 @@
 #else
 # define __sigsetjmp_cancel(env, savemask) \
   __sigsetjmp ((struct __jmp_buf_tag *) (void *) (env), (savemask))
-extern int __sigsetjmp (struct __jmp_buf_tag *__env,
+extern int __sigsetjmp (struct __jmp_buf_tag __env[1],
                        int __savemask) __THROWNL;
 #endif
```

This dates back to r0-66687-g14bfd7c70da285 added for https://gcc.gnu.org/PR20166:

commit 14bfd7c70da2851692cb29ada892ffa3dff40634
Author: Richard Guenther <rguenth@gcc.gnu.org>
Date:   Mon Mar 21 16:46:09 2005 +0000

    re PR target/20166 (Bootstrap failure due to lack of fixinclude of pthread problem)

    2005-03-21  Richard Guenther  <rguenth@gcc.gnu.org>

            PR target/20166
            * inclhack.def: Add fix for array of incomplete structures
            in function prototype in pthread.h.
            * fixincl.x: Regenerate.
            * tests/base/pthread.h: Adjust.

    From-SVN: r96812
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 06:54:17 UTC
In inclhack.def:
```

+/*
+ * On broken glibc-2.3.3 systems an array of incomplete structures is
+ * passed to __sigsetjmp.  Fix that to take a pointer instead.
+ */
+fix = {
+    hackname  = pthread_incomplete_struct_argument;
+    files     = pthread.h;
+    select    = "struct __jmp_buf_tag";
+    c_fix     = format;
+    c_fix_arg = "%1 *%2%3";
+    c_fix_arg = "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) (__env)\\[1\\](.*)$";
+    test_text = "extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask);";
+};
```

I don't know if there's a way to conditionalise this better, or if we should instead propose dropping this entirely upstream given GCC's baseline is GCC 5.3 or so now.
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 07:02:31 UTC
I've reported https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118009 upstream.

On the Gentoo side, we should:
1) patch out the pattern (irrelevant for any glibc our users will be building with) which will help users building GCC today who are upgrading from an old glibc;
2) make gcc-config or some other cheap-to-build package poke around in /usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/pthread.h to find problematic headers and move them away or warn on them
Comment 21 Larry the Git Cow gentoo-dev 2024-12-12 07:47:10 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d99be77433bf10fb0ce6fc99c7b40de700ed650

commit 7d99be77433bf10fb0ce6fc99c7b40de700ed650
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-12 07:42:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-12 07:46:56 +0000

    toolchain.eclass: stop deleting `install-tools`
    
    Since da19e742f2d45221bec7a70c23903278c28e2664, we deleted anything in
    `install-tools`, but this includes `mkheaders` which is needed to refresh
    fixincludes.
    
    See https://gcc.gnu.org/onlinedocs/gcc/Fixed-Headers.html.
    
    Bug: https://bugs.gentoo.org/933282
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/toolchain.eclass | 4 ----
 1 file changed, 4 deletions(-)

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

commit c048402e74be87600d1842702d79f778d5b59e9c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-12 07:34:20 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-12 07:46:55 +0000

    toolchain.eclass: allow overriding GCC_RUN_FIXINCLUDES
    
    Useful for testing hacks.
    
    Bug: https://bugs.gentoo.org/933282
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 22 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 07:52:55 UTC
pinskia explained the problem: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118009#c4.

TL;DR: It's our fault, it dates back to da19e742f2d45221bec7a70c23903278c28e2664 for the `install-tools` deletion. We need to regenerate fixincludes using `mkheaders` at least after e.g. glibc, linux-headers installs. See https://gcc.gnu.org/onlinedocs/gcc/Fixed-Headers.html.
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 08:03:41 UTC
New plan:
* Should think about if we want to enable fixincludes again unconditionally or perhaps only for prefix (makes a lot of sense on prefix where /usr/include has "hostile" headers we can't fix properly)
* Make gcc-config, portage, glibc, linux-headers (what else?) run `mkheaders` in pkg_postinst if it exists
* Add a way for gcc-config to run it for the active gcc only (?)
Comment 24 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 10:41:14 UTC
So, with the `install-tools` bit dropped:
```
 * CMP: =sys-devel/gcc-14.2.1_p20241207 with sys-devel/gcc-14.2.1_p20241207/image
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/README
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/UnitTest++/Config.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/X11/Xw32defs.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/boost/predef/os/unix.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/nss/secport.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/ntfs-3g/device_io.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/ntfs-3g/realpath.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/pthread.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/tomcrypt_pk.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/xorg/compiler.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/xorg/edid.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/include-fixed/zzip/fetch.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/install-tools/fixinc_list
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/install-tools/gsyslimits.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/install-tools/include/README
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/install-tools/include/limits.h
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/install-tools/macro_list
 *  FILES:+usr/lib/gcc/x86_64-pc-linux-gnu/*/install-tools/mkheaders.conf
 *  FILES:+usr/libexec/gcc/x86_64-pc-linux-gnu/*/install-tools/fixinc.sh
 *  FILES:+usr/libexec/gcc/x86_64-pc-linux-gnu/*/install-tools/fixincl
 *  FILES:+usr/libexec/gcc/x86_64-pc-linux-gnu/*/install-tools/mkheaders
 *  FILES:+usr/libexec/gcc/x86_64-pc-linux-gnu/*/install-tools/mkinstalldirs
```

Indeed, there's a config file at /usr/lib/gcc/x86_64-pc-linux-gnu/14/install-tools/mkheaders.conf, and running `mkheaders` works (without any changes to the config file right now):
```
# /usr/libexec/gcc/x86_64-pc-linux-gnu/14/install-tools/mkheaders -v
Fixing headers into /usr/lib/gcc/x86_64-pc-linux-gnu/14/include-fixed for x86_64-pc-linux-gnu target
Forbidden identifiers: linux unix
Fixed:  X11/Xw32defs.h
Fixed:  boost/predef/os/unix.h
Fixed:  nss/secport.h
Fixed:  ntfs-3g/device_io.h
Fixed:  ntfs-3g/realpath.h
Fixed:  xorg/compiler.h
Fixed:  xorg/edid.h
Fixed:  zzip/fetch.h
Fixed:  pthread.h
Fixed:  tomcrypt_pk.h
Fixed:  UnitTest++/Config.h
fixincludes is done
```
Comment 25 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-12 10:42:56 UTC
It looks like it doesn't do atomic replacement which isn't ideal.
Comment 26 Corin Goodier 2024-12-13 09:43:11 UTC
Had this on another setup converting from 17.1 split-usr profile to 23.0 profile. moving the /usr/lib/gcc/x86_64-pc-linux-gnu/14/include-fixed/pthread.h file out the way allowed xfsprogs to build then ran the /usr/lib/gcc/x86_64-pc-linux-gnu/14/include-fixed and xfsprogs still rebuilds OK.

Portage 3.0.66.1 (python 3.13.1-final-0, default/linux/amd64/23.0/split-usr/no-multilib/hardened, gcc-14, glibc-2.40-r5, 6.1.27-gentoo-r1-x86_64 x86_64)
=================================================================
System uname: Linux-6.1.27-gentoo-r1-x86_64-x86_64-Intel-R-_Xeon-R-_Platinum_8375C_CPU_@_2.90GHz-with-glibc2.40
KiB Mem:    32330396 total,  28111164 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 12 Dec 2024 17:00:01 +0000
Head commit of repository gentoo: 3a506967a8e34950667fce44a0dd33a242a2d216
sh bash 5.2_p37
ld GNU ld (Gentoo 2.39 p6) 2.39.0
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.71-r7::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.30.6::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.5.2::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.11.3::gentoo, 3.12.8::gentoo, 3.13.1::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.55.1::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.39-r5::gentoo, 2.43-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241116::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE no-source-code @EULA linux-firmware intel-ucode linux-fw-redistributable MSttfEULA NVIDIA-r2 MPEG-4 SSPL-1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS=""
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS=""
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j8 -l9"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="acl amd64 audit blake2 bpf bzip2 cet colord crypt curl dbus dracut expat experimental fontconfig gdbm git grub hardened iconv ipv6 ithreads json justify kerberos libtirpc llvm lm-sensors lz4 lzma lzo ncurses newnet nfs nls nscd openmp pam pam_ssh pcre perl pic pie python readline ruby seccomp securetty split-usr ssh ssl ssp stats tcl test-rust threads tinfo tracepath traceroute truetype unicode uuid verify-sig vim-syntax xattr xml xtpax yaml zlib zstd" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="pc" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12 python3_13" RUBY_TARGETS="ruby32 ruby31" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 27 Matt Turner gentoo-dev 2024-12-15 18:04:43 UTC
*** Bug 946483 has been marked as a duplicate of this bug. ***
Comment 28 Larry the Git Cow gentoo-dev 2024-12-25 10:01:43 UTC
The bug has been referenced in the following commit(s):

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

commit f40c02ae8c70eca848890d38010b2776f856bb1a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-12-16 19:44:16 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-25 10:01:22 +0000

    sys-libs/glibc: run fixincludes in pkg_postinst
    
    We enabled fixincludes for a window between GCC 13 and whatever the just
    released version of glibc was at the time to cover Float128 changes. We
    then turned it off again when it was (mostly) no longer needed.
    
    (Though arguably it was/still is needed for some upgrade paths or combinations
    and maybe we should reconsider that given we now have a proper solution here
    to "defanging" fixincludes (as it turns out we were kind of using it wrong,
    see bug #30701)).
    
    Anyway, for any glibc installed during that window, a fixincludes'd pthread.h
    would've been installed to the include-fixed directory, which then becomes
    a cached stale copy when the rest of glibc changes like:
    ```
    --- pthread.h-fixincludes       2024-12-12 06:49:06.918089635 +0000
    +++ /usr/include/pthread.h      2024-12-06 16:49:09.306028087 +0000
    [...]
    @@ -232,7 +223,7 @@
        the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL.  */
     extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
    
    -# ifndef __USE_TIME_BITS64
    +# ifndef __USE_TIME64_REDIRECTS
    ```
    because the guards no longer match up with the rest of glibc.
    
    The fix is for us to refresh fixincludes using `mkheaders` (if available)
    which we weren't installing until recently (7d99be77433bf10fb0ce6fc99c7b40de700ed650)
    in pkg_postinst for sys-libs/glibc. We will likely need to add similar
    logic into linux-headers at least too. I am considering adding such an update
    to gcc-config too.
    
    Note that we also have to cover the case where mkheaders isn't available
    *but* a cached broken pthread.h exists, so if mkheaders doesn't exist, but
    pthread.h does in include-fixed, we move that away to .bak.
    
    Bug: https://gcc.gnu.org/PR20166
    Bug: https://gcc.gnu.org/PR94089
    Bug: https://gcc.gnu.org/PR107059
    Bug: https://gcc.gnu.org/PR118009
    Bug: https://bugs.gentoo.org/30701
    Bug: https://bugs.gentoo.org/933282
    Tested-by: Matt Jolly <kangie@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/glibc/glibc-2.40-r7.ebuild | 23 +++++++++++++++++++++++
 sys-libs/glibc/glibc-9999.ebuild    | 23 +++++++++++++++++++++++
 2 files changed, 46 insertions(+)
Comment 29 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-25 10:07:27 UTC
OK, remaining bits:
1) Revbump glibc to propagate it: I wanted to get this in and discuss with dilfridge when he's available, as we may want to roll a new glibc patchset at the same time;
2) Add something similar into gcc-config? (Either revbump the ebuild and do it in pkg_postinst there, or maybe have gcc-config itself do it, or both?)
3) News item?
Comment 30 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-14 10:22:53 UTC
*** Bug 948023 has been marked as a duplicate of this bug. ***
Comment 31 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-25 15:39:50 UTC
*** Bug 948582 has been marked as a duplicate of this bug. ***