Subject: bin/20431: miniroot-using archs using grep cannot be built at the moment
To: None <gnats-bugs@gnats.netbsd.org>
From: None <he@netbsd.org>
List: netbsd-bugs
Date: 02/19/2003 19:23:35
>Number:         20431
>Category:       bin
>Synopsis:       miniroot-using archs using grep cannot be built at the moment
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 19 10:24:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Havard Eidnes
>Release:        NetBSD-current, Feb 19 2003
>Organization:
	Unorganized, Inc.
>Environment:
System: host: NetBSD stegg.urc.uninett.no 1.6N NetBSD 1.6N (STEGG.MP) #5: Fri Feb  7 07:41:54 CET 2003     he@stegg.urc.uninett.no:/usr/obj/sys/arch/i386/compile/STEGG.MP i386
target: hp300
Architecture: m68k
Machine: hp300
>Description:

	The miniroot-using ports hp300, mac68k and mvme68k are all
	using grep in their miniroot images.  The recent
	reaorganization of how grep is built currently makes building
	these miniroot images fail.

	Earlier today I committed changes so that the new grep source
	directory would be picked up, but that just results in link
	failures with undefined references which are located in the
	libgreputils.a library built from the sources in
	gnu/usr.bin/grep/lib/.

	Crunchgen apparently does not have a way to express

	1) that a library elsewhere than ${DESTDIR}/usr/lib is to be
	   used
	2) that a program is built from sources scattered in multiple
	   source directories

	Additionally, it's apparent that the -L option to crunchgen
	does exactly nothing, contrary to it's documentation.  All it
	does is remember the last instance of the -L option value (so
	you can't point to multiple library directories).

	One could go down the path of specifying grep's object files
	one by one, but that strikes me as "not the right solution"
	because it creates a maintenance headache.

	Oh, yes, there is also link conflicts between libc's
	getgrent.o and libhack's versions of _getgrent, _endgrent,
	_getgrgid, etc. which need to be dealt with once grep's
	miniroot build is straightened out.

>How-To-Repeat:
	Try to build a hp300 release; watch it fail miserably.

>Fix:
	No fix, but a "false try":

	I tried to do "libs -lgreputils -lintl" in the hp300 list file
	and

GREPLIBDIR!=    cd ${NETBSDSRCDIR}/gnu/usr.bin/grep/lib && ${PRINTOBJDIR}
CRUNCHGEN_FLAGS+=-L ${GREPLIBDIR}

	in distrib/hp300/miniroot/Makefile.inc, but see above about
	crunchgen's lack of handling of the -L option, so this just
	results in a link error where the linker can't find
	-lgreputils because the crunchgen-generated makefile doesn't
	use the value of the passed -L options.

	I'm wondering whether the right fix is to amend crunchgen to
	do something semi-sensible with the -L option values it's
	being passed.
>Release-Note:
>Audit-Trail:
>Unformatted: