public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/25981] New: Use of short i386 register names breaks compilation on recent Solaris 11.4
@ 2020-05-13  8:42 ro at gcc dot gnu.org
  2020-05-13  8:43 ` [Bug build/25981] " ro at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ro at gcc dot gnu.org @ 2020-05-13  8:42 UTC (permalink / raw)
  To: gdb-prs

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.

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

end of thread, other threads:[~2020-05-19  8:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  8:42 [Bug build/25981] New: Use of short i386 register names breaks compilation on recent Solaris 11.4 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
2020-05-19  8:15 ` ro at gcc dot gnu.org

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).