Subject: toolchain/23936: regress/lib/libc/siginfo doesn't cleandir properly
To: None <gnats-bugs@gnats.netbsd.org>
From: None <daver@tombstone.localnet.gomerbud.com>
List: netbsd-bugs
Date: 12/30/2003 20:45:57
>Number:         23936
>Category:       toolchain
>Synopsis:       regress/lib/libc/siginfo doesn't cleandir properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 31 04:47:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     David P. Reese Jr.
>Release:        NetBSD 1.6ZF
>Organization:
   David P. Reese, Jr.                                  daver at gomerbud.com
                                               http://www.gomerbud.com/daver/
>Environment:
	
	
System: NetBSD tombstone.localnet.gomerbud.com 1.6ZF NetBSD 1.6ZF (TOMBSTONE) #2: Sun Dec 14 21:29:33 PST 2003 daver@tombstone.localnet.gomerbud.com:/usr/src/sys/arch/i386/compile/TOMBSTONE i386
Architecture: i386
Machine: i386
>Description:
The regress/lib/libc/siginfo won't be cleaned by the cleandir pass at the
beginning of a build unless the toolchain for the target has already been
built and the destination directory has been populated by the target's
include files.  If both targets have SA_SIGINFO, then stale regression
objects will be linked with the new target's ld.  Badness.
>How-To-Repeat:
Build a distribution for one target.  Then build a distribution for a second
target making sure that the destination dir has not been populated with
inclues.  The most recent time that I caught this I was building a macppc
distribution after an i386 distribution.
>Fix:
The crux of the problem is that a cleandir tries to envoke the compiler to
decide if it should step into the siginfo regression directory.  A cleandir
should not depend on the existance of the compiler or the target's include
files.

Index: regress/lib/libc/Makefile
===================================================================
RCS file: /cvsroot/src/regress/lib/libc/Makefile,v
retrieving revision 1.42
diff -u -u -r1.42 Makefile
--- regress/lib/libc/Makefile	2003/12/17 05:36:43	1.42
+++ regress/lib/libc/Makefile	2003/12/31 04:26:25
@@ -13,11 +13,11 @@
 SUBDIR+= ldexp
 .endif
 
-.if !make(obj)
+.if !make(obj) && !make(cleandir)
 HAVE_SIGINFO != if (echo "\#include <signal.h>" && echo "SA_SIGINFO") | ${CC} -E -I${DESTDIR}/usr/include - | grep -sq 0x0040; then echo yes; else echo no; fi
 .endif
 
-.if make(obj) || (${HAVE_SIGINFO} == "yes")
+.if make(obj) || make(cleandir) || (${HAVE_SIGINFO} == "yes")
 SUBDIR+= siginfo
 .endif
>Release-Note:
>Audit-Trail:
>Unformatted: