On Thu, Feb 10, 2011 at 05:27:10PM -0600, [email protected] wrote: > This occurs in src/auto/configure: When /lib/libiconv.so* is not > present, the short program in configure which references iconv_open() > compiles and links successfully, but if run it aborts due to the missing > shared object: > > ld.so.1: conftest: fatal: libiconv.so.2: open failed: No such file or > directory > [snip] > This kind of bug is easily reproducible by copying a no-op program into > conftest.c: > > int main () { return 0; } > > and compiling with: > > $ cc -o conftest -g -I/usr/local/include -L/usr/local/lib conftest.c > -lm -ltermlib -lelf -lnsl -lsocket -liconv > "conftest.c", line 192: warning: statement not reached
This sounds like a bug with the linker for not erroring out when it can't link against the libraries it has been told to link with. I tried that test locally (Linux system, so gcc) and the compile/link failed. > $ ./conftest > ld.so.1: conftest: fatal: libiconv.so.2: open failed: No such file or > directory > Killed > $ echo $? > 137 > > It seems to me that the correct solution is to *not* include -liconv > unless libiconv.so is actually present (and working). I'm not sure how > to achieve that with autoconf-style programs. The function being used > in this case is ac_fn_c_try_link() which has the following comment: One could change configure to try and run the program, but that's generally to be avoided since it inhibits cross-compiling. -- James GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>
signature.asc
Description: Digital signature
