[PATCH 2/2] Move source files used in utils/mingw/ into that subdirectory

Corinna Vinschen corinna-cygwin@cygwin.com
Thu May 6 08:43:30 GMT 2021


On May  4 19:34, Jon Turney wrote:
> On 03/05/2021 11:48, Corinna Vinschen wrote:
> > On May  2 16:25, Jon Turney wrote:
> > > Move all the source files used in utils/mingw/ into that subdirectory,
> > > so the built objects are in the expected place.
> > > 
> > > (path.cc requires some more unpicking, and even then there is genuinely
> > > some shared code, so use a trivial file which includes the real path.cc
> > > so the object file is generated where expected)
> > 
> > This patchset LGTM, except one thing which isn't your fault:
> > 
> > > index b96ad40c1..a7797600c 100644
> > > --- a/winsup/utils/strace.cc
> > > +++ b/winsup/utils/mingw/strace.cc
> > > @@ -21,11 +21,11 @@ details. */
> > >   #include <time.h>
> > >   #include <signal.h>
> > >   #include <errno.h>
> > > -#include "../cygwin/include/sys/strace.h"
> > > -#include "../cygwin/include/sys/cygwin.h"
> > > -#include "../cygwin/include/cygwin/version.h"
> > > -#include "../cygwin/cygtls_padsize.h"
> > > -#include "../cygwin/gcc_seh.h"
> > > +#include "../../cygwin/include/sys/strace.h"
> > > +#include "../../cygwin/include/sys/cygwin.h"
> > > +#include "../../cygwin/include/cygwin/version.h"
> > > +#include "../../cygwin/cygtls_padsize.h"
> > > +#include "../../cygwin/gcc_seh.h"
> > 
> > What about adding -I../../cygwin -I../../cygwin/include to the build
> > rules and get rid of the relative paths inside the sources?
> 
> That seems fraught as it allows cygwin system headers to be picked up in
> preference to mingw ones?
> 
> Using '-idirafter' gets you a build, but it would be much more work to check
> that you've actually built what you wanted to...

Well, ok.  It just looks *so* ugly...  What about at least

  --idirafter ../../cygwin

and then

      #include "include/sys/strace.h"
      #include "include/sys/cygwin.h"
      #include "include/cygwin/version.h"
      #include "cygtls_padsize.h"
      #include "gcc_seh.h"
  
That would disallow picking up system headers and still be a bit
cleaner, no?


Corinna


More information about the Cygwin-patches mailing list