Showing posts with label mingw. Show all posts
Showing posts with label mingw. Show all posts

Wednesday, October 31, 2012

X doesn't always mark the spot

I have added X11 proto and library packages for the Win32 (i686-w64-mingw32) cross-compiler stacks on both Cygwin and Fedora, as well as for the i686-Linux (i686-pc-linux-gnu) stack on Cygwin. This means that it is now possible to compile-test xserver patches for Linux, Cygwin, and MinGW at the same time from one platform.

Unfortunately, building X11 for Win64 (x86_64-w64-mingw32) is going to take more work. Win64 is unique among 64-bit platforms in being LLP64 (32-bit long, 64-bit long long, 64-bit pointers), which breaks the assumption throughout the X11 codebase that a pointer can be cast to a long (which works on other platforms, both 32- and 64-bit). The usual solution to this is intptr_t, but that is C99 and hard requirements thereon are generally avoided in the X11 codebase. Hence, solving this will require massive patching to the headers (possibly including the addition of a intptr_t-like type), and will need to be discussed thoroughly in advance by interested parties.

Thursday, February 17, 2011

Across and Back Again

As you may be aware, last summer I added cross-compiling support to cygport, resulting in a new 0.10 series. The results so far have been quite promising, with cygwin-based cross-toolchains now available for the following targets:

  • MinGW (i686-pc-mingw32), with the basic packages available here pending an ITA, and many more in Ports
  • MinGW-w64 (i686-w64-mingw32 and x86_64-w64-mingw32), already in the distro
  • Linux x86 (i686-pc-linux-gnu) and x64 (x86_64-pc-linux-gnu)
  • Solaris 10 x86 (i386-pc-solaris2.10) and SPARC (sparc-sun-solaris2.10)
  • Solaris 11 x86 (i386-pc-solaris2.11)
  • AVR microcontrollers (avr)
With this improvement to cygport, cross-compiling from Cygwin comes with the ease you would expect from a Linux distribution.

This week, I decided it was time to turn things around and make it easier to cross-compile to Cygwin as well. To that end, I have created a minimal Linux-to-Cygwin cross-compiler toolchain for Fedora Linux. Under my "fedora-cygwin" (sub)project, I have posted .spec files and patches to SourceForge git and RPMs for both ix86 and x86_64 to the File Release area. For now it is necessary to manually download and install the RPMs until I have the chance to figure out how to setup a yum repository.

While these packages are mostly based on the work of the fedora-mingw project, there are important differences. I'll admit that these are my first RPM spec files, so I'll gladly take constructive suggestions for improvement, or better yet, git patches. Furthermore, these have yet to be tested beyond building themselves. If you do find these useful, or discover any problems, please let me know through the Cygwin Ports mailing list for now.