# compiling linux 2.20.6 arm linux for at91sam9260



## sailaja (Jul 24, 2007)

Hi,

I am using Cygwin to compile arm linux 2.20.6 for at91sam9260.

I downloaded linux and patch from the following links and followed the 
following steps to compile.

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.6.tar.bz2
wget http://www.minicore.org/pub/patch-2.6.20.6-dlx.tgz
and cross compiler toolchain from
http://ftp.handhelds.org/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2 
and i addes new extracted folder of cross compiler to PATH.
step a:
cp linux-2.6.20.6.tar.bz2 /usr/src
tar jxvf linux-2.6.20.6.tar.bz2
cp patch-2.6.20.6-dlx.tgz
tar zxvf patch-2.6.20.6-dlx.tgz

cd /usr/src/linux-2.6.20.6
cp ../patch-2.6.20.6-dlx .
patch -p1 <patch-2.6.20.6-dlx

While compiling i will get error as 
make at91sam9260ek_defconfig

/usr/local/arm/3.4.1/bin/arm-linux-gcc: not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc:not found

/usr/local/arm/3.4.1/bin/arm-linux-gcc: not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc:not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc: not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc:not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc: not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc:not found
/usr/local/arm/3.4.1/bin/arm-linux-gcc:1:syntax error:"(" unexpected
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTLD scripts/kconfig/conf

scripts/kconfig/conf.o:conf.c:<.text+0x91):undefined reference to '_libintl_gettext'

scripts/kconfig/conf.o:conf.c:<.text+0xa5):undefined reference to '_libintl_gettext'
scripts/kconfig/conf.o:conf.c:<.text+0xb9):undefined reference to '_libintl_gettext'
scripts/kconfig/conf.o:conf.c:<.text+0x7b8):undefined reference to '_libintl_gettext'
scripts/kconfig/conf.o:conf.c:<.text+0x1026):more undefined references to '_libintl_gettext' follow
collect2: ls returned 1 exit status
make[1]:*** [scripts/kconfig/conf] Error 1
make:*** [at91sam9260ek_defconfig] Error 2

Can anybondy help how to solve this.

--- sailaja


----------



## lotuseclat79 (Sep 12, 2003)

Hi sailaja,

Welcome to TSG!

What kind of platform are you on? A Windows platform? Is that why you have and are using the Cygwin compiler?

If you are on a Linux platform to begin with, why do you not have a gcc compiler for the Linux host rather than Cygwin?

Usually, a for any gcc environment the ./configure command is given to probe the host machine on which the source code is compiled and configure the compiler. You need to differentiate between the Host environment in which you are attempting to cross-compile to a Target environment. Your current configuration is looking for the arm-linux-gcc which the setup you have configured with the cross-compiler toolchain cannot find.

You need to first build the cross-compiler toolchain, then the kernel using the cross-compiled toolchain for the Target environment on the Host machine. When you build the cross-compiler toolchain, you must specify your Host environment and Target environment for which the compiler will then emit target code for.

Can you please state whether what you downloaded is source code or binary for each item you mentioned.

Not the kind of project usually tackled by a Beginner.

-- Tom


----------



## sailaja (Jul 24, 2007)

Hi Tom,

I am using windows platform.
Whatever i downloaded is source code.

sailaja


----------



## lotuseclat79 (Sep 12, 2003)

Hi sailaja,

If the toolchain you downloaded was not source code, you need to find the source code for the toolchain and download it. Next you need to compile the toolchain to work in the Host environment using Cygwin and specify the Target environment OS/Processor (for the configure command - i.e. parameters used when you run the ./configure command in the Cygwin environment to build the cross-compiler toolchain environment) so that the toolchain emits code for the Target environment. Make sure you read all there is to compile the toolchain.

Compiling the toolchain first will produce the arm-linux-gcc compiler that is not found (as indicated in your first post).

When that is successfully completed, then and only then should you attempt to compile the kernel source code for the Target OS/Processor - after much reading about how to compile the kernel using a cross-compiler environment.

The only step you appear to have left out is building the cross-compiler toolchain environment for the Linux-ARM environment. The Cygwin compiler environment, if properly installed, only generated (emits) code for the Windows ennvironment. But, you should be able to use it to build the cross-compiler environment (by properly specifying the configuration for Host/Target environments). Then use the cross-compiled environment which includes the missing (not found) arm-linux-gcc compiler which you will need to compile the kernel for the Arm environment.

Read all of the documentation to be sure you understand what to do.

Good luck!

-- Tom


----------

