This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem when cross-compiling trunk in libgcc2.c
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Vincent R." <forumer at smartmobili dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 19 Mar 2009 07:53:52 -0700
- Subject: Re: Problem when cross-compiling trunk in libgcc2.c
- References: <380011e072669afe0a9a6f1140ca5097@mail.smartmobili.com>
On Thu, Mar 19, 2009 at 7:49 AM, Vincent R. <forumer@smartmobili.com> wrote:
> Hi,
>
> I tried to generate a cross-compiler from trunk a few hours ago and I have
> noticed that
> libgcc2.c doesn't compile anymore because of the following function :
It is caused by:
http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00822.html
> int
> mprotect (char *addr, int len, int prot)
> {
> ?DWORD np, op;
>
> ?if (prot == 7)
> ? ?np = 0x40;
> ?else if (prot == 5)
> ? ?np = 0x20;
> ?else if (prot == 4)
> ? ?np = 0x10;
> ?else if (prot == 3)
> ? ?np = 0x04;
> ?else if (prot == 1)
> ? ?np = 0x02;
> ?else if (prot == 0)
> ? ?np = 0x01;
>
> ?if (VirtualProtect (addr, len, np, &op))
> ? ?return 0;
> ?else
> ? ?return -1;
> }
>
>
> The problem comes from the DWORD because compiler doesn't know its
> definition.
> Before is was defined as an int and everything was working fine.
> By the way I think you should use a unsigned long instead of a int.
>
Please open a bug report.
--
H.J.