----- Original Message ----- > On 10/08/2012 18:40, Andrew Hughes wrote: > > ----- Original Message ----- > >> Hi Andrew > >> > >> Alan mentioned the other day that the build (with your latest > >> patch, > >> with zlib-dev) failed at pack200 > >> when he tried to turn it on on linux. Can your double check on > >> your > >> system? > >> > > What kind of failure? All webrevs I've posted pass a complete > > build here, > > and we've been using system zlib for years as previously mentioned, > > so I'm > > surprised by this. > > > I grabbed your patch a few days ago and did a build+test job on all > platforms (Linux/Solaris/Mac/Windows) and didn't see any issues. This > was of course using the defaults, I didn't set SYSTEM_ZLIB > explicitly. > > However I did see an issue on Ubuntu 12.0.4 (32-bit) with > SYSTEM_ZLIB=true. Attached is the tail of the log. I haven't had time > to > look at it but I do see that libzip.so is built as expected (ldd > shows > it is linked to libz). The build failure is with unpack200 as it uses > the the zlib functions. Building with SYSTEM_ZLIB=false is fine on > this > system. > > -Alan > > rm -f ../../../../../build/linux-i586/bin/unpack200 > rm -f > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack/mapfile-vers > /bin/cp mapfile-vers-unpack200 > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack/mapfile-vers > /usr/bin/gcc -O2 -DPRODUCT -fPIC -DCC_NOEX -W -Wall -Wno-unused > -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN -DFULL > -DSYSTEM_ZLIB -DNDEBUG -DARCH='"i586"' -Di586 -DLINUX > -DRELEASE='"1.8.0-internal"' -D_LARGEFILE64_SOURCE -D_GNU_SOURCE > -D_REENTRANT -I. > -I../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack/CClassHeaders > -I../../../../../src/closed/share/javavm/export > -I../../../../../src/solaris/javavm/export > -I../../../../../src/share/javavm/export > -I../../../../../src/share/native/common > -I../../../../../src/solaris/native/common > -I../../../../../src/share/native/com/sun/java/util/jar/pack > -I../../../../../src/solaris/native/com/sun/java/util/jar/pack > -Xlinker -O1 -Xlinker -version-script=mapfile-vers > -Wl,--hash-style=both -Xlinker -z -Xlinker origin -Xlinker -rpath > -Xlinker \$ORIGIN -Xlinker -z -Xlinker defs > -L../../../../../build/linux-i586/lib/i386 -Wl,-soname=libunpack.so > -lz -lc > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/bands.o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/bytes.o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/coding.o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/unpack.o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/utils.o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/zip.o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/main.o > -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic -o > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack/unpack200 > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/zip.o: > In function `jar::deflate_bytes(bytes&, bytes&)': > zip.cpp:(.text+0x79b): undefined reference to `deflateInit2_' > zip.cpp:(.text+0x828): undefined reference to `deflate' > zip.cpp:(.text+0x842): undefined reference to `deflateEnd' > zip.cpp:(.text+0x854): undefined reference to `deflateEnd' > zip.cpp:(.text+0x87c): undefined reference to `deflate' > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/zip.o: > In function `jar::addJarEntry(char const*, bool, int, bytes&, > bytes&)': > zip.cpp:(.text+0x8d2): undefined reference to `crc32' > zip.cpp:(.text+0x9d1): undefined reference to `crc32' > zip.cpp:(.text+0x9ee): undefined reference to `crc32' > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/zip.o: > In function `gunzip::free()': > zip.cpp:(.text+0xb33): undefined reference to `inflateEnd' > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/zip.o: > In function `read_input_via_gzip(unpacker*, void*, long long, long > long)': > zip.cpp:(.text+0xbfe): undefined reference to `inflate' > ../../../../../build/linux-i586/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj/zip.o: > In function `gunzip::start(int)': > zip.cpp:(.text+0xf35): undefined reference to `inflateInit2_' > collect2: ld returned 1 exit status > >
Ok, the obvious difference between my output and yours is you seem to be linking statically via gcc rather than dynamically with g++. /usr/bin/g++ -O2 -DPRODUCT -fPIC -DCC_NOEX -W -Wall \ -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN -g \ -DFULL -DSYSTEM_ZLIB -DNDEBUG -DARCH='"amd64"' -Damd64 -DLINUX -DRELEASE='"1.8.0-internal"' \ -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -D_LP64=1 -I. \ -I/home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack/CClassHeaders \ -I../../../../../src/solaris/javavm/export -I../../../../../src/share/javavm/export \ -I../../../../../src/share/native/common -I../../../../../src/solaris/native/common \ -I../../../../../src/share/native/com/sun/java/util/jar/pack \ -I../../../../../src/solaris/native/com/sun/java/util/jar/pack \ -Xlinker -O1 -Xlinker -version-script=mapfile-vers -Xlinker -z -Xlinker origin \ -Xlinker -rpath -Xlinker \$ORIGIN -Xlinker -z -Xlinker defs -L/home/andrew/builder/awt/lib/amd64\ -Wl,-soname=libunpack.so -lz -lc \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/bands.o \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/bytes.o \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/coding.o \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/unpack.o \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/utils.o \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/zip.o \ /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack-cmd/obj64/main.o \ -lstdc++ -o /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack/unpack200 /bin/cp /home/andrew/builder/awt/tmp/sun/com.sun.java.util.jar.pack/unpack/unpack200 \ /home/andrew/builder/awt/bin/unpack200 Checking for mapfile use in: /home/andrew/builder/awt/bin/unpack200 Library loads for: /home/andrew/builder/awt/bin/unpack200 linux-vdso.so.1 (0x00007ffff315c000) libz.so.1 => /lib64/libz.so.1 (0x00007fd609351000) libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/libstdc++.so.6 (0x00007fd60904a000) libm.so.6 => /lib64/libm.so.6 (0x00007fd608d56000) libc.so.6 => /lib64/libc.so.6 (0x00007fd6089ac000) libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/libgcc_s.so.1 (0x00007fd608796000) /lib64/ld-linux-x86-64.so.2 (0x00007fd609567000) RUNPATH for: /home/andrew/builder/awt/bin/unpack200 0x0000000000000001 (NEEDED) Shared library: [libz.so.1] 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x000000000000000f (RPATH) Library rpath: [$ORIGIN] 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN] Do you have a static libz.a installed (from zlib1g-dev) and all dependent static libraries? I suspect you'll get the same failure with or without my patch (though you'll probably need the change to defines.h to get this far...) I'd guess you have STATIC_CXX set to true (the default apparently): >From Compiler-gcc.gmk: STATIC_CXX = true ifeq ($(STATIC_CXX),true) # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++" # We need to use gcc to statically link the C++ runtime. gcc and g++ use # the same subprocess to compile C++ files, so it is OK to build using gcc. CXX = $(COMPILER_PATH)gcc else CXX = $(COMPILER_PATH)g++ endif >From Defs-linux.gmk: ifeq ($(STATIC_CXX),true) override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic else override LIBCXX = -lstdc++ endif -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07