Bug 24102 - Fix for make(1) null suffixes after cleaning all suffixes
Summary: Fix for make(1) null suffixes after cleaning all suffixes
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thomas Moestl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-01-06 12:10 UTC by tmoestl
Modified: 2001-03-08 01:02 UTC (History)
0 users

See Also:


Attachments
file.diff (2.50 KB, patch)
2001-01-06 12:10 UTC, tmoestl
no flags Details | Diff
file.diff (2.38 KB, patch)
2001-01-06 12:10 UTC, tmoestl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tmoestl 2001-01-06 12:10:01 UTC
This is a fix for PR bin/23328. It has been ported to -STABLE and
successfully tested by the PR originator.
The patched make also did a world build without any problems.

The problem is that null suffixes will not be cleared using
.SUFFIXES:
, and additions of new suffix rules thereafter may not have the desired
effect.

Fix: See the patch below. The first hunk is a fix for Suff_ClearSuffixes.
First, sNum should not be reset to 0, because 0 is the sNum of suffNull.
Instead, it is set to 1, so SuffClearSuffixes restores the same state
that was present after SuffInit.
Second, all old suffixes are removed in Suff_ClearSuffixes (and the
graph is later rebuilt in SuffRebuildGraph), _except_ suffNull, which
is used later on and may still contain old entries in its child list!
This causes old null suffix rules not to be cleared, and adding
new rules may fail if an old rule is present which has by chance the
same sNum (which is possible since sNum is reset to 1). As a fix, the
child list of suffNull is destroyed (without freeing the entries, because
those should already be in suffClean) and reinitialized.

The second hunk fixes another problem: when the graph is rebuilt in
SuffRebuildGraph, transformations to the null suffix were not included,
because the null suffix is not in the suffix list. This is now done
with that fix.

The third hunk is merely a cosmetical change: it causes `' to be printed
around the debug output of suffixes. This is done already in other
places and makes it possible to know the null suffix from an empty list.

Here comes the diff for -CURRENT; in case that it gets munged somehow, 
it is also available at http://www.tu-bs.de/~y0015675/make.diff.
How-To-Repeat: See PR bin/23328 for a full description.
The bug did apparently surface in some autoconf-generated Makefiles, like
the one of amanda 2.4.2 (specifically in the module amplot).
Comment 1 David E. O'Brien freebsd_committer freebsd_triage 2001-02-07 21:04:17 UTC
Responsible Changed
From-To: freebsd-bugs->will

Will is looking after Make(1) these days.
Comment 2 Thomas Moestl freebsd_committer freebsd_triage 2001-03-07 23:17:16 UTC
Responsible Changed
From-To: will->tmm

I'll take this over (with permission from will)
Comment 3 Thomas Moestl freebsd_committer freebsd_triage 2001-03-08 01:01:45 UTC
State Changed
From-To: open->closed

Committed to -CURRENT.