Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716558 - sys-devel/gdb-9.1 doesn't compile when USE=-source-highlight and dev-util/source-highlight not installed
Summary: sys-devel/gdb-9.1 doesn't compile when USE=-source-highlight and dev-util/sou...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-07 10:02 UTC by Jan Postránský
Modified: 2020-04-10 18:12 UTC (History)
1 user (show)

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


Attachments
build.log, emerge --info (report.tar.gz,60.40 KB, application/gzip)
2020-04-07 10:02 UTC, Jan Postránský
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Postránský 2020-04-07 10:02:49 UTC
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.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2020-04-08 06:56:17 UTC
'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
Comment 2 Larry the Git Cow gentoo-dev 2020-04-08 07:43:34 UTC
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(-)
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-04-08 07:57:06 UTC
(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.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-04-10 18:12:20 UTC
(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.