cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cross-compiling curl for PPC -- successful but weird

From: Richard Atterer <richard_at_2005.atterer.net>
Date: Tue, 19 Jul 2005 10:46:20 +0200

Just a few random remarks...

On Mon, Jul 18, 2005 at 07:55:59PM -0400, Robert P. J. Day wrote:
> export CFLAGS="-Wl,-rpath,/usr/local/eldk3.1.1/ppc_8xx/usr/kerberos/lib,\
> -rpath-link,/usr/local/eldk3.1.1/ppc_8xx/usr/kerberos/lib"

This looks a bit weird - usually, -rpath should not be necessary when
cross-compiling. Have you considered changing LIBRARY_PATH/C_INCLUDE_PATH
or (my favourite, causes fewer problems) writing a small wrapper script
which calls "ppc-linux-gcc -I/some/path -L/some/path" ?

> note that i'm not even selecting SSL support, but explicitly
> selecting krb4. also, i needed to use "--with-random" since, if i
> didn't, the configure failed claiming that i can't do file tests while
> cross-compiling.

Yes, --with-random always appears to be necessary when cross-compiling.

> SSL support: enabled (OpenSSL) [good, but weird]

Not weird; IIRC by default, the configure script enables SSL if it can find
the SSL libs. You'd need an explicit --without-ssl to disable it.

> zlib support: enabled
> krb4 support: no (--with-krb4*) [huh??]
...
> note that SSL is selected, but krb4 isn't. what's up with that? (and
> i never could get SSL support with any variation of "--with-ssl". i
> have no idea why selecting krb4 support suddenly gives me SSL.)

Have a look at config.log! Most likely there are some linker problems or
other problems with your cross-compiler setup.

> and after the configure, i seem to have a valid PPC curl executable,
> with the following shared lib references:
>
> $ ppc_8xx-ldd curl
> libcurl.so.3 => not found
> libssl.so.4 =>
> /usr/local/eldk3.1.1/ppc_8xx/usr/lib/libssl.so.4

Note that due to your use of -rpath, these paths to the libraries are now
_hardwired_ into the executable. This is probably not a good idea; it means
that on the machine where you actually run the curl executable, the libs
must be in exactly the same spot, they can't be e.g. in /usr/lib.

Cheers,

  Richard

-- 
  __   _
  |_) /|  Richard Atterer     |  GnuPG key:
  | \/¯|  http://atterer.net  |  0x888354F7
  ¯ '` ¯
Received on 2005-07-19