Help me about arm-linux-gcc cross compiler and tslib !

kdich
Hi everybody !

I'm newbie in Embedded System and FriendlyARM !

I using Tiny6410 board and cross-compiler in DVD (arm-linux-gcc v4.5.1).. I
extract arm-linux-gcc to /opt/FriendlyARM/... I build hello-world program
and run ok in board.

But, I try to compile tslib-1.0 and run in board, terminal report :
Segmentation fault. 
[root@FriendlyARM bin]# ./ts_calibrate
Segmentation fault
[root@FriendlyARM bin]# gdb ./ts_calibrate
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-none-linux-gnueabi"...
(gdb) run
Starting program: /sdcard/navit/bin/ts_calibrate 

Program received signal SIGSEGV, Segmentation fault.
0x403f40a0 in ?? ()
(gdb) bt
#0  0x403f40a0 in ?? ()
(gdb) list
1      
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.5.1/libgcc/../gcc/c
onfig/arm/lib1funcs.asm:
No such file or directory.
        in
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.5.1/libgcc/../gcc/c
onfig/arm/lib1funcs.asm

After, I download arm-linux-gcc v4.4.3 and re-cross compile tslib-1.0, same
probem happen :

[root@FriendlyARM bin]# ./ts_calibrate
Segmentation fault
[root@FriendlyARM bin]# gdb ./ts_calibrate
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-none-linux-gnueabi"...
(gdb) run
Starting program: /sdcard/navit/bin/ts_calibrate 

Program received signal SIGSEGV, Segmentation fault.
0x403f40a0 in ?? ()
(gdb) bt
#0  0x403f40a0 in ?? ()
(gdb) list
1      
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/libgcc/../gcc/c
onfig/arm/lib1funcs.asm:
No such file or directory.
        in
/opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3./libgcc/../gcc/
config/arm/lib1funcs.asm

But, I run ts_calibrate of kernel is very good. I don't understand why
ts_calibarate need lib1funcs.asm which saved in arm-linux-gcc program on
computer.
Even through I set binary mode in gftp. I try to both save my pre-tslib in
SDCARD and send to board via gftp in binary mode.

Please, tell me why ? Thanks you very much !

kdich
My cross-compile v4.5.1:

root@kdich:/home/kdich# arm-linux-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gcc
COLLECT_LTO_WRAPPER=/opt/FriendlyARM/toolschain/4.5.1/libexec/gcc/arm-none-linux
-gnueabi/4.5.1/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /work/toolchain/build/src/gcc-4.5.1/configure
--build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu
--target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.5.1
--with-sysroot=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root

--enable-languages=c,c++ --disable-multilib --with-cpu=arm1176jzf-s
--with-tune=arm1176jzf-s --with-fpu=vfp --with-float=softfp
--with-pkgversion=ctng-1.8.1-FA --with-bugurl=http://www.arm9.net/
--disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--with-gmp=/work/toolchain/build/arm-none-linux-gnueabi/build/static
--with-mpfr=/work/toolchain/build/arm-none-linux-gnueabi/build/static
--with-ppl=/work/toolchain/build/arm-none-linux-gnueabi/build/static
--with-cloog=/work/toolchain/build/arm-none-linux-gnueabi/build/static
--with-mpc=/work/toolchain/build/arm-none-linux-gnueabi/build/static
--with-libelf=/work/toolchain/build/arm-none-linux-gnueabi/build/static
--enable-threads=posix
--with-local-prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys
-root
--disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.5.1 (ctng-1.8.1-FA)



v4.4.3

root@kdich:/home/kdich# 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)

davef
http://mini2440vietnam.blogspot.co.nz/2011/04/upgrade-qt462-in-mini2440....

Maybe, step 1 will help.  Or tell us how you cross-compiled tslib.

davef
Also, check your tslib binary with:

readelf -a <filename> and ensure that near the end it says armv4t
or
readelf -A <filename>

Juergen Beisert
davef,
the Tiny6410 comes with a different processor than the Mini2440. The
Tiny6410 SoC's CPU core is a "ARM1176jzf-s". This is an "armv6". A
correspondig compiler should create code where "readelf" should report
"armv6zk". But also "armv4t" code will run on this CPU.
I guess it is a library issue. The compiler links the code to a different
libc than it is installed on the target.
Once again we are at the point a developer needs a reliable build system to
create a consistent root filesystem.

kdich
Thanks all !

davef :

Yes, I build tslib by same way. I think my problem isn't due to my way
which I use to build tslib.

Juergen Beisert :

I thinks so. Build for armv4 good run in armv6. But "Once again we are at
the point a developer needs a reliable build system to
create a consistent root filesystem." Can you tell me clear ?

Juergen Beisert
"Can you tell me clear ?"

Mixing binaries from different and/or unknown sources is a pain. Sometimes
it works, most of the time it fails (and no hope for help, because nobody
can reproduce the setting).

Google for buildroot, PTXdist and so on. These environments will help you
to get a consistent root filesystem.

kdich
Juergen Beisert . Thanks you !

kdich
Hi Juergen Beisert !

I using buildroot to build root file system and toolschain. But, When I use
toolschain to build a hello_project and run, terminal report : file not
found! Show me what's wrong ? I test file hello which I cross-compile in PC
no problem.

Thanks you !

Juergen Beisert
Run the "readelf" tool with the option -d on your binary. What libaries it
reports as required (keyword is (NEEDED))? If one of the listed libraries
is missing on your target (at run-time) you will get this annyoing error
message). Just provide all shared libraries on your target which your
binary requires.

Ravikumar
Hi,

Can I get a complete procedure to do the cross compilation of Qt4.8.0 for
mini2440 in ubuntu 12.04.

Thank you!

davef
http://mini2440vietnam.blogspot.co.nz/2011/04/upgrade-qt462-in-mini2440....

Should be a good start.

davef
:)  I should have looked further up the thread!

Ravikumar
Dear davef,

Thanks for your reply.

I have already tried with this,

http://mini2440vietnam.blogspot.co.nz/2011/04/upgrade-qt462-in-mini2440....

But i am getting error during the 'make'. Also this is the procedure for Qt
4.6.2. I am using Qt4.8.0

Please help me..

Ravikumar
Hi davef,

Im getting below error,

The tslib functionality test failed!
 You might need to modify the include and library search paths by editing
 QMAKE_INCDIR and QMAKE_LIBDIR in
 /usr/local/qt-everywhere-opensource-src-4.6.2/mkspecs/qws/linux-arm-g++.

davef
Seems like a lot of people had this problem in the loooong list of comments
at the bottom of the tutorial.

I recall posting a Howto after I battled with this, somewhere on this site.
 There are some quite long Qt threads over the last few years.  

Sorry, it is midnight here so if you don't find anything bump the thread
and I'll have another look tomorrow.

Ravikumar
Hi davef,

Still not able to solve the problem. Expecting your guidance at the
earliest.

Thanks

davef
Ok, I have had a good search but can not find what I think I am looking
for.  I can tell you I had lots of grief doing this myself and then about 
years ago discovered the Pengutronix BSP.  Qt, which I only use to run a
web browser on my target became quite easy.

I did find my HowTo for that:  search PTXdist_Qt and Browser.zip

It is not going to help with your problem.

I would suggest you create another thread titled something like :

tslib search paths

and copy your error message.

You did try throwing the whole error message into Google?

Good luck.

davef
Did you see this:
http://www.friendlyarm.net/forum/topic/4853

I found the thread that might give you an idea of the process:
http://www.friendlyarm.net/forum/topic/906