DIY cross-toolchain kit

Posted by: peter

DIY cross-toolchain kit - 19/10/2001 10:27

You will need:

* An x86 PC running Linux, bash, gcc, GNU make

* The file attached to this message

* The following tarballs, available from FTP sites the world over: binutils-2.10.1.tar.gz, gcc-2.95.3.tar.gz, glibc-2.1.3.tar.gz, glibc-crypt-2.1.tar.gz, glibc-linuxthreads-2.1.3.tar.gz, linux-2.4.3.tar.gz

* 90Mb free disc space, plus another 250Mb for the compilation process

You should:

* Untar armtools.tar.gz to create the 'armtools' directory

* Stick all the tarballs you've collected in that directory

* Edit the PREFIX in the Makefile to dictate where your toolchain ends up (suggestions are in the file)

* Run make. This will build and install your toolchain (so you should run it as a user that can write to $PREFIX). It takes about one trillion cycles (20min on 1GHz).

You will then have an ARM Linux cross-compiler that's the same version as we use for V2.0 car player software. When cross-compiling, add $PREFIX/bin to your path. (Don't do it when you're not cross-compiling, in case you get the wrong cpp.)

Peter


Posted by: mlord

Re: DIY cross-toolchain kit - 19/10/2001 10:55

Most of Peter's referenced .tar.gz files can be found at (among many other sites):

ftp://gatekeeper.dec.com/pub/GNU/

I have also just pulled down everything Peter suggested, and built a toolchain binary on my main machine. The tar'd and gzip'd result is a 24MB file, now available for download from my webserver at http://rtr.ca/empeg/ To use it, just prefix your PATH with the path of the 'bin' subdirectory underneath where you untar'd the toolchain to.

Edited by mlord on 19/10/01 08:05 PM.

Posted by: synergy

Re: DIY cross-toolchain kit - 19/10/2001 11:05

Thank you! (both of you.. )

Posted by: loren

Re: DIY cross-toolchain kit - 19/10/2001 11:40

i move that this be entered into the Riocar.org FAQ and DL section. Do i hear a second..

(i'm becoming the "move this to riocar police"...heheh. Mainly because i hate having to search for something on the BBS a couple of weeks later when i might actually wanna use it.)


|| loren.cox ||
Posted by: bonzi

Re: DIY cross-toolchain kit - 19/10/2001 11:43

You do

Dragi "Bonzi" Raos
Zagreb, Croatia
Q#5196, MkII#80000376, 18GB green
Posted by: tonyc

Re: DIY cross-toolchain kit - 20/10/2001 12:42

I tried to upgrade to this one (using your precompiled toolchain) but I'm getting this:

[root@spaz empeg]# make zImage
arm-empeg-linux-gcc -D__KERNEL__ -I/usr/src/empeg/include -Wall -Wstrict-prototypes -O2 -pipe -msoft-float -march=armv4 -mtune=strongarm110 -DUTS_MACHINE='"arm"' -c -o init/version.o init/version.c
arm-empeg-linux-gcc: installation problem, cannot exec `cpp0': No such file or directory
arm-empeg-linux-gcc: installation problem, cannot exec `cc1': No such file or directory
as: unrecognized option `-marmv4'
make: *** [init/version.o] Error 1

I can just go back to my old one but I would like to make sure I'm building on the same versions as the pros... Any idea why I'm getting this error? It's finding my cross-compiler but what are those cpp0 and cc1 files it can't find?

-Tony
MkII #554
Posted by: mlord

Re: DIY cross-toolchain kit - 20/10/2001 14:14

You need to prefix your PATH with:

/path_to_unpacked_tar_gz_directory/bin

Once you do that, it should work. Don't forget to export the new PATH, and if your .bashrc or .bash_profile or something overrides the PATH, then be wary..

Posted by: mlord

Re: DIY cross-toolchain kit - 20/10/2001 14:18

Here's a little script I use from within my empeg-kernel-source directory:

#!/bin/sh
export PATH="/usr/local/empeg-toolchain/bin:$PATH"
if [ -f .config ]; then
exec make zImage
fi
make mrproper && make oldconfig && make dep && make clean && make -j3 zImage

To build a kernel, I just to ./buildit (that's my name for the script) instead of typing 'make'.

Posted by: tonyc

Re: DIY cross-toolchain kit - 20/10/2001 14:33

Well I do have it in my path. I actually named the directory /usr/local/arm, so my PATH contains /usr/local/arm/bin

If you'll notice in the cut-n-paste I did, it's finding the arm-empeg-linux-gcc compiler, but it's failing with that goofy error that it can't exec cpp0 and cc1. I did a search and found the two files in /usr/local/arm/lib/gcc-lib/arm-empeg-linux/2.95.3 but I'm not sure why the compiler can't find them when my PATH is set correctly....

-Tony
MkII #554
Posted by: mlord

Re: DIY cross-toolchain kit - 20/10/2001 15:08

Mmm.. are you sure it's finding the new toolchain, and not just fragments of an older one from elsewhere? I ask because of this message from your post:

as: unrecognized option `-marmv4'

To me, this indicates that the wrong toolchain is being run.
Usually a PATH issue. Really.

Posted by: tonyc

Re: DIY cross-toolchain kit - 20/10/2001 18:09

Well, I had completely removed the other toolchain but it still wasn't working. I just decided to build my own toolchain from sources and now I'm up and running. I'm not sure what it was, but it was probably something goofy I did, not a problem with your binaries. Thanks for the help.

-Tony
MkII #554
Posted by: mlord

Re: DIY cross-toolchain kit - 20/10/2001 19:06

Good to hear you've got it working.. now we can all wait expectantly for a new player hack commiserate with the efforts taken to install the toochain!

Posted by: jane

Re: DIY cross-toolchain kit - 06/10/2002 05:35

I'm having a slight problem compiling this toolchain... actually, it seems like the documentation won't compile.

/bin/sh ../scripts/move-if-change summary-tmp summary.texi
touch stamp-summary
AWK=gawk /bin/sh libc-texinfo.sh 'intro.texi errno.texi memory.texi ctype.texi s
tring.texi charset.texi locale.texi message.texi search.texi pattern.texi io.tex
i stdio.texi llio.texi filesys.texi pipe.texi socket.texi terminal.texi math.tex
i arith.texi time.texi setjmp.texi signal.texi startup.texi process.texi job.tex
i nss.texi users.texi sysinfo.texi conf.texi' '../crypt/crypt.texi ../linuxthrea
ds/linuxthreads.texi' 'lang.texi header.texi install.texi maint.texi contrib.tex
i'
LANGUAGE=C LC_ALL=C makeinfo libc.texinfo
./stdio.texi:2491: First argument to cross-reference may not be empty.
./stdio.texi:2492: First argument to cross-reference may not be empty.
makeinfo: Removing output file `/home/jane/empegham/armtools/build-glibc/glibc-2
.1.3/manual/libc.info' due to errors; use --force to preserve.
make[3]: *** [libc.info] Error 2
make[3]: Leaving directory `/home/jane/empegham/armtools/build-glibc/glibc-2.1.3
/manual'
make[2]: *** [manual/subdir_install] Error 2
make[2]: Leaving directory `/home/jane/empegham/armtools/build-glibc/glibc-2.1.3
'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/jane/empegham/armtools/build-glibc/build'
make: *** [arm-linux-glibc] Error 2

Any ideas? I don't have root access to the system.

Marius (Escort Cab + Mark II)
Posted by: jane

Re: DIY cross-toolchain kit - 06/10/2002 06:06

Seems like I found the bug...

in libc's stdio.texi lines 2491 and 2492 the combination @ref{, is not allowed, I changed this to a valid first argument... seems like gcc has now started compiling, that probably means that libc was sucessful :-) *crossing fingers*

Marius (Escort Cab + Mark II)
Posted by: peter

Re: DIY cross-toolchain kit - 06/10/2002 13:31

in libc's stdio.texi lines 2491 and 2492 the combination @ref{, is not allowed, I changed this to a valid first argument...

What version of texinfo (makeinfo) have you got installed?

Peter
Posted by: jane

Re: DIY cross-toolchain kit - 06/10/2002 15:50

$ makeinfo --version
makeinfo (GNU texinfo) 4.1

(But as I said, I got it working by changing those two lines)

Marius (Escort Cab + Mark II)
Posted by: pim

Re: DIY cross-toolchain kit - 07/10/2002 12:55

Same error here. Can you post a patch?

Thanks,
Pim
Posted by: jane

Re: DIY cross-toolchain kit - 07/10/2002 13:16

Sure.... But as I stated, this is not a "fix", it's a "hack" to make it work. I'ts in the documentation, and I think there is a very small chance anybody will look at that.

Untar the glibc-packet, patch it and re-tar before doing a "make".

diff -ur glibc-2.1.3 glibc-2.1.3.new/
diff -ur glibc-2.1.3/manual/stdio.texi glibc-2.1.3.new/manual/stdio.texi
--- glibc-2.1.3/manual/stdio.texi Wed Feb 23 08:02:56 2000
+++ glibc-2.1.3.new/manual/stdio.texi Sun Oct 6 14:46:39 2002
@@ -2487,8 +2487,10 @@
If you are trying to read input that doesn't match a single, fixed
pattern, you may be better off using a tool such as Flex to generate a
lexical scanner, or Bison to generate a parser, rather than using
-@code{scanf}. For more information about these tools, see @ref{, , ,
-flex.info, Flex: The Lexical Scanner Generator}, and @ref{, , ,
+@code{scanf}. For more information about these tools, see @ref{Low-Level
+I/O, , ,
+flex.info, Flex: The Lexical Scanner Generator}, and @ref{Low-Level I/O, ,
+,
bison.info, The Bison Reference Manual}.

@node Input Conversion Syntax

Marius (Escort Cab + Mark II)

Posted by: oliver

Re: DIY cross-toolchain kit - 09/07/2003 22:10

I'm a bit confused. I've built the toolchain before with this thread, but this time the makefile script is failing. I remember having to modify more than just the PREFIX setting. I've had to remove the @ infront of the echo and exit commands. And it keeps complaining that it can't find PREFIX, or FILES, or wildcard, or FILES_PRESENT

./Makefile: line 8: PREFIX:=/home/oliver/armtools: No such file or directory
./Makefile: line 17: FILES: command not found
... etc

I also had to add a comment on some lines that the script was stopping on. If someone could take a look at this script, and make sure its mosltly functional, that would be great!
Posted by: wfaulk

Re: DIY cross-toolchain kit - 09/07/2003 23:01

Looks to me like you're trying to execute the Makefile instead of running make.
Posted by: foxtrot_xray

Re: DIY cross-toolchain kit - 10/07/2003 05:07

Uhm, also, why the ":" (colon) after the 'PREFIX'? I run RH7-8 and never had to put those there..

Me.
Posted by: peter

Re: DIY cross-toolchain kit - 10/07/2003 06:10

Uhm, also, why the ":" (colon) after the 'PREFIX'?
For efficiency. Read "info make".

I run RH7-8 and never had to put those there..
Are you using make(1) with your RH7-8?

Peter
Posted by: foxtrot_xray

Re: DIY cross-toolchain kit - 10/07/2003 10:15

In reply to:


For efficiency. Read "info make".



Huh. Eeenteristing. That makes makefiles even more confusing. My little makefile (for my project) is as about as simple as pie because it took me forever to get that far.

In reply to:


Are you using make(1) with your RH7-8?



As far as I know. Never replaced it, resides in /usr/bin/.. Grabbing the version gives me:

GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for i386-redhat-linux-gnu
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.


Not that I'm complaining, mind you. Just never had to change anything in a makefile to get it to work, therefore, never had to learn that much about them..

Me.
Posted by: oliver

Re: DIY cross-toolchain kit - 10/07/2003 12:47

Doh! My fault. Thanks for the pointer