LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-11-2006, 05:00 AM   #1
NeoMagic
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Rep: Reputation: 0
cross compilation


hi all

Most of us r aware of the "./configure" while building some apps from soure. While configure is running i observed that it buidls a 'sample code'
with the configuration found and tries to run it succesfully, before it goes for further configuration.

The problem is , if we r cross compiling, it may run the target code on the host(i686) and complains -"cannot run test program while crosscompiling".

I started off with - "./configure --host=arm-linux" and stuck here. By the way the package iam compiling is gstreamer.


Thanks & Regards,
Neo
 
Old 12-11-2006, 06:38 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,755

Rep: Reputation: 466Reputation: 466Reputation: 466Reputation: 466Reputation: 466
Usually there's an option in configure for --disable-gtktest or similar which will disable compiling of test programms. Try ./configure --help to see what's available.
 
Old 12-11-2006, 11:04 PM   #3
NeoMagic
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
its a generic problem

no, iam not talking of compilation of test programs of gstreamer.
configure generates a temparory file to check everything is ok with its assumptions. The stated problem is a generic one for any package which uses './configure' for build.
 
Old 12-12-2006, 02:22 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,755

Rep: Reputation: 466Reputation: 466Reputation: 466Reputation: 466Reputation: 466
That's exactly what I mean, except it's not a generic autoconf feature. But many packages include such options for disabling tests.
If you would do as I suggested you'll see that the gstreamer sources have 2 of them --disable-tests and --disable-failing-tests ( an obvious clue that your problem is a common one). I mentioned --disbale-gtktest because it is very commonly seen in gtk-based apps. --disable-tests is also seen a lot, but it is not a standard autoconf thing.
'arm-linux' may not be the correct syntax for the host system. You may need to help configure by specifying the target as well.
 
Old 12-12-2006, 11:31 PM   #5
NeoMagic
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
configure: error: cannot run test program while cross compiling

i tried those disable flags. but still iget :
configure: error: cannot run test program while cross compiling

Iam pasting my complete log here for reference :

./configure --host=arm-linux --disable-tests --disable-failing-tests --disable-gtktest
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
configure: configuring gstreamer for release
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for arm-linux-strip... arm-linux-strip
checking for arm-linux-gcc... arm-linux-gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gcc accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of arm-linux-gcc... gcc3
checking for strerror in -lcposix... no
checking for ld used by GCC... /home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld
checking if the linker (/home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld) is GNU ld... yes
checking for /home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /home/bayyavs/tools-2.4.25/bin/arm-linux-nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )
checking command to parse /home/bayyavs/tools-2.4.25/bin/arm-linux-nm -B output... ok
checking how to run the C preprocessor... arm-linux-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for arm-linux-file... no
checking for file... /usr/bin/file
checking for arm-linux-ranlib... arm-linux-ranlib
checking for arm-linux-strip... (cached) arm-linux-strip
checking for objdir... .libs
checking for arm-linux-gcc option to produce PIC... -fPIC
checking if arm-linux-gcc PIC flag -fPIC works... yes
checking if arm-linux-gcc static flag -static works... yes
checking if arm-linux-gcc supports -c -o file.o... yes
checking if arm-linux-gcc supports -c -o file.lo... yes
checking if arm-linux-gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/home/bayyavs/tools-2.4.25/arm-linux-uclibc/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether -lc should be explicitly linked in... no
creating libtool
checking for arm-linux-gcc option to accept ANSI C... none needed
checking for compiler flavour... configure: error: cannot run test program while cross compiling


So as u see from last line, i still cant stop it from testing.
 
Old 12-13-2006, 02:19 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,755

Rep: Reputation: 466Reputation: 466Reputation: 466Reputation: 466Reputation: 466
You may have to modify the configure.ac or configure.in file and delete the check which is causing problems. Cross compiling with autoconf is pretty tricky and usually needs some tweaking of the config files or makefiles to work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB keyboard on cross compilation bk_bharani123 Red Hat 2 05-04-2006 12:33 AM
libcurl cross-compilation pls help lucky6969b Programming 8 12-28-2005 11:55 PM
Cross-Compilation Question lucky6969b Linux - Software 0 12-01-2005 07:31 PM
cross compilation Kocil Slackware 6 12-18-2003 01:53 PM
Cross-compilation radhapriya Linux - Software 0 08-11-2003 07:24 AM


All times are GMT -5. The time now is 07:09 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration