libjava doesn't link libgcj with -liconv during build when --with-libiconv-prefix=/opt/local is used, and no corresponding -L for the -liconv is issued on the link line when running the libjava testsuite (jni.exp) for the FAIL: PR16923 run testcase:
Executing on host: /Users/mrs/net/gcc-java/gcc/xgcc -B/Users/mrs/net/gcc-java/gcc/ /Users/mrs/net/gcc/libjava/testsuite/libjava.jni/invocation/PR16923.c -bind_at_load -multiply_defined suppress -I. -I.. -I/Users/mrs/net/gcc/libjava/testsuite/libjava.jni -I/Users/mrs/net/gcc/libjava/testsuite/../include -I/Users/mrs/net/gcc/libjava/testsuite/../classpath/include -fdollars-in-identifiers -L/Users/mrs/net/gcc-java/x86_64-apple-darwin10/./libjava/.libs -ljvm -shared-libgcc -lgcj -liconv -lm -o PR16923 (timeout = 300) The correct bit can be found in the Makefile: $ grep LTLIBICO x86_64-apple-darwin10/libjava/Makefile LTLIBICONV = -L/opt/local/lib -liconv -R/opt/local/lib The spec file appears it would work: $ cat x86_64-apple-darwin10/libjava/libgcj.spec [ ... ] %rename lib liborig *lib: %{s-bc-abi:} -lgcj -lm -L/opt/local/lib -liconv -lpthread -allow_stack_execute \ -ldl %(libgcc) %(liborig) [ ... ] as well. This was reported by Jack, in http://gcc.gnu.org/ml/java/2010-02/msg00003.html, but seems unresolved. xgcc (GCC) 4.5.0 20100324 (experimental) [trunk revision 157698] -- Summary: libjava incorrectly uses -liconv in testsuite, jni.exp when using --with-libiconv-prefix Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mrs at gcc dot gnu dot org GCC build triplet: x86_64-apple-darwin10 GCC host triplet: x86_64-apple-darwin10 GCC target triplet: x86_64-apple-darwin10 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43839