Created attachment 631086 [details] build.log, emerge --info Cross compiling sys-devel/gdb-9.1 fails when the souce-highlight USE flag is disabled and dev-util/source-highlight is not installed: x86_64-w64-mingw32-g++ -x c++ -O2 -pipe -fomit-frame-pointer -mtune=generic -no-pie -fno-pie -fdiagnostics-color=always -I. -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/config -DLOCALEDIR="\"/usr/share/locale\"" -DHAVE_CONFIG_H -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../include/opcode -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../readline/readline/.. -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../zlib -I../bfd -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../bfd -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../include -I../libdecnumber -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../libdecnumber -I./../intl -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/../gnulib/import -I../gnulib/import -I/tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/.. -pthread -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized -Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wno-format -c -o source.o -MT source.o -MMD -MP -MF ./.deps/source.Tpo /tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/source.c /tmp/x86_64-w64-mingw32/portage/sys-devel/gdb-9.1/work/gdb-9.1/gdb/source-cache.c:37:10: fatal error: srchilite/sourcehighlight.h: No such file or directory 37 | #include <srchilite/sourcehighlight.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. I'm cross compiling for the x86_64-w64-mingw32 and i686-w64-mingw32 hosts only the gdb server (USE="lzma multitarget server"). In both cases it fails with the above error. Apparently building gdb requires dev-util/source-highlight even when the source-highlight USE flag is not enabled.
'checking for the source-highlight library... yes' probably found host's source-highlight library. I think there are 3 issues here: 1. USE=-client should not try to pull in source-highlight 2. BUILD's toolchain was used to detect source-highlight, not HOST's 3. USE=-source-highlight had no effect Let's see if [2.] or [3.] can be easily addressed. Meanwhile the workaround can be to pass EXTRA_ECONF=--disable-source-highlight explictly: # EXTRA_ECONF=--disable-source-highlight x86_64-w64-mingw32-emerge -v1 gdb
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bfb04cfc33d12fc397e37f1f1339902e3f3251e commit 1bfb04cfc33d12fc397e37f1f1339902e3f3251e Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-04-08 07:42:55 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-04-08 07:43:28 +0000 sys-devel/gdb: use ${CHOST}-pkg-config, bug #716558 When cross-compiling gdb ./configure found CBUILD's dev-util/source-highlight. That is never correct as client is supposed to be running on CHOST. The change switches to CHOST's PKG_CONFIG. Reported-by: Jan Postránský Bug: https://bugs.gentoo.org/716558 Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> sys-devel/gdb/gdb-9.1.ebuild | 5 ++++- sys-devel/gdb/gdb-9999.ebuild | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)
(In reply to Sergei Trofimovich from comment #1) > 'checking for the source-highlight library... yes' probably found host's > source-highlight library. > > I think there are 3 issues here: > 1. USE=-client should not try to pull in source-highlight > 2. BUILD's toolchain was used to detect source-highlight, not HOST's > 3. USE=-source-highlight had no effect [2.] should be fixed by https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bfb04cfc33d12fc397e37f1f1339902e3f3251e [1.] and [3.] is an interesting effect of gdb-9.1-specific breakage. We started building gdb out-ouf-tree as this release has a limitation of not supporting build tree. But migration of out-of-tree build broke the sace of USE="server -client": gdb-9999:src_configure() (ok): if use server && ! use client ; then cd gdb/gdbserver fi econf gdb-9.1:src_configure() (bad): if use server && ! use client ; then cd gdb/gdbserver fi pushd "${GDB_BUILD_DIR}" || die ECONF_SOURCE=${S} econf popd Note: we lost 'cd gdb/gdbserver' effect completely.
(In reply to Sergei Trofimovich from comment #3) > (In reply to Sergei Trofimovich from comment #1) > > 'checking for the source-highlight library... yes' probably found host's > > source-highlight library. > > > > I think there are 3 issues here: > > 1. USE=-client should not try to pull in source-highlight > > 2. BUILD's toolchain was used to detect source-highlight, not HOST's > > 3. USE=-source-highlight had no effect > > [2.] should be fixed by > https://gitweb.gentoo.org/repo/gentoo.git/commit/ > ?id=1bfb04cfc33d12fc397e37f1f1339902e3f3251e > > [1.] and [3.] is an interesting effect of gdb-9.1-specific breakage. Let's rely on [2.] alone. Next gdb release should clean it up.