Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
disconnect
PostPosted: Aug 29, 2007 - 04:06 PM
Newbie


Joined: Aug 21, 2007
Posts: 18
Location: Moscow, Russia

I took last avail. toolchain (1.2.2) sources and going to compile it from scratch. I read toolchain compilation how-to and was successed on first steps, but failed on uClibc compilation.

I'm installing toolchain into /opt/avr32 dir, which is owned by my unpriv. user, so i can run 'make install' without root. I modify some stuff in the original toolchain: 2.6.22-atmel3 kernel, patched binutils for successfull fftw compilation, also custom configs for linxu kernel and uClibc.

Binutils:
Code:

rm -rf ./build-avr32-linux-binutils &&
rm -rf ./binutils-2.17.atmel.1.1.1 &&
tar xzvf ./binutils-avr32-2.17.atmel.1.1.1.tar.gz &&
mkdir ./build-avr32-linux-binutils &&
cd ./binutils-2.17.atmel.1.1.1 &&
cat ../elf32-avr32.diff | patch -p2 &&
autoconf &&
cd bfd && aclocal && autoconf && automake && autoheader && cd ../ &&
cd opcodes && aclocal && autoconf && automake && autoheader && cd ../ &&
cd binutils && aclocal && autoconf && automake && autoheader && cd ../ &&
cd ld && aclocal && autoconf && automake && autoheader && cd ../ &&
cd ../build-avr32-linux-binutils &&
../binutils-2.17.atmel.1.1.1/configure --target=avr32-linux --prefix=/opt/avr32/usr --disable-libssp --disable-libada &&
make configure-bfd && cd bfd && make headers && cd ../ &&
make &&
make install &&
export PATH=/opt/avr32/usr/bin:$PATH


gcc bootstrapped version:
Code:

rm -rf ./build-avr32-linux-gcc &&
rm -rf ./gcc-4.1.2 &&
tar xzvf gcc-4.1.2-atmel.1.1.0.tar.gz &&
mkdir build-avr32-linux-gcc &&
cd build-avr32-linux-gcc &&
../gcc-4.1.2/configure --target=avr32-linux --prefix=/opt/avr32/usr --enable-languages=c --disable-threads --disable-libmudflap --disable-libssp --disable-libada --with-build-sysroot=/opt/avr32 &&
make &&
make install


Kernel headers
Code:

rm -rf ./linux-2.6.22.atmel.3 &&
tar xjvf linux-2.6.22.atmel.3.tar.bz2 &&
cd ./linux-2.6.22.atmel.3 &&
cp ../kernel-dot-config .config &&
CROSS_COMPILE=avr32-linux- ARCH=avr32 make oldconfig &&
CROSS_COMPILE=avr32-linux- ARCH=avr32 make headers_install INSTALL_HDR_PATH=/opt/avr32/usr


uClibc
Code:

rm -rf ./uclibc-0.9.28.atmel.0.0.20070516 &&
tar xzvf uclibc-0.9.28.atmel.0.0.20070516.tar.gz &&
cd uclibc-0.9.28.atmel.0.0.20070516 &&
tar xjvf uClibc-0.9.28.tar.bz2 &&
cd uClibc-0.9.28 &&
for i in `cat ../series `; do patch -p1 < ../$i; done &&
cp ../../uclibc-dot-config .config &&
make oldconfig &&
make &&
make install &&
cd utils &&
make &&
make install


My error:
Code:

avr32-linux-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing  -mcpu=ap7000 -masm-addr-pseudos -Wa,--pic,--linkrelax -msoft-float -fno-stack-protector -fno-builtin -nostdinc -D_LIBC -I../include -I.  -Os -funit-at-a-time   -isystem /opt/avr32/usr/lib/gcc/avr32-linux/4.1.2/include -DNDEBUG -fPIC    \
                -DUCLIBC_RUNTIME_PREFIX=\"/opt/avr32/\" \
                -DUCLIBC_LDSO=ld-uClibc.so.0 -I. -I../ldso/include \
                ldd.c -o ldd
In file included from ldd.c:31:
../include/stdlib.h:494: warning: '__malloc__' attribute ignored
/opt/avr32/usr/lib/gcc/avr32-linux/4.1.2/../../../../avr32-linux/bin/ld: warning: ld-uClibc.so.0, needed by /opt/avr32/usr/lib/gcc/avr32-linux/4.1.2/../../../../avr32-linux/lib/libc.so, not found (try using -rpath or -rpath-link)
/opt/avr32/usr/lib/gcc/avr32-linux/4.1.2/../../../../avr32-linux/lib/libc.so: undefined reference to `__libc_stack_end'
collect2: ld returned 1 exit status
make: *** [ldd] Error 1

It happends in uClibc/utils directory Sad

P.S. Sorry for spamming this forum - i just tyring to compile my C++-written mp3 player which uses fftw library for some kind of visualisation.
fftw cant be copmiled on default bintuils --> recompile binutils --> <seems like gcc depends on bintuils> --> <seems like uClibc depends on gcc> --> <i have to compile my own toolchain just because of this +1/-1 line patch to binutils. *HORROR*>


Last edited by disconnect on Aug 29, 2007 - 05:52 PM; edited 4 times in total
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
disconnect
PostPosted: Aug 29, 2007 - 04:18 PM
Newbie


Joined: Aug 21, 2007
Posts: 18
Location: Moscow, Russia

I found that i'm able to compile uClibc if i comment-out all '__libc_stack_end'-related code. First i grep over sources for '__libc_stack_end' symbol:
Code:

for x in `find . | grep -E "^.*\.c$"`;do echo $x && cat $x | grep "__libc_stack_end";done

This symbol present in:
Code:

./libc/misc/internals/__uClibc_main.c
extern void *__libc_stack_end;
    __libc_stack_end = stack_end;
./libc/misc/internals/static.c
void *__libc_stack_end=NULL;
./ldso/ldso/dl-startup.c
strong_alias(__rtld_stack_end, __libc_stack_end); /* Exported version of __rtld_stack_end */


I just comment out all this strings and uClibc was succesfully comiled. I hope this symbols isnt really critical for apps Razz

Patch attached.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
disconnect
PostPosted: Aug 29, 2007 - 05:28 PM
Newbie


Joined: Aug 21, 2007
Posts: 18
Location: Moscow, Russia

Now i'm stuck with gcc compilation.

GCC
Code:

rm -rf ./build-avr32-linux-gcc &&
rm -rf ./gcc-4.1.2 &&
tar xzvf gcc-4.1.2-atmel.1.1.0.tar.gz &&
mkdir build-avr32-linux-gcc &&
cd build-avr32-linux-gcc &&
../gcc-4.1.2/configure --target=avr32-linux --prefix=/opt/avr32/usr --enable-languages=c,c++ --disable-libada --disable-libssp --disable-libmudflap --with-build-sysroot=/opt/avr32 &&
make &&
make install


Code:

make[2]: Leaving directory `/home/disc/toolchain/build-avr32-linux-gcc/gcc'
Checking multilib configuration...
/bin/sh ../gcc-4.1.2/mkinstalldirs avr32-linux/libstdc++-v3 ; \
        rm -f avr32-linux/libstdc++-v3/Makefile || : ; \
        cp multilib.out avr32-linux/libstdc++-v3/multilib.out
mkdir -p -- avr32-linux/libstdc++-v3
Configuring in avr32-linux/libstdc++-v3
configure: creating cache ./config.cache

(CUT-CUT-CUT)

checking for ld that supports -Wl,-z,relro... yes
checking for main in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[1]: *** [configure-target-libstdc++-v3] Ошибка 1
make[1]: Leaving directory `/home/disc/toolchain/build-avr32-linux-gcc'
make: *** [all] Error 2
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
AdrianB
PostPosted: Oct 04, 2007 - 01:21 PM
Wannabe


Joined: Sep 08, 2007
Posts: 66
Location: Ohio, US

Hi disconnect,
Were you able to fix this last error when compiling gcc?
I'm trying to build the latest toolchain (1.3.0) and I'm getting the same error.
Strangely enough, I did not have this error with 1.2.2 but it was on a different machine (a Sun Ultra running and older Fedora distribution)

Adrian
 
 View user's profile Send private message  
Reply with quote Back to top
hce
PostPosted: Oct 04, 2007 - 01:46 PM
Raving lunatic


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway

To build GCC 4.1.2, binutils 2.17 and uClibc 0.9.29 environment you could try out Buildroot for AVR32, located at http://www.atmel.no/buildroot

Still just release candidate, but fairly stable. MMC/SD card issue which is not yet solved when using the 2.6.22.atmel.4 kernel. Some SD-cards is not identified.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits