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

 
 

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

Submitter:  None
Submitted:  Mon 10 Mar 2008 03:17:35 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  3.82 Triage Status:  Medium Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by gerickson
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-28 psmith Fixed Release4.0 3.82
    2009-10-03 psmith StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2009-08-02 psmith Triage StatusNone Medium Effort
    2008-05-29 gerickson Carbon-Copy- Added gerickson
    2008-05-29 gerickson Carbon-CopyRemoved -email is unavailable- -
    2008-05-29 gerickson Carbon-Copy- Added -email is unavailable-
    2008-03-10 None Attached File- Added make-debug.tgz, #15221

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code