2009-02-05 05:20:57     uClinux compilation error

Document created by Aaronwu Employee on Aug 13, 2013
Version 1Show Document
  • View in full screen mode

2009-02-05 05:20:57     uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 68900   

 

 

 

Hi guys!!

 

 

 

After modifying and slimming down my uClinux kernel, I proceed to compile it but......:s, but I have an error which i can't understand the reason.

 

 

 

Here, that's the error displayed on the screen after executing "make" command :

 

 

 

_______________________________________

 

 

 

rm -f linux-2.6.x/usr/initramfs_data.cpio.gz

 

make ARCH=blackfin  CROSS_COMPILE=bfin-uclinux- -j1 -C linux-2.6.x  || exit 1

 

make[1]: entrant dans le répertoire «

 

/home/aymen/Bureau/uClinux/uClinux-dist-2008R1.5-RC3/linux-2.6.x »

 

  CHK    include/linux/version.h

 

  CHK    include/linux/utsrelease.h

 

  CC      arch/blackfin/kernel/asm-offsets.s

 

Dans le fichier inclus à partir de include/linux/spinlock.h:53,

 

          à partir de include/linux/capability.h:47,

 

          à partir de include/linux/sched.h:46,

 

          à partir de arch/blackfin/kernel/asm-offsets.c:31:

 

include/linux/kernel.h:10:20: erreur: stdarg.h : Aucun fichier ou

 

dossier de cetype

 

In file included from include/linux/spinlock.h:53,

 

                from include/linux/capability.h:47,

              from include/linux/sched.h:46,

 

                from arch/blackfin/kernel/asm-offsets.c:31:

 

include/linux/kernel.h:123: erreur: expected declaration specifiers or

 

'...' before 'va_list'

 

include/linux/kernel.h:127: erreur: expected declaration specifiers or

 

'...' before 'va_list'

 

include/linux/kernel.h:131: erreur: expected declaration specifiers or

 

'...' before 'va_list'

 

include/linux/kernel.h:135: erreur: expected declaration specifiers or

 

'...' before 'va_list'

 

include/linux/kernel.h:139: erreur: expected declaration specifiers or

 

'...' before 'va_list'

 

include/linux/kernel.h:155: erreur: expected declaration specifiers or

 

'...' before 'va_list'

 

make[2]: *** [arch/blackfin/kernel/asm-offsets.s] Erreur 1

 

make[1]: *** [prepare0] Erreur 2

 

make[1]: quittant le répertoire «

 

/home/aymen/Bureau/uClinux/uClinux-dist-2008R1.5-RC3/linux-2.6.x »

 

make: *** [linux] Erreur 1

 

 

 

_______________________________________

 

 

 

Thanks for helping me

 

 

 

With my best regards.

 

 

 

- Aymen

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-05 10:46:15     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 68907   

 

 

 

please read the FAQ:

 

docs.blackfin.uclinux.org/doku.php?id=faq

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-05 11:42:44     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 68918   

 

 

 

Thanks for your help.. I tried to install the other missing toolchain's parts but i did some wrong commands to modify the PATH and my system crash down :s

 

 

 

I hope found a solution without reinstalling Linux. In this case if you have any idea about reintializing Ubuntu's PATH let me know please..

 

 

 

Thanks a lot for your help

 

 

 

-Aymen

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-05 11:46:53     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 68919   

 

 

 

i dont know what you mean by "system crash down", but you shouldnt be changing PATH for all users (such as the root user).

 

 

 

the toolchain doc already shows examples of properly setting the PATH var:

 

docs.blackfin.uclinux.org/doku.php?id=toolchain:installing#setting_the_path_environment_variable

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-06 05:53:26     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 68984   

 

 

 

I mean that I can't login in graphic mode. Finally, I created another user with Sudoers permissions and my system works again

 

 

 

I downloaded and extracted the other Toolchain's missing packages in “/opt”: "blackfin-toolchain-elf-gcc-4.1-08r1.5-14.i386.tar.bz2" and "blackfin-toolchain-gcc-3.4-addon-08r1.5-14.i386.tar.bz2". I modify my path like it's indicated in " docs.blackfin.uclinux.org/doku.php?id=toolchain:installing" and I executed the following command to determine if my toolchain works properly "bfin-uclinux-gcc --ver" and i have this result:

 

 

 

_________

 

 

 

Target: bfin-uclinux

 

Configured with:

 

/usr/src/packages/BUILD/blackfin-toolchain-08r1.5/../gcc-4.1/configure

 

--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu

 

--target=bfin-uclinux --prefix=/opt/uClinux/bfin-uclinux

 

--enable-threads=posix

 

--with-sysroot=/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime

 

--disable-libstdcxx-pch --disable-symvers --disable-libssp

 

--disable-libffi --enable-clocale=generic

 

--enable-version-specific-runtime-libs --enable-__cxa_atexit

 

Thread model: posix

 

gcc version 4.1.2 (ADI svn)

 

 

 

_________

 

 

 

So I'm now sure that the toolchain has been fully and properly installed.

 

 

 

But, I still have the same error when I compile uClinux :s

 

 

 

-Aymen

 

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-06 13:28:27     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69003   

 

 

 

if you're still getting stdarg.h errors, then you still havent installed all the right packages.  please read the whole page rather than just skimming it.  like this section:

 

docs.blackfin.uclinux.org/doku.php?id=toolchain:installing#available_packages

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-09 08:20:06     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69123   

 

 

 

Hi Mike!!

 

 

 

After installing the toolchain's packages:

 

 

 

i procede to compile linux and now i have the following error

 

 

 

_____________________________

 

rm -f linux-2.6.x/usr/initramfs_data.cpio.gz

 

make ARCH=blackfin   CROSS_COMPILE=bfin-uclinux- -j1 -C linux-2.6.x  || exit 1

 

bfin-uclinux-gcc: command not found; perhaps you need to fix your PATH?

 

make[1]: entrant dans le répertoire « /opt/uClinux-dist-2008R1.5-RC3/linux-2.6.x »

 

CHK     include/linux/version.h

 

CHK     include/linux/utsrelease.h

 

CC      arch/blackfin/kernel/asm-offsets.s

 

bfin-uclinux-gcc: command not found; perhaps you need to fix your PATH?

 

make[2]: *** [arch/blackfin/kernel/asm-offsets.s] Erreur 127

 

make[1]: *** [prepare0] Erreur 2

 

make[1]: quittant le répertoire « /opt/uClinux-dist-2008R1.5-RC3/linux-2.6.x »

 

make: *** [linux] Erreur 1

 

_____________________________

 

 

 

 

 

I verified my PATH variable :

 

_____________________________

 

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-linux-uclibc/bin

 

_____________________________It looks to be good

 

 

 

I tried to execute manually the following command "bfin-uclinux-gcc --ver" and it works normally

 

 

 

I can't understand what's wrong

 

 

 

Thanks very much for your support and for your answers

 

 

 

-Aymen

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-09 11:15:27     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69129   

 

 

 

are you testing it in the same session, or are you running `make` in one window and testing the PATH in a different one (which might have a different environment) ?

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-09 11:20:29     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69130   

 

 

 

I'm testing both of make and PATH in the same terminal window..

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-09 11:34:08     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69131   

 

 

 

so try doing this when in the toplevel uClinux-dist dir:

 

$ PATH=$PWD/tools:$PATH

 

$ which bfin-uclinux-gcc

 

$ bfin-uclinux-gcc --version

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-09 12:28:56     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69139   

 

 

 

Hi Mike!!

 

 

 

That's what I have done :

 

 

 

_____________________

 

 

 

root@Kubuntu:~# PATH=$PWD/tools:$PATH

 

root@Kubuntu:~# echo $PATH

 

/home/aze/tools:/home/aze/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-linux-uclibc/bin

 

root@Kubuntu:~# which bfin-uclinux-gcc

 

/opt/uClinux/bfin-uclinux/bin/bfin-uclinux-gcc

 

root@Kubuntu:~# bfin-uclinux-gcc --version

 

bfin-uclinux-gcc (GCC) 4.1.2 (ADI svn)

 

Copyright © 2006 Free Software Foundation, Inc.

 

Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS

 

GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

 

 

 

_____________________

 

 

 

 

 

 

 

After that, I execute the Linux's compilation and I have obtained the following result (I copied here only the last part displayed)

 

 

 

_______________________

 

 

 

..............// Hundreds of compilation lines

 

 

 

.............

 

 

 

  INSTALL fs/yaffs2/yaffs.ko                                                                                                                               

 

  INSTALL lib/crc-ccitt.ko                                                                                                                                 

 

  INSTALL lib/zlib_deflate/zlib_deflate.ko                                                                                                                 

 

  INSTALL net/irda/ircomm/ircomm-tty.ko                                                                                                                    

 

  INSTALL net/irda/ircomm/ircomm.ko                                                                                                                        

 

  INSTALL net/irda/irda.ko                                                                                                                                 

 

  INSTALL net/irda/irlan/irlan.ko                                                                                                                          

 

  INSTALL net/sunrpc/sunrpc.ko                                                                                                                             

 

  INSTALL security/capability.ko                                                                                                                           

 

  INSTALL security/commoncap.ko                                                                                                                            

 

if [ -r System.map -a -x true ]; then true -ae -F System.map -b /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/romfs -r 2.6.22.19-ADI-2008R1.5-svn; fi         

 

make[1]: quittant le répertoire « /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/linux-2.6.x »                                                                 

 

Guessed module directory as /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/romfs/lib/modules//2.6.22.19-ADI-2008R1.5-svn                                       

 

make ARCH=blackfin   -C vendors romfs.post                                                                                                                 

 

make[1]: entrant dans le répertoire « /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors »                                                                 

 

make -C /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors/AnalogDevices/BF533-EZKIT/. dir_v=/home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors/AnalogDevices/BF533-EZKIT/. -f /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors/vendors-common.mak romfs.post                                                         

 

make[2]: entrant dans le répertoire « /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors/AnalogDevices/BF533-EZKIT »

 

set -e; \

 

        t=`bfin-linux-uclibc-gcc -mcpu=bf533-0.3 -print-file-name=libc.a`; \

 

        t=`dirname $t`/../..; \

 

        for i in $t/lib/*so*; do \

 

                bn=`basename $i`; \

 

                if [ -f $i ] ; then \

 

                        romfs-inst.sh -p 755 $i /lib/$bn; \

 

                fi; \

 

        done; \

 

        for i in $t/lib/*so*; do \

 

                if [ -h $i -a -e $i ] ; then \

 

                        j=`readlink $i`; \

 

                        romfs-inst.sh -s \

 

                                `basename $j` \

 

                                /lib/`basename $i`; \

 

                fi; \

 

        done; \

 

        if type bfin-linux-uclibc-ldconfig >/dev/null 2>&1; then \

 

                bfin-linux-uclibc-ldconfig -r /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/romfs; \

 

        fi

 

/bin/sh: bfin-linux-uclibc-gcc: not found

 

/bin/sh: bfin-linux-uclibc-gcc: not found

 

make[2]: *** [romfs.shared.libs] Erreur 127

 

make[2]: quittant le répertoire « /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors/AnalogDevices/BF533-EZKIT »

 

make[1]: *** [romfs.post] Erreur 2

 

make[1]: quittant le répertoire « /home/aze/Bureau/uClinux-dist-2008R1.5-RC3/vendors »

 

make: *** [romfs.post] Erreur 2

 

___________________________

 

 

 

At the end, we can see that I always have an error with 'make' and 'bfin-linux-uclibc-gcc'

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-09 12:34:12     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69140   

 

 

 

so what did you change ?  you werent in the dir i said to start at, so setting the PATH like that would make no difference.

 

 

 

you need both bfin-uclinux-gcc and bfin-linux-uclibc-gcc in your PATH.

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-10 06:12:19     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69199   

 

 

 

Thanks Mike, thanks a lot for your help.

 

 

 

I success the uClinux's compilation:D

 

 

 

The problem was caused by 'PATH variable' and 'sudo command'. I explain :

 

I'm using a debian distribution, so I usually use 'sudo' command to execute commands that needs a superuser's permissions.. It's the first part of my problem, because this method doesn't give me all superuser's rights.. So, I used the following command 'sudo bash' to balance completely to superuser mode.. Later than, I changed the PATH variable of root like what you had said to me in your latest message.. Finally, uClinux's compilation was performed successfully

 

 

 

Now I'm going to reduce the size of uClinux image from 3.6MB to less than 2MB to fit it in my ADSP-BF533 (32MB of RAM, 2MB of Flash memory)

 

 

 

Thanks a lot. With my best regards.

 

-Aymen

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-10 11:50:04     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69209   

 

 

 

you should not be building anything as root.  if you need to, you've set things up incorrectly.

 

 

 

only the toolchain install might need root access (if you want to put it at /opt/...).

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-11 08:27:10     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69266   

 

 

 

When I try to compile uClinux as a user, I have a message indicates that I haven't permissions to execute the command..When I use Sudo I obtein the PATH error :s so I'm obliged to balance completely to root mode to compile uClinux successfully..

 

 

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-11 12:16:40     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69271   

 

 

 

then fix the perms on the files (presumably the toolchain).  building the dist as root is not supported and it should not be done.

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-12 11:21:44     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69351   

 

 

 

then fix the perms on the files (presumably the toolchain).  building the dist as root is not supported and it should not be done.

 

 

 

--

 

 

 

I changed the files' permissions; exactly I added "wx" permissions to 'groups' and 'user' with "chmod" command..

 

 

 

After than, I tried to execute uClinux compilation in both of user mode and sudo mode.. But, I still have the same error :s..

 

 

 

____________________________

 

 

 

aymen@aymen-pc:/opt/uClinux-dist-2008R1.5-RC3$ make

 

rm -f linux-2.6.x/usr/initramfs_data.cpio.gz

 

make ARCH=blackfin   CROSS_COMPILE=bfin-uclinux- -j1 -C linux-2.6.x  || exit 1

 

make[1]: Entering directory `/opt/uClinux-dist-2008R1.5-RC3/linux-2.6.x'

 

rm: cannot remove `include/config/kernel.release': Permission denied

 

make[1]: *** [include/config/kernel.release] Error 1

 

make[1]: Leaving directory `/opt/uClinux-dist-2008R1.5-RC3/linux-2.6.x'

 

make: *** [linux] Error 1

 

 

 

 

 

aymen@aymen-pc:/opt/uClinux-dist-2008R1.5-RC3$ sudo make

 

rm -f linux-2.6.x/usr/initramfs_data.cpio.gz

 

make ARCH=blackfin   CROSS_COMPILE=bfin-uclinux- -j1 -C linux-2.6.x  || exit 1

 

bfin-uclinux-gcc: command not found; perhaps you need to fix your PATH?

 

make[1]: Entering directory `/opt/uClinux-dist-2008R1.5-RC3/linux-2.6.x'

 

  CHK     include/linux/version.h

 

  CHK     include/linux/utsrelease.h

 

  CC      arch/blackfin/kernel/asm-offsets.s

 

bfin-uclinux-gcc: command not found; perhaps you need to fix your PATH?

 

make[2]: *** [arch/blackfin/kernel/asm-offsets.s] Error 127

 

make[1]: *** [prepare0] Error 2

 

make[1]: Leaving directory `/opt/uClinux-dist-2008R1.5-RC3/linux-2.6.x'

 

make: *** [linux] Error 1

 

________________________________

 

TranslateQuoteReplyEditDelete

 

 

 

 

 

2009-02-12 15:07:30     Re: uClinux compilation error

 

Mike Frysinger (UNITED STATES)

 

Message: 69356   

 

 

 

by mixing sudo with non-root access, you've broken the permissions in the uClinux dist directory.  your best bet is to `rm -rf` the uclinux-dist dir with sudo and then extract the tarball again as non-root.  then never ever use `sudo` to run make.

 

QuoteReplyEditDelete

 

 

 

 

 

2009-02-13 03:51:26     Re: uClinux compilation error

 

Aymen Abdelwahed (TUNISIA)

 

Message: 69380   

 

 

 

Really thanks Mike for all your help,

 

 

 

I removed all uClinux-dist and I extract it again as a user.. I execute the make without neither  'Sudo' nor 'root mode'

 

 

 

It works

 

 

 

Thanks

Attachments

    Outcomes