This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA/sim] Fix sim/ppc compilation on AIX 7.1.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: michael dot haubenwallner at salomon dot at
- Cc: gdb-patches at sourceware dot org, Michael Haubenwallner <michael dot haubenwallner at salomon dot at>, vapier at gentoo dot org
- Date: Tue, 13 Mar 2012 15:07:29 -0700
- Subject: [RFA/sim] Fix sim/ppc compilation on AIX 7.1.
- References: <1331559105-1191-1-git-send-email-michael.haubenwallner@salomon.at>
The email subject suggests an AIX-specific patch, but it is actually
a sim patch. So I am copying the sim Maintainer and changed the
subject a little bit to make it more noticeable to him.
FWIW, the patch looks fine to me. I might have considered renaming
the problematic fields, since they are padding anyway, but I can
see how we would want to preserve the same field names as struct
stat on Solaris. It's not very important, and it's Mike's choice
anyway.
On Mon, Mar 12, 2012 at 02:31:45PM +0100, Michael Haubenwallner wrote:
> AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively,
> breaking declaration of st_pad[123] members in struct solaris_stat.
> ---
> sim/ppc/ChangeLog | 4 ++++
> sim/ppc/emul_unix.c | 5 +++++
> 2 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
> index 769b299..0d0ba30 100644
> --- a/sim/ppc/ChangeLog
> +++ b/sim/ppc/ChangeLog
> @@ -1,3 +1,7 @@
> +2012-03-12 Michael Haubenwallner <michael.haubenwallner@salomon.at>
> +
> + * emul_unix.c: Fix compilation on AIX 7.1.
> +
> 2012-01-02 Joel Brobecker <brobecker@adacore.com>
>
> * dp-bit.c: Reformat copyright header.
> diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c
> index 36738c4..e66d23f 100644
> --- a/sim/ppc/emul_unix.c
> +++ b/sim/ppc/emul_unix.c
> @@ -1034,6 +1034,11 @@ typedef unsigned32 solaris_nlink_t;
> #ifdef HAVE_SYS_STAT_H
> #define SOLARIS_ST_FSTYPSZ 16 /* array size for file system type name */
>
> +/* AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively */
> +#undef st_pad1
> +#undef st_pad2
> +#undef st_pad3
> +
> struct solaris_stat {
> solaris_dev_t st_dev;
> signed32 st_pad1[3]; /* reserved for network id */
> --
> 1.7.3.4
--
Joel