X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX18DIzb9wul/g40Mxqp0UfuE
Date: Mon, 11 Jun 2012 00:26:37 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: make: .exe handling breaks kernel cross-compile
Message-ID: <20120611042637.GB590@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4FD4E21A.2080809@users.sourceforge.net> <20120610182927.GB32575@ednor.casa.cgf.cx> <4FD50A3D.9040201@users.sourceforge.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4FD50A3D.9040201@users.sourceforge.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Sun, Jun 10, 2012 at 03:57:33PM -0500, Yaakov (Cygwin/X) wrote:
>On 2012-06-10 13:29, Christopher Faylor wrote:
>> On Sun, Jun 10, 2012 at 01:06:18PM -0500, Yaakov (Cygwin/X) wrote:
>>> I can confirm that this previously reported bug in make .exe handling
>>> still affects the cross-compile of the Linux kernel:
>>>
>>> http://cygwin.com/ml/cygwin/2009-11/msg00935.html
>>
>> Without diving into the depths of the linux makefiles, this doesn't seem
>> like a bug.  gcc creates .exe files.  The makefile isn't expecting to
>> create one and, so, gets confused.  Makefiles which expect .exe
>> extensions usually use the EXEEXT variable for just this purpose.
>> Linux's makefile doesn't do that for probably obvious reasons.
>
>While our make won't connect a dep on "foo" to a foo.exe rule (which can 
>occur in automake-generated Makefiles with custom rules), it does see 
>foo.exe fulfilling a dep on "foo" if it is already present:
>
>$ cat Makefile
>all: bar
>bar: foo
>	touch bar.exe
>clean:
>	rm -f bar.exe foo.exe
>
>$ touch foo.exe
>$ make
>touch bar.exe
>$ make clean
>rm -f bar.exe foo.exe
>
>The problem here is the kernel uses VPATH -- scripts/pnmtologo(.exe) is 
>not relative to drivers/video/logo, but rather to $(O) -- and somehow 
>with VPATH the .exe magic doesn't happen:
>
>$ cat Makefile
>VPATH = $(PWD)/build
>
>all: bar
>bar: foo
>	touch bar.exe
>
>$ mkdir -p build
>$ touch build/foo.exe
>$ make
>make: *** No rule to make target `foo', needed by `bar'.  Stop.
>
>So foo.exe fulfills foo, but not with VPATH.  Isn't that a bug?

If there is a bug it is with make ever equating foo.exe with foo.  It's
undoubtedly happening because of Cygwin's attempts at transparency.

I'm not kidding about EXEEXT.  Surely you know about this from having
maintained cygport.

cgf

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

