Cross compiling for ARM with Autoconf

I had a problem cross-compiling a library for my board using autconf.

I am using this line:

./configure --target=arm-linux --host=arm-linux --prefix=/bla/bla/bla/linux_arm_tool CFLAGS='-m32'
make
make install

When I do fileto check this, I get:

libjpeg.so.8.4.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

This does not seem to be correct, but I still tried to use it ... and I get:

/usr/lib/gcc/arm-linux-gnueabi/4.5.3/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /bla/bla/bla/bla/../linux_arm_tool/lib/libjpeg.so when searching for -ljpeg

I’m at a loss, I’ve been online for more than an hour ...

+5
source share
3 answers

So, I knew that I cross-compiled before using really basic method calls, and I understood why I left with this earlier, having studied the output:

checking for arm-linux-gnueabi-gcc... no
checking for gcc... gcc
...
...
checking for arm-linux-gnueabi-gcc... gcc

In mine was /usr/binnot arm-linux-gnueabi-gcc, I had to:

ln -s /usr/bin/arm-linux-gnueabi-gcc-4.5 /usr/bin/arm-linux-gnueabi-gcc

I successfully compiled with:

./configure --host=arm-linux-gnueabi -prefix=${CSTOOL_DIR}/linux_arm_tool

... - , , -rpath-link .

+12

, : " Autoconf ARM?"

./configure -h:

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

GNU :

http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Hosts-and-Cross_002dCompilation.html

, --host --build:

Therefore, whenever you specify --host, be sure to specify --build too.

, iperf ARM:

, "./configure" script "Autoconf", google-ing. :

  • - $PATH
  • CC CXX, -
  • --host --build

    buildpath    <--- my little script to setup my $PATH
    export CC=arm_v5t_le-gcc
    export CXX=arm_v5t_le-g++
    ./configure --host=armv5tl-montavista-linux-gnueabi --build=x86_64-linux-gnu
    
+5

CC, LD . , , ( )

, : http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux

, script, - node.js - : https://gist.github.com/edhemphill/5094239

libjpeg will not work b / c with its x86 binary, you need it to say:

 ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, not stripped

or similar.

That's why you get skipping incompatible

+3
source

All Articles