bugmake - Bugs: bug #22531, Make 3.81 May Incorrectly Regard...

 
 

bug #22531: Make 3.81 May Incorrectly Regard Object Dependencies as Complete

Submitted by:  None
Submitted on:  Mon 10 Mar 2008 03:17:35 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: POSIX-Based
Fixed Release: 3.82Triage Status: Medium Effort

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 03 Oct 2009 09:43:55 PM UTC, comment #2:

This test is working correctly in the latest CVS version.

Paul D. Smith <psmith>
Project Administrator
Mon 26 May 2008 01:36:00 PM UTC, comment #1:

I took a look at this. It seems to belong to a class of bugs introduced in 3.81 by some (unintentional; at least I didn't intentionally do it) change related to handling of directory separators (/). In previous versions of make I believe there was some effort to canonicalize directories by removing trailing slashes and perhaps even leading "./" chars. Apparently that is no longer working the same way.

If I change your makefile to remove the trailing slashes from the variables so the order-only prereqs don't contain trailing slashes (and add them in as appropriate so the result is the same), then it works as expected in both 3.80 and 3.81.

Paul D. Smith <psmith>
Project Administrator
Mon 10 Mar 2008 03:17:35 PM UTC, original submission:

I have been establishing a build environment and infrastructure for a project I am working on.

In the course of doing so, I have found some inexplicable behavior in make 3.81 when compiling and generating archive libraries in a pristine build tree. The issue manifests itself on both Mac OS X / Darwin on i686 and Ubuntu Desktop 7.10 on i686.

The behavior is that make creates the necessary object, depend and results directories based on order-only prerequisites in my implicit rules, correctly compiles the first source file into an object for the archive library, but then regards all other objects as complete and then tries to archive the library with non-existent and un-built objects:

% make
mkdir -p .depends
mkdir -p .objects
gcc -g -O1 -MD -MP -MF .depends/a.d -c -o .objects/a.o a.c
mkdir -p .results
ar -cr .results/libalphabet.a .objects/a.o .objects/b.o .objects/c.o .objects/d.o .objects/e.o .objects/f.o .objects/g.o .objects/h.o
ar: .objects/b.o: No such file or directory
ar: .objects/c.o: No such file or directory
ar: .objects/d.o: No such file or directory
ar: .objects/e.o: No such file or directory
ar: .objects/f.o: No such file or directory
ar: .objects/g.o: No such file or directory
ar: .objects/h.o: No such file or directory
make: *** [.results/libalphabet.a] Error 1

If I then run make again, the order-only prerequisites having been already satisfied this time around, things work as expected:

% make
gcc -g -O1 -MD -MP -MF .depends/b.d -c -o .objects/b.o b.c
gcc -g -O1 -MD -MP -MF .depends/c.d -c -o .objects/c.o c.c
gcc -g -O1 -MD -MP -MF .depends/d.d -c -o .objects/d.o d.c
gcc -g -O1 -MD -MP -MF .depends/e.d -c -o .objects/e.o e.c
gcc -g -O1 -MD -MP -MF .depends/f.d -c -o .objects/f.o f.c
gcc -g -O1 -MD -MP -MF .depends/g.d -c -o .objects/g.o g.c
gcc -g -O1 -MD -MP -MF .depends/h.d -c -o .objects/h.o h.c
ar -cr .results/libalphabet.a .objects/b.o .objects/c.o .objects/d.o .objects/e.o .objects/f.o .objects/g.o .objects/h.o
ranlib .results/libalphabet.a

It works successfully under 3.80 but fails under 3.81:

3.81
====

% /usr/gnu/bin/make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin8.11.1

% /usr/gnu/bin/make -r -R clobber
rm -f .depends/a.d .depends/b.d .depends/c.d .depends/d.d .depends/e.d .depends/f.d .depends/g.d .depends/h.d
rm -f .objects/a.o .objects/b.o .objects/c.o .objects/d.o .objects/e.o .objects/f.o .objects/g.o .objects/h.o
rm -f .results/libalphabet.a
rm -rf .objects/
rm -rf .depends/
rm -rf .results/

% /usr/gnu/bin/make -r -R
mkdir -p .depends
mkdir -p .objects
gcc -g -O1 -MD -MP -MF .depends/a.d -c -o .objects/a.o a.c
mkdir -p .results
ar -cr .results/libalphabet.a .objects/a.o .objects/b.o .objects/c.o .objects/d.o .objects/e.o .objects/f.o .objects/g.o .objects/h.o
ar: .objects/b.o: No such file or directory
ar: .objects/c.o: No such file or directory
ar: .objects/d.o: No such file or directory
ar: .objects/e.o: No such file or directory
ar: .objects/f.o: No such file or directory
ar: .objects/g.o: No such file or directory
ar: .objects/h.o: No such file or directory
make: *** [.results/libalphabet.a] Error 1

3.80
====

% /usr/bin/make --version
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

% /usr/bin/make -r -R clobber
rm -f .depends/a.d .depends/b.d .depends/c.d .depends/d.d .depends/e.d .depends/f.d .depends/g.d .depends/h.d
rm -f .objects/a.o .objects/b.o .objects/c.o .objects/d.o .objects/e.o .objects/f.o .objects/g.o .objects/h.o
rm -f .results/libalphabet.a
rm -rf .objects/
rm -rf .depends/
rm -rf .results/

% /usr/bin/make -r -R
mkdir -p .depends
mkdir -p .objects
gcc -g -O1 -MD -MP -MF .depends/a.d -c -o .objects/a.o a.c
gcc -g -O1 -MD -MP -MF .depends/b.d -c -o .objects/b.o b.c
gcc -g -O1 -MD -MP -MF .depends/c.d -c -o .objects/c.o c.c
gcc -g -O1 -MD -MP -MF .depends/d.d -c -o .objects/d.o d.c
gcc -g -O1 -MD -MP -MF .depends/e.d -c -o .objects/e.o e.c
gcc -g -O1 -MD -MP -MF .depends/f.d -c -o .objects/f.o f.c
gcc -g -O1 -MD -MP -MF .depends/g.d -c -o .objects/g.o g.c
gcc -g -O1 -MD -MP -MF .depends/h.d -c -o .objects/h.o h.c
mkdir -p .results
ar -cr .results/libalphabet.a .objects/a.o .objects/b.o .objects/c.o .objects/d.o .objects/e.o .objects/f.o .objects/g.o .objects/h.o
ranlib .results/libalphabet.a

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #15221:  make-debug.tgz added by None (1KiB - application/x-gzip - Sample makefile and sources attached.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gerickson
  • -unavailable- added by psmith (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Jul 2010 06:17:16 AM UTCpsmithFixed Release4.0=>3.82
    Sat 03 Oct 2009 09:43:55 PM UTCpsmithStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
    Sun 02 Aug 2009 11:43:36 PM UTCpsmithTriage StatusNone=>Medium Effort
    Thu 29 May 2008 06:03:12 AM UTCgericksonCarbon-Copy-=>Added gerickson
    Thu 29 May 2008 06:02:51 AM UTCgericksonCarbon-CopyRemoved -unavailable-=>-
    Thu 29 May 2008 06:01:52 AM UTCgericksonCarbon-Copy-=>Added -unavailable-
    Mon 10 Mar 2008 03:17:35 PM UTCNoneAttached File-=>Added make-debug.tgz, #15221

    Back to the top


    Powered by Savane 3.1-cleanup1