Subject: Cross compiler RPMS (looking for testers)

From: Rod Stewart <[email-masked]>
Date: Tue, 22 Feb 2000 23:34:46 -0500 (EST)

So did you hear the one about the Compiler who went to cross the road?
He was a Cross Compiler...  (OK, so I won't take up telling jokes. :))
[Please excuse my really bad jokes.]

Looking for a few beta testers:  The first batch should work OK, although
I've only tested the i586 to armv4l versioned glibc cross gcc compiler
extensively.  I do not have any armv3l machines, so would like to know if
the rpms actually work, they should. :)

Cross Compiler RPMS for the brave, for the few, just for you...

I've uploaded my first batch of cross compiler rpms.  They may still have
some issues, but I've used them to create an ARM kernel for a NetWinder,
as well as a simple C program.  Initially they contain Linux i586, i686
hosts to target Linux armv3l and armv4l.  I've uploaded versioned (Debian,
Titan images) and non-versioned (current Rebel.com DM's, <= 3.1-15) glibcs.

What is there?  Currently I have the following:
	cross-armv4l-linux	(info and man pages, excluding glibc's)
	cross-armv4l-linux-binutils	2.9.5.0.22
	cross-armv4l-linux-gcc		2.95.2 (Patches from Scott's
	cross-armv4l-linux-gcc-c++		gcc-2.95.2-1nw4 rpm)
	cross-armv4l-linux-glibc		2.1.2
	cross-armv4l-linux-kernel-headers	2.1.13

Where do they install?  Currently they install with a base of
	/usr/TARGET-{unknown,non_versioned}-linux/
So if you get the cross compiler for target armv4l with a versioned glibc,
that would be: "/usr/armv4l-unknown-linux/"
And your path to get the compiler and binutils would be: 
	/usr/armv4l-unknown-linux/bin/

What you need:
1) Pick a host system.  Current supported hosts are:
	i586-linux, i686-linux

2) Pick a target platform.  Current supported targets are:
    versioned glibc:
	armv4l-linux, armv3l-linux
    non-versioned glibc:
	armv4l-linux, armv3l-linux
  Note: Unless you are creating static binary or kernels be certain to 
	get the correct glibc for your target.  If in doubt ask.

3) Decide what you need.
   If you only want to build the kernel then all you need is (it does not
   matter if you grab the versioned tools or non-versioned, as in this case,
   they are both the same):
	cross-TARGET-linux-binutils
	cross-TARGET-linux-gcc
	cross-TARGET-linux  (if you want info and man pages for binutils
		and gcc)

  If you want to compile programs/applications then you will also most
  likely need a glibc as well.  Now it does matter if you get the correct
  tool set.  
     If you have a versioned glibc use the "versioned" directories.
	Your base directory will be: /usr/TARGET-unknown-linux/bin
	Your programs will have a prefix of: TARGET-unknown-linux-
     If you have a non versioned glibc use the "non-versioned" directories.
	Your base directory will be: /usr/TARGET-non_versioned-linux/bin
	Your programs will have a prefix of: TARGET-non_versioned-linux-

  Now you will need:
	cross-TARGET-linux-binutils
	cross-TARGET-linux-kernel-headers
	cross-TARGET-linux-glibc
	cross-TARGET-linux-gcc
	cross-TARGET-linux-gcc-c++ (If you want to compile c++ programs,
		you will also require this one.  If you do not, skip it.)
		Note:  The cross C++ compiler has not been tested, but it
			should work. :))
	cross-TARGET-linux  (if you want info and man pages for binutils
		and gcc)

4) Now install the rpms:
	rpm -ihv cross-TARGET-linux-*
   or similar should work.
	Note:  Some of the cross-TARGET-linux-gcc-c++ rpms have a screwed up
		Requires line and will require:
			cross-armv4l-linux-gcc = 0.3_2.95.2_2.95.2
		simply use --nodeps to install this one.  It is fixed 
		in the later rpms.

%%%%%%%%%%%%%%%%%%%%%%%%
If you do not like RPMs, then you can use 
	cd /
	rpm2cpio <file.HOST.rpm> |cpio -vid
or if you are really stuck, drop me a line and I can create the tar balls,
you need.  Say which version you need converted, send it to
	[email-masked]
%%%%%%%%%%%%%%%%%%%%%%%%

5) How do I use the new tools now that they are installed?
   First set your PATH environment
	Assuming TARGET is armv4l, for a versioned glibc (change as
	appropriate).  Examples for bash/sh, and chs/tcsh other shells
	may be different.
   bash/sh:
	export PATH=/usr/armv4l-unknown-linux/bin:$PATH
   csh/tcsh:
	setenv PATH "/usr/armv4l-unknown-linux/bin:$PATH"

   Now try to compile a simple program:
	file.c 
		int main (void)
		{
			printf ("Foo has barred the faz?\n");
		}

	armv4l-non_versioned-linux-gcc file.c -o file-arm
   Now copy your file-arm file over to an ARM machine, give it execute
   permission: "chmod +x file-arm", and run it: "./file-arm"

   For building kernels, read linux/Documentation/arm/README
   essentially set CROSS_COMPILE to something similar to:
	CROSS_COMPILE=/usr/armv4l-unknown-linux/bin/armv4l-unknown-linux-
   also set ARCH= in the Makefile

=================
That's about it.  Now where to get the cross compiler rpms.  Currently
they are available from the following two locations (both have the same,
files):
    ftp://ftp.nw.carleton.ca/cross/
    ftp://ftp.netwinder.org/users/s/stewart/cross/
	SRPMS
		i586-armv3l
			  (these two sets are currently building and should
			  be up by 6PMish EST, Feb. 23, 2000)
			i586-armv3l/non-versioned 
			i586-armv3l/versioned
		i586-armv4l
			i586-armv4l/versioned
			i586-armv4l/non-versioned
		i686-armv4l
			i686-armv4l/versioned
			i686-armv4l/non-versioned
		i686-armv3l
			i686-armv3l/non-versioned
			i686-armv3l/versioned

All rpms have been signed with Gnu Privacy Guard for a slightly better
security model.  The key is available at:
    ftp.nw.carleton.ca/cross/crossgnupg.gpg
    ftp.netwinder.org/users/s/stewart/cross/crossgnupg.gpg

Any questions/comments/complaints, please send them my way at (along
with the rpms you installed, and your host/targets):
	[email-masked]
If you give these rpms a try please drop me a line and to let me know
how they went.  Any issues, things which you believe should be different,
or simply to say they worked on your target/hosts.  

++++++++
Short TODO list:
	- put TODO list in rpm
	- move info and man pages into sub packages
		add in the standard documentation (/usr/doc/Package)
		type stuff
	- package the rest of the GCC tree: chill, g77, ...
	- fix package descriptions in spec file
	- fix Requires for cross gcc-c++ package
	- write a howto type doc on how to use these packages, so it is
		possible to simply refer people to section 23035 subsection
		938 of the documentation :)
	- stop writing such long long e-mails, is anyone still reading
	  from the first go?
	- fix/cleanup the handling of paths in the Makefile
	- fix/cleanup the handling of paths in the rpm spec file
	- create a changelog type file
	- fix the Makefile
		make it readable
		put comments in it
		allow to append to config variables
		check recursion
	- write a readme file of how to build your own system
	- buy another case of Coca-Cola
	- generate sparc64 to armv?l cross compilers
	- generate cross compilers for other hosts/targets
	- start generating weekly builds of "unstable" trees
	- build Russell's cross compiler
	- start phase two of cross compiler project
		(con/convince someone to do the HTML :))
	- more things as the come up
	- split up gcc, binutils and glibc into their own cross srpms
	  so it is possible to build only one part of the process...
	- fix use of vendor
	- fix prefix usage
	- save disk space, delete old build trees when done
	- automatically create or complain about /usr/TARGET-VENDOR-linux
	  when building

+++++++
Why create this?  Others may find it useful, saving time in trying to 
get a cross compiler to build for them.  It is also a prelude to the
next phase of my cross compiler project...

+++++++
Useless stats:
To build this I built binutils twice, gcc three times, and glibc three
times.  These are clean builds, which do not require a previous install.

The final build is to change the prefix to the final install location.
The only real hack is the symlink in /usr which points to the
temporary build/install tree...  Have to find a way around this one

Disk space usage is about 500 MB.  Although I generally build with 1 GB
of free disk space in the build tree...

Build times:
	- i586 (Pentium MMX 233MHz) with 160 MB RAM -- approx. 6.5 hours
	- i686 (Celeron 487MHz) with 128 MB RAM -- approx. 2.5 hours

+++++++
==========================================================================
Warning:  This should work fine, but if it decides to eat your hard drive
	or any other unpleasantness I'm sorry, but that is what you get
	for using beta software and/or waking up. :)
	If your use of this software causes Pluto to no longer be
	called a planet anymore, don't say I didn't tell you so.
	Oh, and remember to close the door when you leave the Universe.
==========================================================================

Thanks for reading this far.  Give yourself a pat on the back.  :)

Remember they are out there, they are watching, they're out to get you,
they come from ...

- -Rms
Rod m. Stewart <[email-masked]>

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
This is a backup list for [email-masked], and the subscription
list is regularly synchronised.