From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMIEa-0006TF-Kt for qemu-devel@nongnu.org; Thu, 11 Oct 2012 08:51:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMIEU-0003dg-EB for qemu-devel@nongnu.org; Thu, 11 Oct 2012 08:51:28 -0400 Received: from afflict.kos.to ([92.243.29.197]:55069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMIEU-0003bm-46 for qemu-devel@nongnu.org; Thu, 11 Oct 2012 08:51:22 -0400 Date: Thu, 11 Oct 2012 15:51:19 +0300 From: Riku Voipio Message-ID: <20121011125119.GA24956@afflict.kos.to> References: <1348237034-15851-1-git-send-email-rth@twiddle.net> <1348237034-15851-5-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1348237034-15851-5-git-send-email-rth@twiddle.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/6] alpha-linux-user: Fix sigaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org Hi, This patch doesn't compile for me on ubuntu 12.04 x86_64 host: CC linux-user/signal.o=20 /home/voipio/test/qemu/linux-user/signal.c: In function =E2=80=98do_sigac= tion=E2=80=99: /home/voipio/test/qemu/linux-user/signal.c:620:9: error: passing argument 1 of =E2=80=98memcpy=E2=80=99 discards =E2=80=98const=E2=80=99 q= ualifier from pointer target type [-Werror] /usr/include/x86_64-linux-gnu/bits/string3.h:49:1: note: expected =E2=80=98= void * __restrict__=E2=80=99 but argument is of type =E2=80=98const long unsig= ned int *=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:620:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:620:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:620:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:621:9: error: passing argument 1 of =E2=80=98memcpy=E2=80=99 discards =E2=80=98const=E2=80=99 q= ualifier from pointer target type [-Werror] /usr/include/x86_64-linux-gnu/bits/string3.h:49:1: note: expected =E2=80=98= void * __restrict__=E2=80=99 but argument is of type =E2=80=98const long unsig= ned int *=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:621:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:621:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:621:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:623:9: error: passing argument 1 of =E2=80=98memcpy=E2=80=99 discards =E2=80=98const=E2=80=99 q= ualifier from pointer target type [-Werror] /usr/include/x86_64-linux-gnu/bits/string3.h:49:1: note: expected =E2=80=98= void * __restrict__=E2=80=99 but argument is of type =E2=80=98const long unsig= ned int *=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:623:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:623:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 /home/voipio/test/qemu/linux-user/signal.c:623:9: error: assignment of read-only variable =E2=80=98gu_=E2=80=99 cc1: all warnings being treated as errors make: *** [linux-user/signal.o] Error 1 On Fri, Sep 21, 2012 at 07:17:12AM -0700, Richard Henderson wrote: > Unconditional bswap replaced by __get_user/__put_user. >=20 > Signed-off-by: Richard Henderson > --- > linux-user/signal.c | 22 ++++++++-------------- > linux-user/syscall_defs.h | 2 +- > 2 files changed, 9 insertions(+), 15 deletions(-) >=20 > diff --git a/linux-user/signal.c b/linux-user/signal.c > index 7869147..bf2dfb8 100644 > --- a/linux-user/signal.c > +++ b/linux-user/signal.c > @@ -586,28 +586,22 @@ int do_sigaction(int sig, const struct target_sig= action *act, > sig, act, oact); > #endif > if (oact) { > - oact->_sa_handler =3D tswapal(k->_sa_handler); > -#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) > - oact->sa_flags =3D bswap32(k->sa_flags); > -#else > - oact->sa_flags =3D tswapal(k->sa_flags); > -#endif > + __put_user(k->_sa_handler, &oact->_sa_handler); > + __put_user(k->sa_flags, &oact->sa_flags); > #if !defined(TARGET_MIPS) > - oact->sa_restorer =3D tswapal(k->sa_restorer); > + __put_user(k->sa_restorer, &oact->sa_restorer); > #endif > + /* Not swapped. */ > oact->sa_mask =3D k->sa_mask; > } > if (act) { > /* FIXME: This is not threadsafe. */ > - k->_sa_handler =3D tswapal(act->_sa_handler); > -#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) > - k->sa_flags =3D bswap32(act->sa_flags); > -#else > - k->sa_flags =3D tswapal(act->sa_flags); > -#endif > + __get_user(k->_sa_handler, &act->_sa_handler); > + __get_user(k->sa_flags, &act->sa_flags); > #if !defined(TARGET_MIPS) > - k->sa_restorer =3D tswapal(act->sa_restorer); > + __get_user(k->sa_restorer, &act->sa_restorer); > #endif > + /* To be swapped in target_to_host_sigset. */ > k->sa_mask =3D act->sa_mask; > =20 > /* we update the host linux signal state */ > diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h > index a98cbf7..8ca70b9 100644 > --- a/linux-user/syscall_defs.h > +++ b/linux-user/syscall_defs.h > @@ -540,7 +540,7 @@ int do_sigaction(int sig, const struct target_sigac= tion *act, > struct target_old_sigaction { > abi_ulong _sa_handler; > abi_ulong sa_mask; > - abi_ulong sa_flags; > + int32_t sa_flags; > }; > =20 > struct target_rt_sigaction { > --=20 > 1.7.11.4