public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Running gdb-14.0.50
@ 2023-03-22 22:56 Nemo Nusquam
  2023-03-23 13:05 ` Rainer Orth
  0 siblings, 1 reply; 4+ messages in thread
From: Nemo Nusquam @ 2023-03-22 22:56 UTC (permalink / raw)
  To: gdb

I downloaded gdb-14.0.50.20230322 and built it with the following 
configuration script.

ABI=64 \
CFLAGS='-m64 -g3 -O0' \
CXXFLAGS='-m64 -g3 -O0' \
SHELL=/usr/bin/bash \
AR=/usr/bin/gar \
AS=/usr/bin/as \
CC=/home/build/gcc/64/bin/gcc \
CXX=/home/build/gcc/64/bin/g++ \
../gdb-14.0.50.20230322/configure \
--with-gmp-prefix=/usr/local \
--with-mpfr-prefix=/usr/local \
--host=sparcv9-sun-solaris11 \
--build=sparcv9-sun-solaris11 \
--enable-64-bit-bfd \
--enable-tui \
--with-curses \
--disable-bootstrap \
--disable-gprof \
--disable-gprofng \
--disable-gold \
--disable-gas \
--disable-sim

Despite specifying both host and build as sparcv9, when I invoke against 
a simple C binary, the following happens.

../../gdb-14.0.50.20230322/gdb/arch-utils.c:753: internal-error: 
initialize_current_architecture: Selection of initial architecture failed
A problem internal to GDB has been detected,

Is there any other option that will specify a build for sparcv9 alone.  
No other architecture will be debugged on this machine (T2000 running 
Solaris 11.3).

Thank you.
N.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Running gdb-14.0.50
  2023-03-22 22:56 Running gdb-14.0.50 Nemo Nusquam
@ 2023-03-23 13:05 ` Rainer Orth
  2023-03-27  0:53   ` Nemo Nusquam
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2023-03-23 13:05 UTC (permalink / raw)
  To: Nemo Nusquam via Gdb; +Cc: Nemo Nusquam

Nemo Nusquam via Gdb <gdb@sourceware.org> writes:

> I downloaded gdb-14.0.50.20230322 and built it with the following
> configuration script.
>
> ABI=64 \

No need for this unless you're using in-tree gmp/mpfr.

> CFLAGS='-m64 -g3 -O0' \
> CXXFLAGS='-m64 -g3 -O0' \

I've asked this before: why do you need a gdb with full debug info?  If
running into problems, start with a bare-minimum configuration,
i.e. omit CFLAGS/CXXFLAGS completely.  If your gcc doesn't create 64-bit
binaries by default, better use CC='gcc -m64' CXX='g++ -m64'.

> SHELL=/usr/bin/bash \

If you really need another shell during the build (although the Solaris
11.3 /bin/sh, which is ksh93, should be good enough), specify
CONFIG_SHELL instead.

> AR=/usr/bin/gar \

No need for this: the build should be fine with either Solaris ar or GNU
ar.  If it's not, please file a bug report.

> AS=/usr/bin/as \

Again: not used in the gdb build (and not the best way for gcc,
either).  Omit.

> --host=sparcv9-sun-solaris11 \
> --build=sparcv9-sun-solaris11 \

Here's your problem: this is a triple gdb knows nothing about, thus the
error when starting.  The real thing is called sparcv9-sun-solaris2.11
(i.e. 2.11 instead of 11) and it's admittedly quite unfortunate that
config.guess doesn't get this right on its own.  Just specify
--build=sparcv9-sun-solaris2.11; the other two (host and target) are set
implicitly from that.

> --enable-64-bit-bfd \
> --enable-tui \
> --with-curses \

I never had a need for any of those.  If you do, please explain.

> --disable-bootstrap \

Again: gcc only; omit.

> Despite specifying both host and build as sparcv9, when I invoke against a
> simple C binary, the following happens.
>
> ../../gdb-14.0.50.20230322/gdb/arch-utils.c:753: internal-error:
> initialize_current_architecture: Selection of initial architecture failed
> A problem internal to GDB has been detected,
>
> Is there any other option that will specify a build for sparcv9 alone.  No
> other architecture will be debugged on this machine (T2000 running Solaris
> 11.3).

Use the correct triple (and omit anything not strictly necessary) and
you should be fine.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Running gdb-14.0.50
  2023-03-23 13:05 ` Rainer Orth
@ 2023-03-27  0:53   ` Nemo Nusquam
  2023-03-27 14:00     ` Rainer Orth
  0 siblings, 1 reply; 4+ messages in thread
From: Nemo Nusquam @ 2023-03-27  0:53 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb

On 2023-03-23 09:05, Rainer Orth wrote:
> Nemo Nusquam via Gdb<gdb@sourceware.org>  writes:
>
>> I downloaded gdb-14.0.50.20230322 and built it with the following
>> configuration script.
>>
>> ABI=64 \
> No need for this unless you're using in-tree gmp/mpfr.

Okay -- I removed this line.

>> CFLAGS='-m64 -g3 -O0' \
>> CXXFLAGS='-m64 -g3 -O0' \
> I've asked this before: why do you need a gdb with full debug info?  If
> running into problems, start with a bare-minimum configuration,
> i.e. omit CFLAGS/CXXFLAGS completely.  If your gcc doesn't create 64-bit
> binaries by default, better use CC='gcc -m64' CXX='g++ -m64'.

Please read the section on the GDB Wiki: Building GDB Natively 
(https://sourceware.org/gdb/wiki/BuildingNatively), where these flags 
are specified.

I moved -m64 to CC/CXX.

>> SHELL=/usr/bin/bash \
> If you really need another shell during the build (although the Solaris
> 11.3 /bin/sh, which is ksh93, should be good enough), specify
> CONFIG_SHELL instead.

Okay -- I removed this line.

>> AR=/usr/bin/gar \
> No need for this: the build should be fine with either Solaris ar or GNU
> ar.  If it's not, please file a bug report.

I removed this option and configure built a Makefile that invoked 
sparcv9-sun-solaris11-ar, so I put it back in.

>> AS=/usr/bin/as \
> Again: not used in the gdb build (and not the best way for gcc,
> either).  Omit.

Okay -- I removed this line.

>> --host=sparcv9-sun-solaris11 \
>> --build=sparcv9-sun-solaris11 \
> Here's your problem: this is a triple gdb knows nothing about, thus the
> error when starting.  The real thing is called sparcv9-sun-solaris2.11
> (i.e. 2.11 instead of 11) and it's admittedly quite unfortunate that
> config.guess doesn't get this right on its own.  Just specify
> --build=sparcv9-sun-solaris2.11; the other two (host and target) are set
> implicitly from that.

Okay -- I added --build=sparcv9-sun-solaris2.11.

>
>> --enable-64-bit-bfd \
>> --enable-tui \
>> --with-curses \
> I never had a need for any of those.  If you do, please explain.

These are leftovers from a very old script.  They were removed.

>> --disable-bootstrap \
> Again: gcc only; omit.

Okay -- I removed the option.

>> Despite specifying both host and build as sparcv9, when I invoke against a
>> simple C binary, the following happens.
>>
>> ../../gdb-14.0.50.20230322/gdb/arch-utils.c:753: internal-error:
>> initialize_current_architecture: Selection of initial architecture failed
>> A problem internal to GDB has been detected,
>>
>> Is there any other option that will specify a build for sparcv9 alone.  No
>> other architecture will be debugged on this machine (T2000 running Solaris
>> 11.3).
> Use the correct triple (and omit anything not strictly necessary) and
> you should be fine.
>
> 	Rainer
>

Here is my final configuration script:

CFLAGS='-g3 -O0' \
CXXFLAGS='-g3 -O0' \
CC="/home/build/gcc/64/bin/gcc -m64" \
CXX="/home/build/gcc/64/bin/g++ -m64" \
../gdb-14.0.50.20230322/configure \
--with-gmp-prefix=/usr/local \
--with-mpfr-prefix=/usr/local \
--build=sparcv9-sun-solaris2.11 \
--disable-binutils \
--disable-gold \
--disable-gprof \
--disable-gas \
--disable-intl \
--disable-ld \
--disable-sim

And here is the configuration reported by the resulting binary.

This GDB was configured as follows:
    configure --host=sparcv9-sun-solaris2.11 
--target=sparcv9-sun-solaris2.11
              --with-auto-load-dir=$debugdir:$datadir/auto-load
              --with-auto-load-safe-path=$debugdir:$datadir/auto-load
              --with-expat
              --with-gdb-datadir=/usr/local/share/gdb (relocatable)
              --with-jit-reader-dir=/usr/local/lib/gdb (relocatable)
              --without-libunwind-ia64
              --with-lzma
              --without-babeltrace
              --without-intel-pt
              --without-xxhash
              --without-python
              --without-python-libdir
              --without-debuginfod
              --with-curses
              --without-guile
              --without-amd-dbgapi
              --disable-source-highlight
              --enable-threading
              --enable-tui
              --with-separate-debug-dir=/usr/local/lib/debug (relocatable)

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)

Thank you.

Sincerely,
N.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Running gdb-14.0.50
  2023-03-27  0:53   ` Nemo Nusquam
@ 2023-03-27 14:00     ` Rainer Orth
  0 siblings, 0 replies; 4+ messages in thread
From: Rainer Orth @ 2023-03-27 14:00 UTC (permalink / raw)
  To: Nemo Nusquam; +Cc: gdb

Nemo Nusquam <cym224@gmail.com> writes:

>>> CFLAGS='-m64 -g3 -O0' \
>>> CXXFLAGS='-m64 -g3 -O0' \
>> I've asked this before: why do you need a gdb with full debug info?  If
>> running into problems, start with a bare-minimum configuration,
>> i.e. omit CFLAGS/CXXFLAGS completely.  If your gcc doesn't create 64-bit
>> binaries by default, better use CC='gcc -m64' CXX='g++ -m64'.
>
> Please read the section on the GDB Wiki: Building GDB Natively
> (https://sourceware.org/gdb/wiki/BuildingNatively), where these flags 
> are specified.

This page is obviously targeted at GDB developers.  Besides, it states

> Of course, you can still do a simple ./configure && make, but you
> might actually want to disable a few projects that don't need to be
> built (and that take a long time to build).

Unless you need to debug gdb with itself, you don't need to build with
-g3 -O0.  So far, you haven't stated what's your goal in building from
a git clone instead of just building the latest release as a regular
user.

>>> AR=/usr/bin/gar \
>> No need for this: the build should be fine with either Solaris ar or GNU
>> ar.  If it's not, please file a bug report.
>
> I removed this option and configure built a Makefile that invoked
> sparcv9-sun-solaris11-ar, so I put it back in.

You absolutely need to remove all remnants of tools with
*-*-solaris11-*: those are using an invalid configure triple and thus of
no use at all, or rather harmful.  If that were
sparcv9-sun-solaris2.11-ar, that's just an alternative name of GNU ar.

>>> --enable-64-bit-bfd \
>>> --enable-tui \
>>> --with-curses \
>> I never had a need for any of those.  If you do, please explain.
>
> These are leftovers from a very old script.  They were removed.

I known: one tends to carry forward stuff like this years after they may
have been necessary.  That's why I insist of starting with the most
basic configure invocation possible and only add stuff if you 200% know
what/why you are doing that.

> Here is my final configuration script:
>
> CFLAGS='-g3 -O0' \
> CXXFLAGS='-g3 -O0' \
> CC="/home/build/gcc/64/bin/gcc -m64" \
> CXX="/home/build/gcc/64/bin/g++ -m64" \
> ../gdb-14.0.50.20230322/configure \
> --with-gmp-prefix=/usr/local \
> --with-mpfr-prefix=/usr/local \
> --build=sparcv9-sun-solaris2.11 \
> --disable-binutils \
> --disable-gold \
> --disable-gprof \
> --disable-gas \
> --disable-intl \
> --disable-ld \
> --disable-sim

Looks sensible indeed, although should should consider removing
CFLAGS/CXXFLAGS for serious use: the defaults can help performance
tremendously ;-)

> And here is the configuration reported by the resulting binary.
[...]
> ("Relocatable" means the directory can be moved with the GDB installation
> tree, and GDB will still find it.)

Indeed: both gdb and gcc can be for quite some time.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-27 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 22:56 Running gdb-14.0.50 Nemo Nusquam
2023-03-23 13:05 ` Rainer Orth
2023-03-27  0:53   ` Nemo Nusquam
2023-03-27 14:00     ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).