From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 073B63858D33 for ; Wed, 8 Mar 2023 22:19:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 073B63858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id D5C8317F2C; Wed, 8 Mar 2023 23:19:27 +0100 (CET) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XPXLTyt-TI_P; Wed, 8 Mar 2023 23:19:27 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855b0c.dip0.t-ipconnect.de [80.133.91.12]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 10A7117E99; Wed, 8 Mar 2023 23:19:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1678313967; bh=LD5QqO8crM90kw2EIR8xaiyIXkpbvVbuNHzuXRN3t6A=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=gD1OyA+56Pz9eu0xX+A53a5m4hloIGklm0jWIl/3T49mGRVZQzSD0wRx2bNYTHa1Q EtPZU2cYZ8jaZmXPTIO5bEoatUZjHrl0dq/BPWTVFzXXbngCvFwhob0LooyWd19WR+ yJAGLg30rJbVVmCbwdX0Z0+h8eKoauiQGGukiJlTExn1U5vcHhCq5BVNsMx0bB2c9Z voeJN2B81AvsJbUZ6naQKGHT/B3BcGlKtXuBo2QQfeVUCOl9nsWc/oCif+GD2CH2nL Hb4TYzUr5ckKOLTo8hUKirLKR3m1ZrwCHy2NyTWj7nBDzZRN6WTgwQbWzSd/YtL2qQ cnLSxNX9Rvq+w== From: Rainer Orth To: Nemo Nusquam via Gdb Cc: Nemo Nusquam Subject: Re: Unable to build GDB 13.1 on Solaris 11.3 Sparc References: Date: Wed, 08 Mar 2023 23:19:26 +0100 In-Reply-To: (Nemo Nusquam via Gdb's message of "Wed, 8 Mar 2023 16:33:48 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3784.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Nemo Nusquam via Gdb writes: > I am trying (and failing) to build GDB 13.1 on Solaris 11.3 Sparc. > > Here is my configuration script. > > CXXFLAGS=3D'-g3 -O0' \ > CFLAGS=3D'-g3 -O0' \ Why? Do you want/need to debug the resulting gdb itself? Otherwise, just leave the defaults (-g -O2). > NM=3D/usr/bin/gnm \ > SHELL=3D/usr/bin/bash \ Probably rather CONFIG_SHELL. Btw., it's often best to have /usr/gnu/bin before /usr/bin in $PATH: configure scripts sometimes assume the GNU tools and fail in weird ways with the native ones. > AR=3D/usr/bin/gar \ > AS=3D/usr/bin/as \ Unnecessary for gdb. Even when building gcc, use --with-as=3D/usr/bin/as --without-gnu-as as documented in the installation guide. Relying on $PATH is risky and fragile. > CC=3D/home/build/gcc/git/bin/gcc \ > CXX=3D/home/build/gcc/git/bin/g++ \ I suppose this is a 32-bit-default gcc (i.e. configured for sparc-sun-solaris2.11, not sparcv9-sun-solaris2.11)? Any reason not to use the bundled gcc 7.3.0? That one is 64-bit-default. > ../configure \ > --with-mpc=3D/usr/local \ > --with-gmp=3D/usr/local \ > --with-mpfr=3D/usr/local \ > --enable-64-bit-bfd \ > --enable-tui \ > --with-curses \ > --disable-bootstrap \ This is gcc only, thus unnecessary for a gdb build. > --disable-binutils \ > --disable-ld \ > --disable-gprof \ > --disable-gprofng \ > --disable-gold \ > --disable-gas \ > --disable-sim If you're building from the gdb 13.1 tarball, you can omit those. Btw., --disable-binutils is harmful: gdb depends on libbfd and won't link without, as you've discovered. > (Some flags taken from https://sourceware.org/gdb/wiki/BuildingNatively .) In general, please start with the bare minimum of configure flags (like the --with-* stuff). Unless you known 200% what you're doing, additional flags usually cause more harm then anything. > The makefile creates ./gdb inside the build directory and then stops as > follows: > > checking for libgmp... no > configure: error: GMP is missing or unusable > gmake[1]: *** [Makefile:11447: configure-gdb] Error 1 > gmake[1]: Leaving directory '/home/build/opt/gdb-13.1/bld' You can find the exact errors in gdb/config.log. Consulting that is usually necessary to determine what exactly went wrong. > I have libgmp (and building gcc 13 uses it) in /usr/local/lib: > > /usr/local/lib/libgmp.a:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 curren= t ar archive, 32-bit symbol table > /usr/local/lib/libgmp.la:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 commands te= xt > /usr/local/lib/libgmp.so:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ELF 64-bit = MSB dynamic lib SPARCV9 Version > 1, UltraSPARC3 Extensions Required, dynamically linked, not stripped, no > debugging information available > /usr/local/lib/libgmp.so.10:=C2=A0=C2=A0=C2=A0 ELF 64-bit MSB dynamic lib= SPARCV9 Version > 1, UltraSPARC3 Extensions Required, dynamically linked, not stripped, no > debugging information available > /usr/local/lib/libgmp.so.10.4.1:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ELF 64-bit MSB dynamic lib SPARCV9 > Version 1, UltraSPARC3 Extensions Required, dynamically linked, not > stripped, no debugging information available > > Now I note that the Makefile is compiling to 32-bit objects but I have a > 32-bit libgmp.a.=C2=A0 (I tried adding "-m64" but that caused other probl= ems.) Such as? Please include the details so we can help. > I am stumped.=C2=A0 How do I proceed? Since your libgmp is 64-bit, you need to ensure a 64-bit build. You can achieve this either by using a 64-bit-default gcc/g++ or adding -m64 to CC/CXX. Adding it to CFLAGS/CXXFLAGS often doesn't work as expected, unfortunately. You should also add --build sparcv9-sun-solaris2.11 to the configure flags. config.guess has been badly messed with on Solaris in recent times and misdetects the 64-bit triple. I've given up fighting the upstream chaos here and usually specify the correct triple explicitly. Hope this helps. Rainer --=20 ---------------------------------------------------------------------------= -- Rainer Orth, Center for Biotechnology, Bielefeld University