openJDK7 build fails on 64bit cblfs linux
Kelly O'Hair
kelly.ohair at oracle.com
Sat Apr 16 16:00:55 UTC 2011
The Linux 64bit system I have (Fedora 9) has no libiconv libraries, you just include iconv.h
and use the iconv*() functions, no special linking options are needed, e.g. I have never had to use
-liconv on the link line for the npt library we create in the jdk.
(The jdk npt libtrary provises native platform transformations of characters for shared libraries
loaded before JVM initialization, like debugger VM agents and things like hprof.)
What kind of Linux is this?
What I suspect is that someone has corralled the iconv*() functions into it's own library and now
you not only need to include iconv.h, but you need to link with -liconv on this system.
You should check your man page on iconv or iconv_open.
If the -liconv needs to be added to the link line, we probably cannot add that for everyone because
it does not exist everywhere.
You might try
make OTHER_LDFLAGS=-liconv
but that will add it to everyone's link, in the jdk/make/java/npt/Makefile, you will need a
OTHER_LDFLAGS += -liconv
after the include of Library.gmk.
-kto
On Apr 16, 2011, at 4:18 AM, luxInteg wrote:
> On Friday 15 April 2011 17:55:43 Kelly O'Hair wrote:
>
>> Let me know what these say:
>> which make
> /usr/bin/make
>> which ant
> /opt/ant/bin/ant
>> which zip
> /usr/bin/zip
>> which unzip
> /usr/bin/unzip
>>
>
>
> I have made a bit of progress however the build now ends like so:-
>
> STATS: LIBRARY=npt, PRODUCT=sun, OPTIMIZATION_LEVEL=LOWER
> Rebuilding $SRS/openjdk/build/linux-amd64/lib/amd64/libnpt.so because of
> $SRS/openjdk/build/linux-amd64/tmp/sun/npt/obj64/.files_compiled mapfile-vers
> /usr/bin/gcc -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-
> parentheses -pipe -fno-omit-frame-pointer -D_LITTLE_ENDIAN -DNDEBUG -
> DARCH='"amd64"' -Damd64 -DLINUX -DRELEASE='"1.7.0-internal"' -
> D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -D_LP64=1 -I. -
> I$SRS/openjdk/build/linux-amd64/tmp/sun/npt/CClassHeaders -
> I../../../src/solaris/javavm/export -I../../../src/share/javavm/export -
> I../../../src/share/npt -I../../../src/solaris/npt -Xlinker -O1 -Xlinker -
> version-script=mapfile-vers -Xlinker -z -Xlinker origin -Xlinker -rpath -
> Xlinker \$ORIGIN -Xlinker -z -Xlinker defs -L$SRS/openjdk/build/linux-
> amd64/lib/amd64 -Wl,-soname=libnpt.so -shared -mimpure-text -o
> $SRS/openjdk/build/linux-amd64/lib/amd64/libnpt.so
> $SRS/openjdk/build/linux-amd64/tmp/sun/npt/obj64/npt.o
> $SRS/openjdk/build/linux-amd64/tmp/sun/npt/obj64/utf.o
> $SRS/openjdk/build/linux-amd64/tmp/sun/npt/obj64/utf_md.o -lc
> $SRS/openjdk/build/linux-amd64/tmp/sun/npt/obj64/utf_md.o: In function
> `iconvConvert':
> utf_md.c:(.text+0xd3): undefined reference to `libiconv'
> ---
> collect2: ld returned 1 exit status
>
> ######
>
> In otherwords it is failing to find libiconv. And I have iconv
>
> root [ ~ ]# ls -l /usr/lib/*iconv*
> -rw-r--r-- 1 root root 938 Apr 9 03:09 /usr/lib/libiconv.la
> lrwxrwxrwx 1 root root 17 Apr 9 03:09 /usr/lib/libiconv.so ->
> libiconv.so.2.5.0
> lrwxrwxrwx 1 root root 17 Apr 9 03:09 /usr/lib/libiconv.so.2 ->
> libiconv.so.2.5.0
> -rw-r--r-- 1 root root 970461 Apr 9 03:09 /usr/lib/libiconv.so.2.5.0
> -rw-r--r-- 1 root root 962959 Apr 9 03:09 /usr/lib/preloadable_libiconv.so
> root [ ~ ]#
>
> For a fix I I tried the following to no avail:-
> --A) Looked through the README.builds.html
> ( http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html )
> and found no obvoious settings for forcing the build program to see
> /usr/lib/libiconv.
> --B) set the envronmental variable LDFLAGS="-L/usr/lib"
> --C) made a wild guess and set the environmental variable LIBS="liconv"
> --D) tried setting LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} which
> resulted in complaints that it should be unset
>
> advice would be appreiated
>
More information about the build-dev
mailing list