delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/11/13/14:06:36

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3FB3D5E1.3010500@ford.com>
Date: Thu, 13 Nov 2003 14:05:05 -0500
From: Kelley Cook <kcook34 AT ford DOT com>
Reply-To: Kelley Cook <kelleycook AT wideopenwest DOT com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031014 Thunderbird/0.3 (MozJF)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: gcc-patches AT gcc DOT gnu DOT org
CC: cygwin AT cygwin DOT com
Subject: Re: mkconfig.sh: Portability fix
References: <3FB2792A DOT 60105 AT ford DOT com> <20031112225256 DOT GA9423 AT redhat DOT com>
X-MW-BTID: 090425000020033176870800007
X-MW-CTIME: 1068750308
X-MW-SENDING-MTA: 136.1.7.4
HOP-COUNT: 1
X-MAILWATCH-INSTANCEID: 0102000bb85d196f-baf5-48ec-84dc-59fdc577fbc0
X-OriginalArrivalTime: 13 Nov 2003 19:05:08.0626 (UTC) FILETIME=[0E3C8F20:01C3AA19]

[cc: cygwin mailing list -- original message at 
http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00843.html]

 >> For the past month or so, make restrap has been randomly broken under
 >> cygwin.
 >>
 >> I have traced it to tm.h and tconfig.h not always getting rebuilt
 >> correctly, though I really have no idea why it didn't work with make
 >> restrap, but was fine with a clean make bootstrap.  Maybe it is just
 >> a sh bug under cygwin, nevertheless this patch fixes it and actually
 >> is a bit more readable, IMO.
 >>
 >> OK?
 >
 > I sure would like to know why this is borken under cygwin.  It seems
 > like a fairly simple construct which should work fine, AFAICT.
 >
 > cgf

I agree in principle (though the patch makes the script easier to read).

The offending command line cut and pasted from the makefile log looks like:

TARGET_CPU_DEFAULT="" HEADERS="config/i386/i386.h config/i386/unix.h 
config/i386/bsd.h config/i386/gas.h config/dbxcoff.h 
config/i386/cygming.h config/i386/cygwin.h defaults.h" DEFINES="" 
/bin/sh ../../gcc-snapshot/gcc/mkconfig.sh tm.h

If I just run this command in the GCC directory then tm.h is built 
correctly.

If this file is created via a "make tm.h", "make bootstrap", or just 
plain "make", then tm.h is also built correctly.

However, if this file is created via a "make restrap" then the lines 
between the cat <<EOF
...
EOF
get uncermoniously dropped on the floor as can be seen in this diff 
comparsion.

$ diff -u tm.h tm.h.borked
--- tm.h        2003-11-13 13:46:44.756119500 -0500
+++ tm.h.borked 2003-11-13 13:46:29.053383500 -0500
@@ -10,8 +10,4 @@
  # include "config/i386/cygwin.h"
  # include "defaults.h"
  #endif
-#if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET
-# include "insn-constants.h"
-# include "insn-flags.h"
-#endif
  #endif /* GCC_TM_H */

The only real difference I can see is that "make restrap" adds one 
additional layer of make recurrsion since it calls "make bootstrap" 
which in turns the calls "make stage1" and so forth.

I tried to hack the makefile to add an strace to before the $(SHELL) 
mkconfig.sh command, but that has the side effect of causing the script 
to work again :).

The script also works fine if SHELL=/bin/bash.

So the basic answer to your question is I don't know exactly why /bin/sh 
is borked.  I am open to suggestions for checking though.

Kelley Cook


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019