Subject: lib/3595: Compiling different system versions on same machine fails
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@comp.vuw.ac.nz>
List: netbsd-bugs
Date: 05/09/1997 18:35:57
>Number: 3595
>Category: lib
>Synopsis: Compiling different system versions on same machine fails
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lib-bug-people (Library Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu May 8 23:50:01 1997
>Last-Modified:
>Originator: Dave Sainty
>Organization:
>Release: NetBSD-current + 1.2.1 at the same time
>Environment:
>Description:
The libc system call interface is not ${DESTDIR} aware. It includes
/usr/include/sys/syscall.h without taking DESTDIR into account. In
particular, this causes problems compiling NetBSD-1.2.1 on a machine
running NetBSD-current.
>How-To-Repeat:
Use ${DESTDIR} to try and compile a 1.2.1 system on a machine running
NetBSD-current. Look on in sheer unmitigated horror as it dies at
link time on binaries.
>Fix:
I've made a patch, so you can all sleep easy tonight.... This patch
is against 1.2.1, which is the one I have a problem with. Sorry. The
patch for current will look almost identical, basically Hunk 1 +
s:/usr/include/sys/syscall.h:${DESTDIR}/usr/include/sys/syscall.h:g.
--- src/lib/libc/sys/Makefile.inc.orig Tue Dec 10 21:14:57 1996
+++ src/lib/libc/sys/Makefile.inc Fri May 9 04:58:54 1997
@@ -4,6 +4,10 @@
# sys sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/sys ${.CURDIR}/sys
+.if defined(DESTDIR)
+AINC+= -idirafter ${DESTDIR}/usr/include
+.endif
+
# modules with non-default implementations on at least one architecture:
SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S ptrace.S reboot.S \
sbrk.S setlogin.S sigpending.S sigprocmask.S sigreturn.S \
@@ -46,38 +50,38 @@
OBJS+= ${ASM} ${PSEUDO}
-${PASM}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+${PASM}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
@echo creating ${.TARGET}
@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
-${SASM}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+${SASM}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
@echo creating ${.TARGET}
@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -k -o ${.TARGET}
-${ASM}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+${ASM}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
@echo creating ${.TARGET}
@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
-${PPSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+${PPSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
@echo creating ${.TARGET}
@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
-${SPSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+${SPSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
@echo creating ${.TARGET}
@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -k -o ${.TARGET}
-${PSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+${PSEUDO}: ${.CURDIR}/arch/${MACHINE_ARCH}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
@echo creating ${.TARGET}
@printf '#include "SYS.h"\nPSEUDO(${.PREFIX},${.PREFIX:S/_//})\n' | \
${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
>Audit-Trail:
>Unformatted:
System: NetBSD tequila.ext.nz 1.2D NetBSD 1.2D (TEQUILA) #20: Mon May 5 03:17:02 NZST 1997 dave@tequila.ext.nz:/vol/tequila/userC/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386