Subject: Re: gnu/usr.bin/gcc3/backend needs a cc and more ...
To: Jeremy C. Reed <reed@reedmedia.net>
From: James Chacon <jmc@NetBSD.org>
List: tech-toolchain
Date: 02/10/2005 16:11:03
On Thu, Feb 10, 2005 at 01:25:38PM -0800, Jeremy C. Reed wrote:
> (Please CC me on replies. Thank you.)
> 
> I did a cross build of hp700 using Linux/i386 as the build system. I will
> try to test the hp700 out soon after I build a kernel (I have a couple HP
> systems here)!
> 
> Here are some of my comments:
> 
> 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

> 
> 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 

> 
> 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

> 
> 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.

> 
> (I guess native c++ should not be used for making tools.)

Yes

> 
> 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

James