Subject: toolchain/21495: problematic cross compile host dependencies
To: None <>
From: Darrin B. Jewell <>
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
>Originator:     Darrin B. Jewell
>Release:        netbsd-current, updated via cvs on ~20030506T1400Z
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 

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.

Build a cross compile toolchain hosted on MacOS X, for example.

See the following message for a copy of a failed build log:


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/
RCS file: /cvsroot/src/share/mk/,v
retrieving revision 1.25
diff -u -u -r1.25
--- src/share/mk/	2002/09/17 23:18:29	1.25
+++ src/share/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}}
 .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
-.ifndef HOSTPROG
 LDADD+=		-ll
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
-.ifndef HOSTPROG
 LDADD+=	-lutil
 .include <>