autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Not-really-cross-compilation issues


From: Peter Eisentraut
Subject: Re: Not-really-cross-compilation issues
Date: Sun, 21 Jan 2001 11:42:08 +0100 (CET)

address@hidden writes:

> > # With Autoconf 2.50-to-be:
> >
> > $ LIBS='-L/tmp/obscure -ltest' ./configure
> > checking for gcc... gcc
> > checking whether the C compiler works... configure: error: cannot run C 
> > compiled programs.
> > To enable cross compilation, use `--host'.

> Could you try see what happened?  For instance, what does that config.log
> contain?

configure:893: checking for gcc
configure:915: result: gcc
configure:1137: checking whether the C compiler works
configure:1152: gcc -o conftest    conftest.c -L/tmp/obscure -ltest >&5
configure:1155: $? = 0
configure:1156: test -s conftest
configure:1159: $? = 0
configure:1163: ./conftest
./conftest: error while loading shared libraries: libtest.so: cannot open 
shared object file: No such file or directory
configure:1166: $? = 127
configure:1172: error: cannot run C compiled programs.
To enable cross compilation, use `--host'.
configure: exit 1

The problem here is that the compiler finds -ltest because of the -L, but
the run-time linker doesn't.  (A more realistic example of this scenario
is gcc picking up a library in /usr/local/lib, while the run-time linker
won't look there by default.)

Autoconf now assumes that if you can't run a program then you must be
cross-compiling, so you should use --host.  At the same time it would work
completely fine if it just assumed you were cross-compiling and proceeded.
(Although people may point out that this not really cross-compilation it's
still equivalent in some aspects.)

You will get the same failure, btw., if your build tree is on a noexec
partition, because the test program won't run.

-- 
Peter Eisentraut      address@hidden       http://yi.org/peter-e/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]