Subject: Re: gnu/usr.bin/gcc3/backend needs a cc and more ...
To: James Chacon <jmc@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-toolchain
Date: 02/10/2005 15:02:54
(Please CC me on replies. Thank you.)

On Thu, 10 Feb 2005, James Chacon wrote:

> > 1) lex not available for tools/binutils/build. My workaround was to set
> > LEX=/home/reed/netbsd/hp700/tools/bin/nblex (This is already salo's PR #
> > toolchain/29197.)
>
> I'll look into this one tonight. Been meaning to work through a few of
> these cross PR's

Thanks.

> > 2) My cc is installed using pkgsrc and is not at /usr/bin/. So
> > HOST_CC=/usr/gcc3/bin/cc. This is not a real problem.
>
> That's documented I beleive

I don't see it in BUILDING. And it is mentioned in tools/compat/README but
only in the "SOLARIS" section (but tools/compat/README is for
cross-compiling notes).

> > 3) tools/file build needs a C++ preprocessor. So I defined
> > CXXCPP=/home/reed/netbsd/hp700/tools/bin/hppa--netbsd-cpp
> > I hope that is okay. Maybe I should have set to my /usr/gcc3/bin/cpp?
> >
> > Anyways, should this be set automatically? (Probably not since in tools.)
>
> Hmmm...probably no reason it can't use the one that's spit out from
> tools/gcc3

Other than maybe the new cpp is not correct for the native cc used for
building tools/file.

Also, maybe tools/file somewhere can define CXXCPP automatically to
HOST_CPP or other CPP. (I didn't even know there was a difference between
C and C++ preprocessor.)

> > 4) tools/groff needs C++. So I set
> > HOST_CXX=/home/reed/netbsd/hp700/tools/bin/hppa--netbsd-c++ (since I had
> > done similar with cpp above). But that still failed with:
> >
> > /home/reed/netbsd/hp700/tools/lib/gcc-lib/hppa--netbsd/3.3.3/../../../../hppa--n
> > etbsd/bin/ld: crt0.o: No such file: No such file or directory
> >
> > So I used HOST_CXX=/usr/gcc3/bin/c++ and that worked.
>
> I beleive this is documented also (that you need a C++ compiler). If it's
> not fully documented about HOST_CXX file a PR for that.

This HOST_CXX could probably be documented. I can commit a note about it.
doc/BUILDING.mdoc says:

The host system must have at least C and C++
compilers in order to create the toolchain
.Nm ( make
is not required); all other tools are created as part of the
.Nx
build process.

Maybe I could add:

(Define HOST_CC and HOST_CXX in your environment to point to your
compilers if in non-standard places or if you need to choose a specific
compiler.)

Or maybe that could go in the "Environment variables" section.

> > 5) gnu/usr.bin/gcc3/backend also needed a cc. So I did:
> >
> > --- gnu/usr.bin/gcc3/backend/Makefile	12 Jun 2004 14:57:57 -0000	1.16
> > +++ gnu/usr.bin/gcc3/backend/Makefile	10 Feb 2005 21:10:54 -0000
> > @@ -148,6 +148,7 @@
> >  	rm -rf .ab && \
> >  	mkdir .ab && \
> >  	(cd .ab && \
> > +		CC=${HOST_CC} \
> >  		${HOST_SH} ${GNUHOSTDIST}/gcc/configure \
> >  			--build=`${HOST_SH} ${.CURDIR}/../../../dist/gcc/config.guess` \
> >  			--host=`${HOST_SH} ${.CURDIR}/../../../dist/gcc/config.guess` \
> >
> >
> > That worked to build. But maybe I should have used:
> > CC=${TOOLDIR}/bin/${whatever}-gcc (to get my tools/hppa--netbsd/bin/gcc).
>
> I need to look here but I beleive it needs HOST_CC there, not the cross one.
>
> >
> > By the way, why are there duplicates files like tools/hppa--netbsd/bin/gcc
> > and tools/bin/hppa--netbsd-gcc?
>
> That's a gnu'ism

Thanks for the feedback.

Take care,


 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/