This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/22206] New: [8.1 regression] SPARC M7 ADI patches break Solaris build


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

            Bug ID: 22206
           Summary: [8.1 regression] SPARC M7 ADI patches break Solaris
                    build
           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
                CC: weimin.pan at oracle dot com
  Target Milestone: ---
            Target: sparc*-sun-solaris2.*

Created attachment 10480
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10480&action=edit
Minimal patch

The recent SPARC M7 ADI patches break the gdb build on Solaris/SPARC
(which is a total shame: feels like one side of Oracle doesn't care about what
the
other side is doing ;-().  I'm seeing it on Solaris 10/SPARC, haven't tried
11.3
or 11.4 beta yet:

/vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:1876:0: error: "PSR_ICC"
redefined [-Werror]
 #define PSR_ICC  0x00f00000
 ^
In file included from /usr/include/v7/sys/privregs.h:24:0,
                 from /usr/include/sys/regset.h:420,
                 from /usr/include/sys/ucontext.h:21,
                 from /usr/include/sys/signal.h:231,
                 from /usr/include/sys/procset.h:23,
                 from /usr/include/sys/wait.h:25,
                 from /usr/include/stdlib.h:21,
                 from build-gnulib/import/stdlib.h:36,
                 from /vol/src/gnu/gdb/gdb/local/gdb/common/common-defs.h:53,
                 from /vol/src/gnu/gdb/gdb/local/gdb/defs.h:28,
                 from /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:20:
/usr/include/v7/sys/psr.h:35:0: note: this is the location of the previous
definition
 #define PSR_ICC  0x00F00000 /* integer condition codes */
 ^
/vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:1878:0: error: "PSR_IMPL"
redefined [-Werror]
 #define PSR_IMPL 0xf0000000
 ^
In file included from /usr/include/v7/sys/privregs.h:24:0,
                 from /usr/include/sys/regset.h:420,
                 from /usr/include/sys/ucontext.h:21,
                 from /usr/include/sys/signal.h:231,
                 from /usr/include/sys/procset.h:23,
                 from /usr/include/sys/wait.h:25,
                 from /usr/include/stdlib.h:21,
                 from build-gnulib/import/stdlib.h:36,
                 from /vol/src/gnu/gdb/gdb/local/gdb/common/common-defs.h:53,
                 from /vol/src/gnu/gdb/gdb/local/gdb/defs.h:28,
                 from /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:20:
/usr/include/v7/sys/psr.h:41:0: note: this is the location of the previous
definition
 #define PSR_IMPL 0xF0000000 /* implementation */
 ^

/vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c: In function ‘int adi_tag_fd()’:
/vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:296:63: error: format ‘%d’
expects argument of type ‘int’, but argument 4 has type ‘pid_t {aka long int}’
[-Werror=format=]
   snprintf (cl_name, sizeof(cl_name), "/proc/%d/adi/tags", pid);
                                                               ^
/vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c: In function ‘bool
adi_is_addr_mapped(CORE_ADDR, std::size_t)’:
/vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:314:64: error: format ‘%d’
expects argument of type ‘int’, but argument 4 has type ‘pid_t {aka long int}’
[-Werror=format=]
   snprintf (filename, sizeof filename, "/proc/%d/adi/maps", pid);
                                                                ^

The attached patch at least allows the build to finish, but there are way
more problems with this code (only from a quick inspection):

* The Solaris/SPARC codes doesn't make use of/support ADI; it's currently 
  Linux-only.

* Some of the new code in sparc64-tdep.c is Linux-specific, although this is
  supposed to be platform-independent code:

** ADI support in procfs is way different from the way used here, which is
   Linux-specific.

** Same for ADI support in auxv: none of AT_ADI_BLKSZ, AT_ADI_NBITS, and
   AT_ADI_UEONADI exist on Solaris, and the latter is unused beside its
   definition.

  Rainer

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]