This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about libffi closure
David Edelsohn writes:
> >>>>> Andreas Jaeger writes:
>
> Andreas> Should we do instead of:
>
> Andreas> static ffi_closure cl;
> Andreas> ffi_closure *pcl =3D &cl;
>
> Andreas> use:
> Andreas> ffi_closure *pcl;
>
> Andreas> pcl = mmap (NULL, sizeof(ffi_closure), PROT_READ|PROT_EXEC,
> Andreas> MAP_PRIVATE|MAP_ANONYMOUS, fd, 0);
>
> Andreas> Ok, I'll try to change the testsuite...
>
> And the above is more portable because...? libffi is used by more
> than just GNU/Linux.
We need to map executable memory somehow. We are, as ever, open to
all suggestions of ways to do this portably.
> Also, this area has caused problems on systems when GCC tried to
> optimize through the pointer, so you need to test on a large variety of
> systems before this can be changed.
We're only changing the testsuite. We can ifdef where necessary.
Andrew.