United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6613927 Compilation of splashscreen png library failed on Ubuntu 7.04 (64bit)
6613927 : Compilation of splashscreen png library failed on Ubuntu 7.04 (64bit)

Details
Type:
Bug
Submit Date:
2007-10-07
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
client-libs
OS:
linux
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports
Backport:
Relates:

Sub Tasks

Description
Recent jdk sources failed to compile on Ubuntu 7.04 (64bit). Here is extract from the log (attached).

...

../../../build/linux-amd64/tmp/sun/sun.awt/splashscreen/obj64_g/png.o: In function `png_init_mmx_flags':
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/png.c:830: undefined reference to `png_mmx_support'
../../../build/linux-amd64/tmp/sun/sun.awt/splashscreen/obj64_g/pngpread.o: In function `png_push_process_row':
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngpread.c:847: undefined reference to `png_read_filter_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngpread.c:866: undefined reference to `png_do_read_interlace'
../../../build/linux-amd64/tmp/sun/sun.awt/splashscreen/obj64_g/pngpread.o: In function `png_progressive_combine_row':
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngpread.c:1595: undefined reference to `png_combine_row'
../../../build/linux-amd64/tmp/sun/sun.awt/splashscreen/obj64_g/pngread.o: In function `png_read_row':
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:651: undefined reference to `png_combine_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:661: undefined reference to `png_combine_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:671: undefined reference to `png_combine_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:681: undefined reference to `png_combine_row'
../../../build/linux-amd64/tmp/sun/sun.awt/splashscreen/obj64_g/pngread.o:/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:691: more undefined references to `png_combine_row' follow
../../../build/linux-amd64/tmp/sun/sun.awt/splashscreen/obj64_g/pngread.o: In function `png_read_row':
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:774: undefined reference to `png_read_filter_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:804: undefined reference to `png_do_read_interlace'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:807: undefined reference to `png_combine_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:810: undefined reference to `png_combine_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:817: undefined reference to `png_combine_row'
/export/java2d/j2se/make/sun/splashscreen/../../../src/share/native/sun/awt/libpng/pngread.c:819: undefined reference to `png_combine_row'
collect2: ld returned 1 exit status
make[3]: *** [../../../build/linux-amd64/lib/amd64/libsplashscreen.so] Error 1
make[3]: Leaving directory `/export/java2d/j2se/make/sun/splashscreen'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/export/java2d/j2se/make/sun'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/export/java2d/j2se/make'
make: *** [debug] Error 2
Command exited with non-zero status 2

                                    

Comments
SUGGESTED FIX

--- old/make/sun/splashscreen/Makefile	2007-10-11 13:50:27.000000000 +0400
+++ new/make/sun/splashscreen/Makefile	2007-10-11 13:50:27.000000000 +0400
@@ -85,3 +85,11 @@
 CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen
 CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
 
+ifeq ($(ARCH_DATA_MODEL), 64)
+  # 64-bit compilers have problems compiling MMX instructions.
+  # Google it for more details. Possibly the newer versions of
+  # the PNG-library and/or the new compilers will not need this
+  # option in the future.
+  CPPFLAGS += -DPNG_NO_MMX_CODE
+endif
+
                                     
2007-10-11
EVALUATION

Googling shows that MMX instructions cannot be correctly compiled by 64-bit compilers, so the workaround is good. We can enable it if we detect we build on a 64-bit platform.
                                     
2007-10-10
WORK AROUND

I'm using following patch as work around of the problem:

------- make/sun/splashscreen/Makefile -------
65a66
>   C_INCLUDE_PATH = $(SHARE_SRC)/native/$(PKGDIR)/splashscreen
87c88
< 
---
> CPPFLAGS += -DPNG_NO_MMX_CODE
                                     
2007-10-07



Hardware and Software, Engineered to Work Together