Summary: | sys-devel/gcc-14.2.1_p20241026: build-jit failing, pgo related? (HAVE_LIMITS_H not defined) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Alec Stewart <alec-stewart> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | alec-stewart |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
gcc build logs
emerge --info config.log files from ebuild work directory |
Created attachment 907699 [details]
emerge --info
make[2]: Leaving directory '/var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/build-jit/libiberty' make[2]: Entering directory '/var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/build-jit/libiberty' if [ x"-fpic" != x ]; then \ gcc -c -DHAVE_CONFIG_H -march=alderlake -pipe -O2 -march=alderlake -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=3 -D_GENTOO_TIME64_FORCE=0 -I. -I/var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic -D_GNU_SOURCE -fpic /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c -o pic/fibheap.o; \ else true; fi /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c: In function 'fibheap_replace_key_data': /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: error: 'LONG_MIN' undeclared (first use in this function) 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:220:30: note: in expansion of macro 'FIBHEAPKEY_MIN' 220 | if (okey == key && okey != FIBHEAPKEY_MIN) | ^~~~~~~~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:36:1: note: 'LONG_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>' 35 | #include "fibheap.h" +++ |+#include <limits.h> 36 | /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: note: each undeclared identifier is reported only once for each function it appears in 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:220:30: note: in expansion of macro 'FIBHEAPKEY_MIN' 220 | if (okey == key && okey != FIBHEAPKEY_MIN) | ^~~~~~~~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c: In function 'fibheap_delete_node': /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: error: 'LONG_MIN' undeclared (first use in this function) 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:261:36: note: in expansion of macro 'FIBHEAPKEY_MIN' 261 | fibheap_replace_key (heap, node, FIBHEAPKEY_MIN); | ^~~~~~~~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: note: 'LONG_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>' 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:261:36: note: in expansion of macro 'FIBHEAPKEY_MIN' 261 | fibheap_replace_key (heap, node, FIBHEAPKEY_MIN); | ^~~~~~~~~~~~~~ make[2]: *** [Makefile:794: fibheap.o] Error 1 make[2]: Leaving directory '/var/tmp/portage/por LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-S" I suspect one of your flags is confusing a configure test. Probably -Wl,-S. (In reply to Sam James from comment #3) > LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-S" > > I suspect one of your flags is confusing a configure test. Probably -Wl,-S. Sorry, should've posted what I have for my package.env sys-devel/gcc with-gcc-mold with-gcc-mold env file contents are the following: CC="gcc" CPP="cpp" CXX="g++" LD="ld.bfd" NM="gcc-nm" AR="gcc-ar" RANLIB="gcc-ranlib" STRIP="strip" OBJCOPY="objcopy" OBJDUMP="objdump" CFLAGS="-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480" CXXFLAGS="${CFLAGS}" FCFLAGS="${CFLAGS}" FFLAGS="${CFLAGS}" LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--as-needed" From ebuilding with verbose:
>>> Configuring source in /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026 ...
* strip-flags: CFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe'
* strip-flags: CPPFLAGS: changed '-O2 -march=alderlake -pipe -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fstack-protector-strong -fomit-frame-pointer -D_FORTIFY_SOURCE=3' to '-O2 -march=alderlake -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=3'
* strip-flags: CXXFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe'
* strip-flags: FFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe'
* strip-flags: FCFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe'
* ADAFLAGS=""
* CFLAGS="-march=alderlake -pipe -O2"
* CPPFLAGS="-march=alderlake -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=3 -D_GENTOO_TIME64_FORCE=0"
* CXXFLAGS="-march=alderlake -pipe -O2"
* CCASFLAGS=""
* FFLAGS="-march=alderlake -pipe -O2"
* FCFLAGS="-march=alderlake -pipe -O2"
* LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--sort-common -Wl,--as-needed"
* PREFIX: /usr
* BINPATH: /usr/x86_64-pc-linux-gnu/gcc-bin/14
* LIBPATH: /usr/lib/gcc/x86_64-pc-linux-gnu/14
* DATAPATH: /usr/share/gcc-data/x86_64-pc-linux-gnu/14
* STDCXX_INCDIR: /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14
* Languages: c,c++,fortran
* GCC version: 14.2.1
libiberty/fibheap.c has: ``` #ifdef HAVE_LIMITS_H #include <limits.h> #endif ``` So, why wasn't that defined for you? Your log has: ``` checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes [...] checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes [...] checking for limits.h... no <-- oops! ``` Your log doesn't have gcc-build-logs.tar.xz in it -- this is because toolchain_death_notice doesn't know about build-jit. I'll fix that now. We need the config.log from all subdirs. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d82f81cd65b9a668bd7940151e3fa876d4b0ce92 commit d82f81cd65b9a668bd7940151e3fa876d4b0ce92 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-11-03 09:34:26 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-11-03 09:35:21 +0000 toolchain.eclass: fix death hooks for JIT build We want to recover logs from that too. Bug: https://bugs.gentoo.org/942769 Fixes: 5bed0c77a1c54ac9297db4bb54af2e45c0558ec7 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) Created attachment 907824 [details]
config.log files from ebuild work directory
configure:5434: result: yes configure:5434: checking limits.h presence configure:5434: gcc -E -march=alderlake -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=3 -D_GENTOO_TIME64_FORCE=0 conftest.c In file included from /usr/include/bits/libc-header-start.h:33, from /usr/include/limits.h:26, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/limits.h:210, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/syslimits.h:7, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/limits.h:34, from conftest.c:28: /usr/include/features.h:422:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] 422 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ^~~~~~~ configure:5434: $? = 0 Please try dropping -D_FORTIFY_SOURCE=3. You shouldn't need to set it anyway as hardened profiles do it for you. (In reply to Sam James from comment #9) > configure:5434: result: yes > configure:5434: checking limits.h presence > configure:5434: gcc -E -march=alderlake -pipe -fstack-protector-strong > -D_FORTIFY_SOURCE=3 -D_GENTOO_TIME64_FORCE=0 conftest.c > In file included from /usr/include/bits/libc-header-start.h:33, > from /usr/include/limits.h:26, > from > /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/limits.h:210, > from > /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/syslimits.h:7, > from > /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/limits.h:34, > from conftest.c:28: > /usr/include/features.h:422:4: warning: #warning _FORTIFY_SOURCE requires > compiling with optimization (-O) [-Wcpp] > 422 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) > | ^~~~~~~ > configure:5434: $? = 0 > > Please try dropping -D_FORTIFY_SOURCE=3. You shouldn't need to set it anyway > as hardened profiles do it for you. Dropped it, but it still compiles with -D_FORTIFY_SOURCE=3. if [ x"-fpic" != x ]; then \ gcc -c -DHAVE_CONFIG_H -march=alderlake -pipe -O2 -march=alderlake -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=3 -D_GENTOO_TIME64_FORCE=0 -I. -I/var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic -D_GNU_SOURCE -fpic /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c -o pic/fibheap.o; \ else true; fi /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c: In function 'fibheap_replace_key_data': /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: error: 'LONG_MIN' undeclared (first use in this function) 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:220:30: note: in expansion of macro 'FIBHEAPKEY_MIN' 220 | if (okey == key && okey != FIBHEAPKEY_MIN) | ^~~~~~~~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:36:1: note: 'LONG_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>' 35 | #include "fibheap.h" +++ |+#include <limits.h> 36 | /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: note: each undeclared identifier is reported only once for each function it appears in 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:220:30: note: in expansion of macro 'FIBHEAPKEY_MIN' 220 | if (okey == key && okey != FIBHEAPKEY_MIN) | ^~~~~~~~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c: In function 'fibheap_delete_node': /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: error: 'LONG_MIN' undeclared (first use in this function) 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:261:36: note: in expansion of macro 'FIBHEAPKEY_MIN' 261 | fibheap_replace_key (heap, node, FIBHEAPKEY_MIN); | ^~~~~~~~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:38:25: note: 'LONG_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>' 38 | #define FIBHEAPKEY_MIN LONG_MIN | ^~~~~~~~ /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026/libiberty/fibheap.c:261:36: note: in expansion of macro 'FIBHEAPKEY_MIN' 261 | fibheap_replace_key (heap, node, FIBHEAPKEY_MIN); | ^~~~~~~~~~~~~~ make[2]: *** [Makefile:794: fibheap.o] Error 1 I think that means you likely didn't delete it everywhere. (In reply to Sam James from comment #11) > I think that means you likely didn't delete it everywhere. Interesting...I removed it from the COMMON_FLAGS in my make.conf, even though I've set clang as my default compiler, and it wasn't in the COMMON_FLAGS in my with-gcc-mold env file, which is what gcc is using, and it seems to be compiling normally. The env file, this didn't change between last emerge attempt: CC="gcc" CPP="cpp" CXX="g++" LD="ld.bfd" NM="gcc-nm" AR="gcc-ar" RANLIB="gcc-ranlib" STRIP="strip" OBJCOPY="objcopy" OBJDUMP="objdump" COMMON_FLAGS="-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--sort-common -Wl,--as-needed" And the configuration step of ebuild that strips extra CFLAGS: >>> Configuring source in /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/gcc-14-20241026 ... * strip-flags: CFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe' * strip-flags: CPPFLAGS: changed '-O2 -march=alderlake -pipe -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fstack-protector-strong -fomit-frame-pointer' to '-O2 -march=alderlake -pipe -fstack-protector-strong' * strip-flags: CXXFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe' * strip-flags: FFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe' * strip-flags: FCFLAGS: changed '-O2 -march=alderlake -pipe -mabm -mno-cldemote -mno-kl -mno-sgx -mno-widekl -mshstk -fomit-frame-pointer --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=20480' to '-O2 -march=alderlake -pipe' * ADAFLAGS="" * CFLAGS="-march=alderlake -pipe -O2" * CPPFLAGS="-march=alderlake -pipe -fstack-protector-strong -D_GENTOO_TIME64_FORCE=0" * CXXFLAGS="-march=alderlake -pipe -O2" * CCASFLAGS="" * FFLAGS="-march=alderlake -pipe -O2" * FCFLAGS="-march=alderlake -pipe -O2" * LDFLAGS="-fuse-ld=mold -Wl,-O2 -Wl,--sort-common -Wl,--as-needed" Please share the new logs, ideally the tarball the ebuild makes. |
Created attachment 907698 [details] gcc build logs Hello, found this issue yesterday. The build-jit part of GCC build process seems to be failing. I looked at the Makefile in /var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/build-jit/ with the error shown from the error reported from emake make[1]: Leaving directory '/var/tmp/portage/portage/sys-devel/gcc-14.2.1_p20241026/work/build-jit' make: *** [Makefile:1042: all] Error 2 And lines 1020-1050 are as follows: maybe-configure-target-winsup \ maybe-configure-target-libgloss \ maybe-configure-target-libffi \ maybe-configure-target-zlib \ maybe-configure-target-rda \ maybe-configure-target-libada \ maybe-configure-target-libgm2 \ maybe-configure-target-libgomp \ maybe-configure-target-libitm \ maybe-configure-target-libatomic \ maybe-configure-target-libgrust # The target built for a native non-bootstrap build. .PHONY: all # --enable-pgo-build enables the PGO build. # 1. First build with -fprofile-generate. # 2. Use "make maybe-check-*" to generate profiling data. # 3. Use "make clean" to remove the previous build. # 4. Rebuild with -fprofile-use. all: @: $(MAKE); $(unstage) +@r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) \ $(PGO_BUILD_GEN_FLAGS_TO_PASS) all-host all-target \ && : .PHONY: all-build all-build: maybe-all-build-libiberty So something around PGO is failing...I suppose?