diff mbox

[Ping] Port of VTV for Cygwin and MinGW

Message ID 54CFD673.2070207@rub.de
State New
Headers show

Commit Message

Patrick Wollgast Feb. 2, 2015, 7:56 p.m. UTC
Hi,

after the missed bug at Linux with no VTV I checked everything again on
the trunk. I saw that I erroneously wrote in the changelog for
libvtv/aclocal.m4 regenerate and deleted the change from the patch. The
only change I made there in my working directory was the following.


And then autoconf/automake again.


Something I missed during my last test, since Cygwin with gcc 4.9 and
the patch bootstrapped fine, is the following. One of the last changes
to the patch was to remove the implementation of mprotect in libvtv/
(copied from the MinGW port from libgcc2.c), because libgcc2.c
implements it for MinGW, and cygwin1.dll implements it for Cygwin.
However, PAGE_SIZE/PAGESIZE returns 0x10000 on Cygwin on a 64bit PC/VM
(don't have a 32bit PC/VM but I assume that the value would be 0x1000
there). On Linux 64bit it returns 0x1000 and on Windows 64bit with
SYSTEM_INFO/dwPageSize also returns 0x1000. This causes mprotect of
Cygwin to fail for libvtv, since the passed address is checked for
alignment with PAGE_SIZE/PAGESIZE.

The solutions I come up with are:
    - Set VTV_PAGE_SIZE to 0x10000 on Cygwin with 64bit PCs/VMs. But
      this would set more than the desired section to be read/write.
      Practically the whole dll would be writable for the
      .vtable_map_vars section to be writable. Therefore I don't
      recommend this solution. The changes would be in
      include/vtv-change-permission.h, and various other files where
      sizes have to be changed.
    - Add the mprotect implementation from libgcc2.c again for Cygwin
      in libvtv/. In libgcc2.c it isn't build for Cygwin. The changes
      would just be in libvtv/. I'd prefer this solution.


Patrick
diff mbox

Patch

Index: libvtv/aclocal.m4
===================================================================
--- libvtv/aclocal.m4	(Revision 220306)
+++ libvtv/aclocal.m4	(Arbeitskopie)
@@ -1006,6 +1006,7 @@  AC_SUBST([am__untar])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/lead-dot.m4])
+m4_include([../config/lthostflags.m4])
 m4_include([../config/libstdc++-raw-cxx.m4])
 m4_include([../config/multi.m4])
 m4_include([../config/override.m4])