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/11/2005 09:02:38
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.)

Fixed

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

Actually if HOST_CXX is defined that will work here now.

> 
> Anyways, should this be set automatically? (Probably not since in tools.)
> 
> 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 guess native c++ should not be used for making tools.)
> 
> 5) gnu/usr.bin/gcc3/backend also needed a cc. So I did:

Fixed

James

> 
> --- 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).
> 
> By the way, why are there duplicates files like tools/hppa--netbsd/bin/gcc
> and tools/bin/hppa--netbsd-gcc?
> 
> My final command line is:
> 
> HOST_CXX=/usr/gcc3/bin/c++
> CXXCPP=/home/reed/netbsd/hp700/tools/bin/hppa--netbsd-cpp
> HOST_CC=/usr/gcc3/bin/cc LEX=/home/reed/netbsd/hp700/tools/bin/nblex
> ./build.sh -D ~/netbsd/hp700/build -O ~/netbsd/hp700/obj -T
> ~/netbsd/hp700/tools -m hp700 -U -u build
> 
> Now I am doing same with kernel=GENERIC ...
> 
> 
>  Jeremy C. Reed
> 
>  	  	 	 open source, Unix, *BSD, Linux training
> 	  	 	 http://www.pugetsoundtechnology.com/
> 
>