Subject: toolchain/21495: problematic cross compile host dependencies
To: None <gnats-bugs@gnats.netbsd.org>
From: Darrin B. Jewell <dbj@netbsd.org>
List: netbsd-bugs
Date: 05/07/2003 21:41:59
>Number:         21495
>Category:       toolchain
>Synopsis:       problematic cross compile host dependencies
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 08 01:46:02 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Darrin B. Jewell
>Release:        netbsd-current, updated via cvs on ~20030506T1400Z
>Organization:
>Environment:
Darwin Quiteria.local. 6.5 Darwin Kernel Version 6.5: Mon Apr  7 17:05:38 PDT 2003; root:xnu/xnu-344.32.obj~1/RELEASE_PPC  Power Macintosh powerpc 
>Description:

When building the toolchain for cross compiling, there are several
dependencies on static libraries installed in /usr/lib on the host.
This causes problems when compiling on systems that do not have
static libraries installed in the expected locations.

>How-To-Repeat:
Build a cross compile toolchain hosted on MacOS X, for example.

See the following message for a copy of a failed build log:
  http://mail-index.netbsd.org/tech-toolchain/2003/05/01/0000.html

>Fix:

The following patch removes inappropriate host
dependencies on ${LIBC} ${LIBM} and ${LIBTERMCAP}
that I discovered while cross compiling from MacOS X

Index: src/share/mk/bsd.hostprog.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.hostprog.mk,v
retrieving revision 1.25
diff -u -u -r1.25 bsd.hostprog.mk
--- src/share/mk/bsd.hostprog.mk	2002/09/17 23:18:29	1.25
+++ src/share/mk/bsd.hostprog.mk	2003/05/08 00:45:44
@@ -73,7 +73,7 @@
 .if defined(OBJS) && !empty(OBJS)
 .NOPATH: ${OBJS} ${HOSTPROG} ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
 
-${HOSTPROG}: ${DPSRCS} ${OBJS} ${LIBC} ${DPADD}
+${HOSTPROG}: ${DPSRCS} ${OBJS} ${DPADD}
 	${HOST_LINK.c} ${HOST_LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
 
 .endif	# defined(OBJS) && !empty(OBJS)
Index: src/usr.bin/xlint/lint1/Makefile
===================================================================
RCS file: /cvsroot/src/usr.bin/xlint/lint1/Makefile,v
retrieving revision 1.26
diff -u -u -r1.26 Makefile
--- src/usr.bin/xlint/lint1/Makefile	2002/02/01 05:44:40	1.26
+++ src/usr.bin/xlint/lint1/Makefile	2003/05/08 00:48:30
@@ -39,9 +39,9 @@
 	sh ${.ALLSRC:M*makeman} ${LINT1} -m >${.TARGET}
 
 LDADD+=		-lm
+.ifndef HOSTPROG
 DPADD+=		${LIBM}
 
-.ifndef HOSTPROG
 LDADD+=		-ll
 DPADD+=		${LIBL}
 
Index: src/usr.sbin/sunlabel/Makefile
===================================================================
RCS file: /cvsroot/src/usr.sbin/sunlabel/Makefile,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile
--- src/usr.sbin/sunlabel/Makefile	2003/03/13 04:50:53	1.3
+++ src/usr.sbin/sunlabel/Makefile	2003/05/08 00:48:44
@@ -4,9 +4,9 @@
 MAN=	sunlabel.8
 
 LDADD+=	-ltermcap
+.ifndef HOSTPROG
 DPADD+=	${LIBTERMCAP}
 
-.ifndef HOSTPROG
 DPADD+=	${LIBUTIL}
 LDADD+=	-lutil
 .include <bsd.prog.mk>
>Release-Note:
>Audit-Trail:
>Unformatted: