cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CrossCompiling libcurl for ARM/snapgear/Intel IXDP425

From: Michael Wood <esiotrot_at_gmail.com>
Date: Fri, 27 Feb 2009 22:53:33 +0200

Hi

On Fri, Feb 27, 2009 at 8:57 PM, Michael Graf
<calgarycomputertech_at_gmail.com> wrote:
> Hi all, sorry if this is noob.
>
> I have an Astra RFID reader and I'm trying to compile the libcurl libraries
> for use on the device. It uses the arm-linux-gcc compiler, snapgear-3.0.0
> files and has a Intel IXDP425 chip in it. I'm not sure which of those
> details are relevant.
>
> I made a configure script similar to the one found in
> /curl-7.19.3/docs/INSTALL . The script is as follows:
> #! /bin/sh
>
>    export PATH=$PATH:/usr/local/bin
> # export CPPFLAGS="-I/opt/hardhat/
> devkit/ppc/405/target/usr/include"
>    export AR=arm-linux-ar
>    export AS=arm-linux-as
>    export LD=arm-linux-ld
>    export RANLIB=arm-linux-ranlib
>    export CC=arm-linux-gcc
>    export NM=arm-linux-nm

Do you need to set all of those? Normally it's sufficient to run
configure with the right --host option. As far as I understand it
--target is only for things like compilers/assemblers that output
binaries. Not things like curl/libcurl. --build should be guessed
correctly.

So try unsetting all of these (except PATH) and then calling configure
with only --host, --prefix and --exec-prefix.

>    ./configure --target=arm-linux \
>     --host=arm-linux-linux \

Are you sure "arm-linux-linux" is right? I would have thought just
"arm-linux" based on the names of the binaries in your toolchain.

>     --build=i586-pc-linux-gnu \
>     --prefix=/usr/local/arm-linux/lib-independent \
>     --exec-prefix=/usr/local/

So try this (after making sure you have UNset CC, AS, NM, etc., etc.):

./configure --host=arm-linux --prefix=... --exec-prefix=...

> When I run the script the configure has an error as follows:
> $ ./make4ARM.sh checking whether to enable maintainer-specific portions of
[...]
> checking for C compiler default output file name...
> configure: error: C compiler cannot create executables
> See `config.log' for more details.
>
>
> finally the config.log is appended to the end of this mail.
>
> Please let me know if more info is required or if you know how to deal with
> this.
> TIA,
> -Mike Graf
>
> [config.log]
[snip]
> configure:2471: checking for arm-linux-linux-ar
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> configure:2505: result: no
> configure:2515: checking for ar
> configure:2534: found /usr/bin/ar
> configure:2546: result: /usr/bin/ar
                  ^^^^^^^^^^^^^^^^^^

I think this is a symptom of your "arm-linux-linux" and may be the
cause of your problem.

> configure:2560: WARNING: In the future, Autoconf will not detect cross-tools
> whose name does not start with the host triplet.  If you think this
> configuration is useful to you, please write to autoconf_at_gnu.org.

I'm not sure if this warning is relevant, but I think they would
prefer something like "arm-unknown-linux" or "arm-unknown-linux-gnu"
instead of "arm-linux". You might find that there are binaries called
"arm-unknown-linux-gcc" etc. while the "arm-linux-gcc" etc. are just
symlinks to them.

[snip]
> configure:2937: checking for arm-linux-linux-strip
> configure:2967: result: no
> configure:2977: checking for strip
> configure:2993: found /usr/bin/strip
> configure:3004: result: strip
                  ^^^^^^^^^^^^^
> configure:3045: checking curl version
> configure:3047: result: 7.19.3
> configure:3084: checking build system type
> configure:3102: result: i586-pc-linux-gnu
> configure:3124: checking host system type
> configure:3139: result: arm-linux-linux-gnu
> configure:3179: checking for style of include used by make
> configure:3207: result: GNU
> configure:3243: checking for arm-linux-linux-gcc
> configure:3270: result: arm-linux-gcc
> configure:3548: checking for C compiler version
> configure:3555: arm-linux-gcc --version >&5
> arm-linux-gcc (GCC) 3.2.1
[snip]

I'm not sure why configure finds your gcc, but not ar and strip.

> configure:3600: checking for C compiler default output file name
> configure:3627: arm-linux-gcc    conftest.c  >&5
> /usr/local/arm-linux/lib/libc.so.6: could not read symbols: Invalid
> operation  <----- Note: This file exists and I have read permissions

I don't know what "Invalid operation" means in this context, but I
suspect this is as a result of the wrong binaries being used when
trying to compile this code.

> collect2: ld returned 1 exit status
> configure:3630: $? = 1
> configure:3668: result:
> configure: failed program was:
> | /* confdefs.h.  */
> | #define PACKAGE_NAME "curl"
> | #define PACKAGE_TARNAME "curl"
> | #define PACKAGE_VERSION "-"
> | #define PACKAGE_STRING "curl -"
> | #define PACKAGE_BUGREPORT "a suitable curl mailing list =>
> http://curl.haxx.se/mail/"
> | #define PACKAGE "curl"
> | #define VERSION "7.19.3"
> | #define OS "arm-linux-linux-gnu"
> | /* end confdefs.h.  */
> |
> | int main (void)
> | {
> |
> |  ;
> |  return 0;
> | }
> configure:3675: error: C compiler cannot create executables
> See `config.log' for more details.

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-02-27