TOOL CHAIN INSTALLATION

Madhan
hi...

    when i am trying to install tool chain for MINI2440 from FEDORA16..
I mean when i am trying to set up cross compile environment for MINI2440
from fedora16...i am unable to find .bashrc file at /root as mentioned in
its USER MANUAL...

Actually what i did is i downloaded arm-linux-gcc.4.4.3.tgz from its
website and i copied it into /tmp 

after that i entered the command "tar xvzf arm-linux-gcc.4.4.3.tgz -C /"

In result to it a file named "FriendlyArm" is get created in /opt 

Now, as per the USER MANUAL.....next step is to open the .bashrc file by
giving command "gedit /root/.bashrc

but here problem is in my FEDORA16 linux i am unable tot find out .bashrc
file in root directory...but i am finding it at /etc....

and the file which i am finding at /etc is "bashrc" not ".bashrc" (dot is
not there for the one which i found)....

Any way if i am trying to edit the file to place the path...it is not
supporting to edit...it is giving a message that the file opened is
READ-Only...therefore coudnt be edit..

so what can i do....
first of all is .bashrc file i found is the correct one...

second...how can i edit .bashrc file as it is READ-ONLY file...

third...what would be the content of .bashrc file...I mean i am unable to
understand in which line i have to add the path....and how can i add the
path...


earlier i tried with LINUX MINT then also i faced the same problem...there
i couldnt find the .bashrc file any where...thats why i installed
FEDORA16..but here i am able to fine bashrc file instead of .bashrc but
sill it can not be editable...

so, please someone help me...from past 3 months i am struggling with
this...


which version of linux is more suitable to follow the USER MANUAL given by
the FRIENDLYARM


Thank you.

davef
Not that I am suggesting editing your /etc/bashrc file is the correct thing
to do, but could you probably edit it as:

sudo gedit bashrc 

(while you are in the /etc directory)

Or do you know about editing files in root versus your home directory?

I believe that some distros use .profile as the place for this information
rather than .bashrc (ie Ubuntu)

What USER MANUAL are you referring to?

I know people have had some problems using Fedora (use the search function
on this site).

I would recommend Ubuntu ... but that is only because that is what I use :)

Ayyappan Mk
Hi davef,

I have Ubuntu 12.04 Os. I extracted the toolchain as Madhan did. And edited
the /etc/bashrc file as you are saying to add toolchain path. And when I
gave the command arm-Linux-gcc -v it prompted as command not found. In the
doubt the toolchain did not get executable permisions I changed the tool
chain bin folder's permission to executable by sudo chmod 777
/path_to_bin/. but still I am getting the same behavior for arm-Linux-gcc
-v command. Do I have to edit .profile file. Please give me the reference
to install tool chain for me.

Thanks,
Ayyappan.

davef
Ayyappan,

Impressive search skills.

First do a <printenv> on the command line and show what you get for:

  XDG_CONFIG_DIRS=

you should see the path to the compiler.

Sorry, I can't point to a specific reference.  .profile on my Xubuntu seems
to refer to .bashrc

At the end of .bashrc I have:

export PATH=/opt/FriendlyARM/toolschain/4.4.3/bin/:$PATH

My FriendlyArm toolchain directories are 555.  I believe it is a bad thing
to make them writeable.  From the Pengutronix Quickstart Guide on
protecting your toolchain:

3.3.5 Protecting the Toolchain
All toolchain components are built with regular user permissions. In order
to avoid accidential changes in the toolchain, the files should be set to
read-only permissions after the installation has finished successfully. It
is also possible to set the file ownership to root. This is an important
step for reliability, so it is highly recommended.

Then my Pengutronix toolchain is 755, looks like I never changed it

Ayyappan Mk
Hi davef,

One correction in the previous post. I didnot edit /etc/.bashrc file. I
edited /root/.bashrc file to add the path as I followed the
Mini2440UsersManual060713-012214.pdf downloaded from mini2440 download
section. But I am able to get the expected output when I typed the "export
PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin" in the terminal and typed
the arm-linux-gcc -v command. But I dont know exactly where I have to add
the path of toolschain to PATH environment variable to make it permanent.
the value for "XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg" after printenv
command. 

In the following thread http://www.friendlyarm.net/forum/topic/1079 you
have posted like for cross compiling set up use the following commands
either as script or place in .profile or type these commands at the
beginning of the terminal.

    * CROSS_COMPILE=arm-none-linux-gnueabi-
    * CC=”${CROSS_COMPILE}gcc –march=armv4t –mtune=arm920t”
    * export CROSS_COMPILE
    * export CC 

shall I follow this?

Please reply.

davef
Hold on a minute ... the bashrc file that I modify is in my /home/davef
directory not root/ or /etc

Maybe yours might work if you sudo arm-linux-gcc -v

Why are you not using a .bashrc in your home directory?

It has been years, but there is something special that happens when you
open a terminal session that lasts as long as that session is open.  Think
it has something to do with the environment variables.

Ayyappan Mk
Hi davef,

I did like you said ie)edited .bashrc file in /home/ayyappan/ to add path
environment variable and I got the expected output for arm-linux-gcc -v
command but could not compile the kernel image. I am pasting the output in
terminal windows here.

ayyappan@ayyappan-desktop:~$ cd
/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.32.2
ayyappan@ayyappan-desktop:/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2$
arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with:
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure
--build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu
--target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.4.3
--with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-roo
t
--enable-languages=c,c++ --disable-multilib --with-arch=armv4t
--with-cpu=arm920t --with-tune=arm920t --with-float=soft
--with-pkgversion=ctng-1.6.1 --disable-sjlj-exceptions
--enable-__cxa_atexit --with-gmp=/opt/FriendlyARM/toolschain/4.4.3
--with-mpfr=/opt/FriendlyARM/toolschain/4.4.3
--with-ppl=/opt/FriendlyARM/toolschain/4.4.3
--with-cloog=/opt/FriendlyARM/toolschain/4.4.3
--with-mpc=/opt/FriendlyARM/toolschain/4.4.3
--with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sy
s-root
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99
--enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.4.3 (ctng-1.6.1) 
ayyappan@ayyappan-desktop:/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2$
sudo make menuconfig
[sudo] password for ayyappan: 
scripts/kconfig/mconf arch/arm/Kconfig


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.

ayyappan@ayyappan-desktop:/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2$
sudo make zImage
make: arm-linux-gcc: Command not found
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CC      kernel/bounds.s
/bin/sh: 1: arm-linux-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
ayyappan@ayyappan-desktop:/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2$

Please reply what I have to do.

Thanks,
Ayyappan

davef
When you are in this directory ...

ayyappan@ayyappan-desktop:/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.

32.2$

... do a <printenv> on the command line and show what you get for:

  XDG_CONFIG_DIRS=


Have to ask, why are you NOT issuing those commands while in your home
directory?

Ayyappan Mk
Hi davef,

When i did printenv on the command line while in 
ayyappan@ayyappan-desktop:/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2$

the value of XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg

I am issuing these commands as I have created a drive
/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/ having large space of 125 GB
to store workspace files and data files.This will also prevent me in saving
workspace and data files in case of OS reinstallation by formatting the
drive which has OS in case of any problems.

But also i tried issuing these commands by copying kernel source to home
folder and it behaved the same.

Please help me to fix the problem.

Thanks,
Ayyappan.

Ayyappan Mk
But also i tried issuing these commands by copying kernel source(mini2440
kernel which I am trying to cross compile) to home folder and it behaved
the same.

davef
Where did the kernel sources live before you copied them to home.  I'd
suggest that /media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2/home is not the right place for them.

Your /media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.
32.2/home/.bashrc has a PATH to the kernel sources?

I have never tried to do what you are attempting.

Ayyappan Mk
I never placed mini2440 kernel source in
/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.32.2/home.

The mini2440 kernel source path was either 
/media/1cc98b98-c8ce-405b-bda0-3d08b3f1b5b6/linux-2.6.32.2/

or 

/home/ayyappan/linux-2.6.32.2/

Please read my post clearly.

Ayyappan mk
Hi,

I am using Ubuntu 14.04 64 bit OS in my Dell laptop.

I am getting this following error while cross compiling kernel for mini2440
1GB NAND.

ayyappan-muthu@ayyappanmuthu-Inspiron-5559:~/Linux_Study/linux-2.6.32.2$
make
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CC      kernel/bounds.s
/opt/FriendlyARM/toolschain/4.4.3/libexec/gcc/arm-none-linux-gnueabi/4.4.3/cc1:
error while loading shared libraries: libstdc++.so.6: cannot open shared
object file: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

while executing the following commands i get the following output.

ayyappan-muthu@ayyappanmuthu-Inspiron-5559:~$ file /sbin/init
/sbin/init: ELF 64-bit LSB  shared object, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.24,
BuildID[sha1]=7a4c688d009fc1f06ffc692f5f42ab09e68582b2, stripped

ayyappan-muthu@ayyappanmuthu-Inspiron-5559:~$ arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with:
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure
--build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu
--target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.4.3
--with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-roo
t
--enable-languages=c,c++ --disable-multilib --with-arch=armv4t
--with-cpu=arm920t --with-tune=arm920t --with-float=soft
--with-pkgversion=ctng-1.6.1 --disable-sjlj-exceptions
--enable-__cxa_atexit --with-gmp=/opt/FriendlyARM/toolschain/4.4.3
--with-mpfr=/opt/FriendlyARM/toolschain/4.4.3
--with-ppl=/opt/FriendlyARM/toolschain/4.4.3
--with-cloog=/opt/FriendlyARM/toolschain/4.4.3
--with-mpc=/opt/FriendlyARM/toolschain/4.4.3
--with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sy
s-root
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99
--enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.4.3 (ctng-1.6.1) 

For printenv command I get the following output for XDG_CONFIG_DIRS and
PATH.

XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:/usr/local/sbin:/usr/local/bin:/usr/s
bin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games


Please help me to solve this problem.