Subject: MKPICLIB and binutils not happy together
To: None <tech-toolchain@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-toolchain
Date: 03/12/2002 00:45:02
Folks,

On mips (and vax by inspection) targets, the programs in
gnu/usr.bin/binutils get relinked every time you run "make".  This
is because the libbfd_pic.a gets referenced in many of the Makefile
fragments but on architectures where MKPICLIB=no gets set in
<bsd.lib.mk> there isn't an lib<foo>_pic.a library built, just the
lib<foo>.a library.

Now, the knowledge of whether or not an _pic library is needed (the
MKPICLIB variable) is local to <bsd.lib.mk>.  There's two ways I can
see around this:

  1. Move the decisions in the top of <bsd.lib.mk> to <bsd.own.mk>
     (or somewhere else).

  2. Add some target ("PRINTPICLIB"??) to <bsd.lib.mk> so you can
     do something like:

	DPADD+!= cd ${TOP}/lib/libbfd && ${PRINTPICLIB}

     (does +!= work?!) where PRINTPICLIB would be something like

	PRINTOBJDIR=	${MAKE} -V SOLIB

     (this is untested).

The later concept seems more correct - any other ideas?

This is similar to the dbsym case in PR misc/15856, except there the
dependancy in the Makefile fragment lists libbfd.a and so works on
mips/vax but not on everything else.

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/