Christopher Faylor | 12 Nov 21:02 2012

[WIP] mingw64 related changes to Cygwin configure and other assorted files with departed w32api/mingw

I decided over the weekend to port over configury changes that I made to
Cygwin's now-out-of-date GIT repository.

These changes basically just cleaned up some of the configure scripts
and made it easier to pinpoint where windows headers and libraries come
from by adding a --with-windows-headers and --with-windows-libs options.
However, some of the assumptions made for the git repository weren't
really valid for the CVS repository so there was a fair amount of work

I thought that I'd do this so I could easily get up-and-running with the
MinGW64 stuff but I ran into some problems building things with gentoo's
MinGW64 implementation.  So, I switched to using the files from the
Cygwin release.

As I mentioned in cygwin-developers, getting the most recent version of
mingw64 stuff working required making some changes to some Cygwin source
files.  Most of the changes just involved #undef'ing constants defined
in Windows headers.  Still, I was surprised that these hadn't already
been handled since I thought I was behind the times by still using the
Mingw32 stuff.

Anyway, is a summary of the changes I've made to files is below.  I'll
be doing appropriate ChangeLogs too, of course.  I've also attached the

This is a heads up in case this conflicted materially with any of the
w64 development.

(Continue reading)

Yaakov (Cygwin/X | 5 Nov 03:41 2012

[PATCH] additional sys/termios.h defines

The attached patch adds a few defines to <sys/termios.h> to make it
compatible with Linux and *BSD.


Attachment (ttydefaults.patch): text/x-patch, 1500 bytes
Kai Tietz | 26 Oct 22:13 2012

[patch cygwin]: Rename strechr to strchrnul


this patch replaces strechr by strchrnul symbol-name.  The strchrnul
name is that one also present in new-libc for this function behavior.

2012-10-26  Kai Tietz

	* (quoted): Renamed strechr to strchrnul.
	* (environ_init): Likewise.
	* (aclfromtext32): Likewise.
	* (extract_nt_dom_user): Likewise.
	* (pwdgrp::next_str): Likewise.
	* string.h (strechr): Likewise.

Ok for apply?


RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.434
diff -p -u -r1.434
---	9 Aug 2012 19:58:52 -0000	1.434
+++	26 Oct 2012 20:06:23 -0000
 <at>  <at>  -162,7 +162,7  <at>  <at>  quoted (char *cmd, int winshell)
       char *p;
(Continue reading)

Corinna Vinschen | 24 Oct 15:42 2012

[toplevel patch] Simplify FLAGS_FOR_TARGET for Cygwin

Hi guys,

I just applied the below patch to the sourceware src repo.  The reason
for the patch is that Cygwin won't be using the in-tree mingw and w32api
any longer, but instead it requires an external installation of a
Mingw64 based w32api, and a Mingw64 build environment to build the
native Windows utilities.  Additionally the FLAGS_FOR_TARGET contains
one dir which doesn't contain any libs (winsup) and one dir which doesn't
exist (winsup/include).  The below patch only changes FLAGS_FOR_TARGET

Could somebody with toplevel checkin rights in the gcc repo please apply
this patch there, too?


2012-10-24  Corinna Vinschen  <corinna AT vinschen DOT de>

	* (FLAGS_FOR_TARGET,target=cygwin): Fix for building
	against Mingw64 w32api.
	* configure: Regenerate.

RCS file: /cvs/src/src/,v
retrieving revision 1.176
diff -u -p -r1.176
---	23 Oct 2012 23:02:33 -0000	1.176
+++	24 Oct 2012 13:39:56 -0000
(Continue reading)

Corinna Vinschen | 24 Oct 14:27 2012

Re: Fwd: Re: [patch]: Decouple cygwin building from in-tree mingw/w32api building

On Oct 24 07:15, Earnie Boyd wrote:
> On Wed, Oct 24, 2012 at 3:49 AM, Corinna Vinschen wrote:
> >
> > Just to be sure:  Does that mean we can simply remove the mingw and
> > w32api dirs in the sourceware repo any time?
> Yes.

Ok, thank you!



Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Corinna Vinschen | 24 Oct 14:25 2012

[Fwd: Re: Fwd: Re: [patch]: Decouple cygwin building from in-tree mingw/w32api building]


----- Forwarded message from Earnie Boyd <...> -----

> Date: Wed, 24 Oct 2012 07:15:52 -0400
> From: Earnie Boyd <...>
> To: Keith Marshall <...>, Christopher Faylor
> 	<...>, cygwin-patches <at>, Corinna Vinschen
> 	<...>
> Subject: Re: Fwd: Re: [patch]: Decouple cygwin building from in-tree
> 	mingw/w32api building
> On Wed, Oct 24, 2012 at 3:49 AM, Corinna Vinschen wrote:
> >
> > Just to be sure:  Does that mean we can simply remove the mingw and
> > w32api dirs in the sourceware repo any time?
> Yes.
> -- 
> Earnie
> --

----- End forwarded message -----

Kai Tietz | 24 Oct 11:16 2012

[patch cygwin]: Replace inline-assembler in string.h by C implementation


this patch replaces the inline-assember used in string.h by C implementation.
There are three reasons why I want to suggest this.  First, the C-code might
be optimized further by fixed (constant) arguments.  Secondly, it is
independent and so we just need to maintain on code-path.  And as
third point, by
inspecting generated assembly code produced by compiler out of C code
vs. inline-assembler
it shows that compiler produces better code.  It handles
jump-threading better, and also
improves average executed instructions.


2012-10-24  Kai Tietz

	* string.h (strechr): Replace assembler by
	C code.
	(ascii_strcasematch): Likewise.
	(ascii_strncasematch): Likwise.

Ok for apply?


Index: string.h
(Continue reading)

Corinna Vinschen | 24 Oct 09:49 2012

Re: Fwd: Re: [patch]: Decouple cygwin building from in-tree mingw/w32api building

On Oct 23 17:48, Christopher Faylor wrote:
> On Tue, Oct 23, 2012 at 09:50:10PM +0100, Keith Marshall wrote:
> >And just like Earnie's, the response he requested from me also bounced.
> >Forwarded copy below:
> >-------- Original Message --------
> >Subject: Re: [patch]: Decouple cygwin building from in-tree mingw/w32api 
> >building
> >Date: Tue, 23 Oct 2012 21:41:07 +0100
> >From: Keith Marshall <...>
> >Organization: MinGW Project
> >To: Earnie Boyd <...>
> >CC: cygwin-patches<...>
> >
> >On 22/10/12 12:14, Earnie Boyd wrote:
> >> On Mon, Oct 22, 2012 at 12:09 AM, Christopher Faylor wrote:
> >>>Earnie, we seem to be transitioning from the need to have a
> >>>mingw/w32api in the source tree.  What do you think about removing
> >>>these directories from the depot and moving repo to sourceforge, or
> >>>some other place?
> >>
> >>In anticipation of this event I've already copied the source.  I would
> >>like to leave the code in winsup until the end of the year if that
> >>timeline is fine with Keith.
> >
> >Fine by me; I also have my Mercurial clones of both repositories, from
> >the time when we abandoned them in favour of our own git repository on
> >SourceForge.
> >
> >>>You've got a home for as long as you like on but I was
(Continue reading)

Kai Tietz | 18 Oct 17:57 2012

Re: [patch]: Decouple cygwin building from in-tree mingw/w32api building

Hi Corinna,

2012/10/18 Corinna Vinschen:
> Hi Yaakov,
> On Oct 18 02:33, Yaakov (Cygwin/X) wrote:
>> On Wed, 2012-10-17 at 15:32 -0400, Christopher Faylor wrote:
>>> But, anyway, nevermind.  This shouldn't be a requirement for getting
>>> these changes checked in.  I'm more concerned with just nuking the
>>> now-unneeded mingw script.
>> Draft patch attached, based partially on Kai's.  Yes, it needs a
>> ChangeLog entry, but it also needs more testing first.
>> On Cygwin, you need either mingw-gcc-g++ and mingw-zlib, or
>> mingw64-i686-gcc-g++ with Ports' mingw64-i686-zlib, available here:
> Any problem to move mingw64-i686-zlib into the distro?

Hmm, wouldn't assume so.  I can give JonY a ping for that.  I assume
he would provide such a package.  Shall I ask him?

>> On Fedora, you need my cygwin-gcc-c++ plus mingw32-gcc-c++ and
>> mingw32-zlib-static.  Unfortunately F17's mingw32-headers isn't
>> (aren't?) new enough, so two files in winsup/utils wouldn't compile
> Indeed, unfortunately.  The Fedora maintainer cut the latest version
> right before I started to apply my changes to mingw64.
(Continue reading)

Kai Tietz | 17 Oct 18:13 2012

[patch]: Decouple cygwin building from in-tree mingw/w32api building

Hello everybody,

This patch modifies the bits of build-process so that cygwin and mingw
building is decoupled from each other.
Additionally the patch decouples cygwin's build from the w32api of
By this change it is now possible to build cygwin (and utilities) with's and mingw-w64's psdk and compilers.  Later are necessary
to build cygwin's native utils, which have not to depend on
These changes are also necessary for having 64-bit build support in
future. By this reason the mingw-script in utils/ had to learn about
the host's architecture and about how to search for an installed
mingw-toolchain for given architecture.  As Corinna told me that
cygwin wants to use in question the -w64- mingw-environment, this
script is searching first for -w64- based toolchain.  On second
attempt it searches for any mingw triplet for given architecture.

ChangeLog winsup/

2012-10-17  Kai Tietz

	* Makefile.common: Remove w32api specific internal
	(nostdincxx): Always turn off default libraries.
	* Remove for cygwin build dependencies
	to w32api and mingw.
	* Make test for w32api directory optional.

ChangeLog lsaauth/

(Continue reading)

Jin-woo Ye | 26 Aug 03:59 2012

[PATCH] suggestion for faster pseudo-reloc.

This patch fixes the problem making pseudo-reloc too slow when there is 
many pseudo-reloc entries in rdata section by deciding when not to call 
Virtual{Query,Protect} to save overhead.
I tested this patch and time taken for pseudo-reloc reduced 1800ms to 
16ms for 3682 entries.
Please review this patch.

2012-08-26  <jojelino <at>>

	* (auto_protect_for): Define.
	(__write_memory): Use auto_protect_for, add verbose message displaying the number of items.
	(_pei386_runtime_relocator):Add verbose message displaying time taken for pseudo-reloc.
Index: winsup/cygwin/
RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.10
diff -u -p -r1.10
--- winsup/cygwin/	16 Aug 2012 23:34:44 -0000	1.10
+++ winsup/cygwin/	26 Aug 2012 01:47:13 -0000
 <at>  <at>  -125,7 +125,78  <at>  <at>  __report_error (const char *msg, ...)
   abort ();
+ * This function automatically sets addr as PAGE_EXECUTE_READWRITE
(Continue reading)