public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug build/25981] Use of short i386 register names breaks compilation on recent Solaris 11.4
Date: Tue, 19 May 2020 08:07:15 +0000	[thread overview]
Message-ID: <bug-25981-4717-lkfFqbr8ll@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25981-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25981

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-9-branch branch has been updated by Rainer Orth <ro@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3bfcbaaa2b23824b1584d2782be64820e4a35acb

commit 3bfcbaaa2b23824b1584d2782be64820e4a35acb
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Tue May 19 10:06:00 2020 +0200

    Avoid short i386 register names on Solaris/x86 [PR25981]

    This is the 32-bit companion to

            Remove unused ps_lgetLDT etc. on Solaris/x86 [PR25981]
            https://sourceware.org/pipermail/gdb-patches/2020-May/168713.html

    A 32-bit-default gdb fails to compile with the updated <sys/regset.h>.
    While it is also affected by the lack of a GS definition, which the
    compantion patch above fixes, it also fails to compile i386-sol2-nat.c like
    this

    /vol/src/gnu/gdb/hg/master/git/gdb/i386-sol2-nat.c:181:3: error: 'EAX' was
not declared in this scope
      181 |   EAX, ECX, EDX, EBX,
          |   ^~~

    and several more.

    While this could be fixed by either including <ucontext.h> here or
    provding fallback definitions of the register macros, I chose to do what
    the 64-bit-default code in the same file
    (amd64_sol2_gregset32_reg_offset[]) does, namely just hardcode the
    numeric values instead.  They are part of the ABI and thus guaranteed
    not to change.

    With this patch, a i386-pc-solaris2.11 configuration on master compiles
    again, however, it doesn't work.  However, I could successfully test it
    on the gdb-9 branch.

    Compiling and testing proved to be messy, unfortunately:

    * For one, Solaris <sys/procfs.h> and largefile support used to be
      mutually exclusive (fixed in Solaris 11.4 and Illumos), which was
      exacerbated by the fact that g++ predefines _FILE_OFFSET_BITS=64 since
      GCC 9.1.0.  For now I've worked around this by adding
      -U_FILE_OFFSET_BITS to CXXFLAGS and configuring with
      --disable-largefile.  I hope to clean this up in a future patch.

    * gdb still defaults to startup-with-shell on.  However, /bin/bash is a
      64-bit executable which cannot be debugged by a 32-bit gdb.  I hacked
      around that part by pointing $SHELL at a 32-bit bash before running
      make check.

            PR build/25981
            * i386-sol2-nat.c [PR_MODEL_NATIVE != PR_MODEL_LP64] (regmap):
            Hardcode register numbers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-05-19  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  8:42 [Bug build/25981] New: " ro at gcc dot gnu.org
2020-05-13  8:43 ` [Bug build/25981] " ro at gcc dot gnu.org
2020-05-18 14:13 ` brobecker at gnat dot com
2020-05-18 15:57 ` cvs-commit at gcc dot gnu.org
2020-05-18 16:01 ` cvs-commit at gcc dot gnu.org
2020-05-19  8:04 ` cvs-commit at gcc dot gnu.org
2020-05-19  8:07 ` cvs-commit at gcc dot gnu.org [this message]
2020-05-19  8:15 ` ro at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25981-4717-lkfFqbr8ll@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).