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

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

            Bug ID: 25981
           Summary: Use of short i386 register names breaks compilation on
                    recent Solaris 11.4
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: 10.1
              Host: amd64-pc-solaris2.11, i386-pc-solaris2.11
            Target: amd64-pc-solaris2.11, i386-pc-solaris2.11
             Build: amd64-pc-solaris2.11, i386-pc-solaris2.11

A future Solaris 11.4 SRU will soon remove the short i386 register names (like
UESP, GS, ...) from <sys/regset.h>.  They can unexpectedly leak into user code
in some circumstances and pollute the user's namespace.

They will only remain in <ucontext.h> since the are prescribed by the i386
psABI
to be present when that header is included.

This change breaks gdb compilation on both 64 and 32-bit Solaris/x86:

* On both amd64 and i386, procfs.c doesn't compile:

/vol/src/gnu/gdb/hg/master/git/gdb/procfs.c: In function 'ssd*
procfs_find_LDT_entry(ptid_t)':
/vol/src/gnu/gdb/hg/master/git/gdb/procfs.c:1643:18: error: 'GS' was not
declared in this scope
 1643 |   key = (*gregs)[GS] & 0xffff;
      |                  ^~
make[2]: *** [Makefile:1607: procfs.o] Error 1

* On i386 only, i386-sol2-nat.c doesn't compile:

/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 many more.

Both can be easily fixed: procfs_find_LDT_entry has long been obsolete and can
simply go, and i386-sol2-nat.c can just hardcode the register numbers as the
64-bit counterpart already does.

Patches forthcoming; I'm just filing this PR since the changes should also go
into the gdb-9 branch which needs the PR to go forward.

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

             reply	other threads:[~2020-05-13  8:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  8:42 ro at gcc dot gnu.org [this message]
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
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@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).