This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fix gdb 8.1 Solaris/SPARC compilation (PR build/22206)
- From: Pedro Alves <palves at redhat dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>, gdb-patches at sourceware dot org
- Cc: Weimin Pan <weimin dot pan at oracle dot com>
- Date: Tue, 26 Sep 2017 12:33:16 +0100
- Subject: Re: Fix gdb 8.1 Solaris/SPARC compilation (PR build/22206)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 43F302C974B
- References: <yddfub9x0rp.fsf@CeBiTec.Uni-Bielefeld.DE>
On 09/26/2017 10:33 AM, Rainer Orth wrote:
> Apart from the capitalization differences that trip g++, the names
> differ (PSR_VER vs. PSR_VERS), PSR_XCC is included in Solaris' PSR_RSV,
> and there's no PSR_V8PLUS on Solaris either.
What you've done is fine with me to unbreak the build. Though
I'd prefer if we renamed those to avoid ever relying on host
symbols, anywhere. Like:
- #define PSR_S ...
+ #define SPARC64_PSR_S ...
etc.
>
> /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);
> ^
>
> You cannot always print a pid_t, which can be either int or long on
> Solaris, as an int.
>
> Obviously, the ADI patch which modifies code shared between all SPARC
> targets, hasn't been tested on anything but Linux/SPARC.
>
> The patch below includes the minimal fixes necessary to unbreak the
> Solaris/SPARC build.
>
> However, as detailed in the PR, there's more breakage here: apart from
> not bothering to implement ADI support on Solaris, the code contains
> several more changes to shared/common SPARC code that are simply wrong
> on anything but Linux/SPARC.
>
> The patch was tested on sparcv9-sun-solaris2.10 and
> sparcv9-sun-solaris2.11.4 (build and gdb/gdb gdb/gdb smoke test only).
>
> Ok for mainline?
OK.
Thanks,
Pedro Alves