NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/49087: some makefiles in src/ use $(.IMPSRC) in explicit rules

>Number:         49087
>Category:       toolchain
>Synopsis:       $(.IMPSRC) is incorrectly used in some explicit rules
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 07 16:20:00 +0000 2014
>Originator:     Jarmo Jaakkola <>
>Release:        NetBSD 6.1.2_PATCH
System: NetBSD 6.1.2_PATCH NetBSD 6.1.2_PATCH (KOTOISA) 
#5: Mon Jan 20 17:01:44 EET 2014 
Architecture: x86_64
Machine: amd64

Two makefiles in the src/ tree use $(.IMPSRC) in rules which are not
suffix transformation rules.  This should not work as that variable
is not supposed to exist for explicit rules.

It happens to work because there is a bug in make(1), which causes
implicit and explicit dependencies from transformation rules to be
applied on all applicable explicit rules. (see PR ?????, issue 8)

The offending makefiles are:




Don't use ${.IMPSRC} in non-transformation rules.

This is most probably NOT a proper fix, only a quick workaround.
A proper fix should most likely utilize suffix transformation rules.
 external/gpl3/gcc/lib/libgcc/ | 11 +++++++----
 lib/libc/net/                 |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/external/gpl3/gcc/lib/libgcc/ 
index 4819914..645350f 100644
--- a/external/gpl3/gcc/lib/libgcc/
+++ b/external/gpl3/gcc/lib/libgcc/
@@ -149,21 +149,24 @@ ${LIB1ASMFUNCS}: ${.CURDIR}/Makefile
        printf '#define L${.PREFIX}\n#include <${G_LIB1ASMSRC}>\n' >${.TARGET}
+# XXX: this is ugly, can this be done with transformation rules?
-       ${COMPILE.c} -fexceptions ${COPTS.${.IMPSRC:T}} -o ${.TARGET} ${.IMPSRC}
+       ${COMPILE.c} -fexceptions ${COPTS.${.TARGET:.o=.c}} -o ${.TARGET} 
-       ${COMPILE.c} ${CPICFLAGS} -fexceptions ${COPTS.${.IMPSRC:T}} -o 
+       ${COMPILE.c} ${CPICFLAGS} -fexceptions ${COPTS.${.TARGET:.pico=.c}} -o 
${.TARGET} ${.ALLSRC:M*${.TARGET:.pico=.c}}
-       ${COMPILE.c} -fexceptions -fnon-call-exceptions ${COPTS.${.IMPSRC:T}} 
-o ${.TARGET} ${.IMPSRC}
+       ${COMPILE.c} -fexceptions -fnon-call-exceptions 
${COPTS.${.TARGET:.o=.c}} -o ${.TARGET} ${.ALLSRC:M*${.TARGET:.o=.c}}
-       ${COMPILE.c} ${CPICFLAGS} -fexceptions -fnon-call-exceptions 
+       ${COMPILE.c} ${CPICFLAGS} -fexceptions -fnon-call-exceptions 
${COPTS.${.TARGET:.pico=.c}} -o ${.TARGET} ${.ALLSRC:M*${.TARGET:.pico=.c}}
 dp-bit.c: ${.CURDIR}/Makefile
diff --git a/lib/libc/net/ b/lib/libc/net/
index 08b3b66..7115871 100644
--- a/lib/libc/net/
+++ b/lib/libc/net/
@@ -36,7 +36,7 @@ CLEANFILES+=nsparser.c nslexer.c nsparser.h
 nslexer.c: nslexer.l nsparser.h
-       ${LEX.l} -t ${.IMPSRC} | sed -e '/YY_BUF_SIZE/s/16384/1024/' >${.TARGET}
+       ${LEX.l} -t ${.ALLSRC:M*nslexer.l} | sed -e 
'/YY_BUF_SIZE/s/16384/1024/' >${.TARGET}
 # machine-dependent net sources
 # m-d must include sources for:

Home | Main Index | Thread Index | Old Index