Closed Bug 17611 Opened 25 years ago Closed 25 years ago

imagelib fails to compile with Sun Workshop 5.0 Compiler

Categories

(Core :: Graphics: ImageLib, defect, P3)

Sun
Solaris
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: akhil.arora, Assigned: dmosedale)

Details

(Whiteboard: Sun Workshop compiler bug?)

CC -library=iostream -o color.o -c   -DMOZILLA_CLIENT -DBROKEN_QSORT=1
-DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DMOZ_DEFAULT_TOOLKIT=\"gtk\" -DSTDC_HEADERS=1
-DHAVE_ST_BLKSIZE=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1
-DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_SYS_BYTEORDER_H=1
-DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_FILIO_H=1 -DHAVE_SYS_IPC_H=1
-DHAVE_SYS_SHM_H=1 -DHAVE_X11_EXTENSIONS_XSHM_H=1 -DHAVE_SYS_STATVFS_H=1
-DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_MOUNT_H=1 -DHAVE_LIBM=1
-DHAVE_LIBDL=1 -DHAVE_LIBRESOLV=1 -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1
-DHAVE_LIBELF=1 -DHAVE_LIBINTL=1 -DHAVE_LIBPOSIX4=1 -DHAVE_LIBW=1 -D_REENTRANT=1
-DHAVE_RANDOM=1 -DHAVE_QSORT=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1
-DHAVE_SNPRINTF=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STATVFS=1 -DHAVE_MEMMOVE=1
-DHAVE_GETTIMEOFDAY=1 -DGETTIMEOFDAY_TWO_ARGS=1 -DHAVE_VALLOC=1
-DHAVE_IOS_BINARY=1 -DHAVE_OSTREAM=1 -DHAVE_CPP_EXPLICIT=1
-DHAVE_CPP_SPECIALIZATION=1 -DHAVE_CPP_USING=1 -DHAVE_CPP_NEW_CASTS=1
-DHAVE_I18N_LC_MESSAGES=1 -DMOZ_MAIL_NEWS=1 -DNECKO=1 -DClientWallet=1
-DCookieManagement=1 -DSingleSignon=1 -DNDEBUG=1 -DTRIMMED=1
-DMOZ_USER_DIR=\".mozilla\" -DMOZ_DISABLE_DTD_DEBUG=1 -DMOZ_DLL_SUFFIX=\".so\"
-DXP_UNIX=1 -DUNIX_EMBED=1 -DX_PLUGINS=1 -DUNIX_LDAP=1 -DUNIX_ASYNC_DNS=1
-DJS_THREADSAFE=1 -DLAYERS=1  -mt -fast  -KPIC  -DOSTYPE=\"SunOS5\" -DOJI -I.
-I../../../dist/include -I../../../dist/include -I../../../dist/include
-I../../../include  -I../../../dist/public/jpeg -I../../../dist/public/png
-I../../../dist/public/zlib  -I/usr/openwin/include  color.cpp
"/usr/include/memory.h", line 21: Error: Only one of a set of overloaded
functions can be extern "C".
"/usr/include/memory.h", line 21: Error: std::memchr(const void*, int,
unsigned), returning void*, was previously declared returning const void*.
"color.cpp", line 619: Warning (Anachronism): Formal argument 4 of type extern
"C" int(*)(const void*,const void*,void*) in call to NS_QuickSort(void*,
unsigned, unsigned, extern "C" int(*)(const void*,const void*,void*), void*) is
being passed int(*)(const void*,const void*,void*).
2 Error(s) and 1 Warning(s) detected.
gmake[2]: *** [color.o] Error 2
gmake[2]: Leaving directory `/opt/ws/mozilla/modules/libimg/src'
gmake[1]: *** [libs] Error 2
gmake[1]: Leaving directory `/opt/ws/mozilla/modules/libimg'
gmake: *** [libs] Error 2

uname -a
SunOS trayambakam 5.7 Generic_106541-07 sun4u sparc SUNW,Ultra-60

CC -V
CC: WorkShop Compilers 5.0 98/12/15 C++ 5.0

/usr/include/memory.h defines memchr as -

#if defined(__STDC__)
extern void *memccpy(void *, const void *, int, size_t);
extern void *memchr(const void *, int, size_t);
...
Status: NEW → ASSIGNED
Target Milestone: M12
mcafee, slamm:
Are you seeing this build problem?
-pn
I have not built on Solaris for a long, long time. :-/
Assignee: pnunn → mcafee
Status: ASSIGNED → NEW
stealing from pam
It works if I modify /usr/include/memory.h to

extern const void *memchr(const void *, int, size_t);

I have filed a bug against the Sun Workshop C++ Compiler 5.0.
Whiteboard: Sun Workshop compiler bug?
another related problem in mozilla/modules/libimg/pngcom/ipng.cpp

CC -library=iostream -o ipng.o -c   -DMOZILLA_CLIENT -DNECKO=1 -DBROKEN_QSORT=1
-DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DMOZ_DEFAULT_TOOLKIT=\"gtk\" -DSTDC_HEADERS=1
-DHAVE_ST_BLKSIZE=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1
-DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_SYS_BYTEORDER_H=1
-DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_FILIO_H=1 -DHAVE_SYS_IPC_H=1
-DHAVE_SYS_SHM_H=1 -DHAVE_X11_EXTENSIONS_XSHM_H=1 -DHAVE_SYS_STATVFS_H=1
-DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_SYS_MOUNT_H=1 -DHAVE_LIBM=1
-DHAVE_LIBDL=1 -DHAVE_LIBRESOLV=1 -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1
-DHAVE_LIBELF=1 -DHAVE_LIBINTL=1 -DHAVE_LIBPOSIX4=1 -DHAVE_LIBW=1 -D_REENTRANT=1
-DHAVE_RANDOM=1 -DHAVE_QSORT=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1
-DHAVE_SNPRINTF=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STATVFS=1 -DHAVE_MEMMOVE=1
-DHAVE_GETTIMEOFDAY=1 -DGETTIMEOFDAY_TWO_ARGS=1 -DHAVE_VALLOC=1
-DHAVE_IOS_BINARY=1 -DHAVE_OSTREAM=1 -DHAVE_CPP_EXPLICIT=1
-DHAVE_CPP_SPECIALIZATION=1 -DHAVE_CPP_USING=1 -DHAVE_CPP_NEW_CASTS=1
-DHAVE_I18N_LC_MESSAGES=1 -DMOZ_MAIL_NEWS=1 -DClientWallet=1
-DCookieManagement=1 -DSingleSignon=1 -DNDEBUG=1 -DTRIMMED=1
-DMOZ_USER_DIR=\".mozilla\" -DMOZ_DISABLE_DTD_DEBUG=1 -DMOZ_DLL_SUFFIX=\".so\"
-DXP_UNIX=1 -DUNIX_EMBED=1 -DX_PLUGINS=1 -DUNIX_LDAP=1 -DUNIX_ASYNC_DNS=1
-DJS_THREADSAFE=1 -DLAYERS=1  -mt -fast  -KPIC  -DOSTYPE=\"SunOS5\" -DOJI -I.
-I../../../dist/include -I../../../dist/include -I../../../dist/include
-I../../../include  -I../../../dist/public/jpeg -I../../../dist/public/png
-I../../../dist/public/zlib  -I/usr/openwin/include  ipng.cpp
"/usr/dist/pkgs/devpro,v5.0/5.x-sparc/SC5.0/include/CC/std/string.h", line 64:
Error: Only one of a set of overloaded functions can be extern "C".
"/usr/dist/pkgs/devpro,v5.0/5.x-sparc/SC5.0/include/CC/std/string.h", line 68:
Error: Only one of a set of overloaded functions can be extern "C".
"/usr/dist/pkgs/devpro,v5.0/5.x-sparc/SC5.0/include/CC/std/string.h", line 72:
Error: Only one of a set of overloaded functions can be extern "C".
"/usr/dist/pkgs/devpro,v5.0/5.x-sparc/SC5.0/include/CC/std/string.h", line 76:
Error: Only one of a set of overloaded functions can be extern "C".
"/usr/dist/pkgs/devpro,v5.0/5.x-sparc/SC5.0/include/CC/std/string.h", line 80:
Error: Only one of a set of overloaded functions can be extern "C".

This one can be fixed by not #including <string.h> in
mozilla/modules/libimg/png/pngconf.h (diffs follow)

Index: pngconf.h
===================================================================
RCS file: /cvsroot/mozilla/modules/libimg/png/pngconf.h,v
retrieving revision 3.7
diff -r3.7 pngconf.h
127c127
< #include <string.h>
---
> //#include <string.h>
The following patches to the Workshop 5.0 compiler claim to solve the problem

        107311-07 (SPARC V8)
        107312-07 (Intel)
        107390-07 (SPARC V9)

Will rebuild after applying these patches.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
The three patches specified fix the problem.
Blocks: 20203
I have also installed patch 107357-05.
The latest versions of these patches can be downloaded from
http://access1.sun.com
mcafee & akhil, can this bug be rubber-stamped as verified, or is there
additional work to do?
I would like to see someone else build it with these patches applied. Imagelib
will probably build (which is why I have marked the bug as resolved, fixed), but
a few other components (gfx, widget and webshell - all those that include
glib.h) may fail with a "duplicate definition of struct tm" error. Since I don't
remember exactly what I did to work around that particular error, someone else
should verify.
adding dmose, WS5.0 help
dmose was working on a WS5.0 build, I've surrendered our
WS5.0 machine to him for a while.  dmose?
I'll go get those compiler patches and try to verify.

So one thing I'm confused about is how you guys can run something built with WS5
but not using "-compat=4".  As far as I can tell, the xptcall support for the
WS5 native format vtables is not wired up.  Akhil?
The SUNW version of the solaris/sparc xptcall code in xptcall/src/md/unix
works with the 5.0 compilers without the compatibility flag.  Looks like
the makefiles should be changed to use SUNW if the 5.0 compilers are being
used, and GCC otherwise (which works with 4.2 more by accident than anything
else).
I don't remember changing any makefiles in xptcall. It just worked. I did
rebuild everything with the 5.0 compiler, including glib, gtk and libIDL.
Status: RESOLVED → REOPENED
Assignee: mcafee → dmose
Status: REOPENED → NEW
reopening, giving to dmose so we don't lose this.
If you still have a 5.0 tree around, try running dist/bin/TestXPTCInvoke
and let us know what the output is.  On our builds with an unmodified tree
crash shortly after proving 1+1=0.
My 5.0 build just finished - a 5.0 compile without the compat flag but with
the SUNW xptcall code works fine.
Resolution: FIXED → ---
Clearing FIXED resolution due to reopen.
My build failed at mozilla/gfx/src/gtk/nsImageGTK.cpp with the following error -

"/opt/SUNWspro/SC5.0/include/CC/std/time.h", line 29: Error: Multiple
declaration for std::tm.
"/opt/SUNWspro/SC5.0/include/CC/std/time.h", line 29: Error: Multiple
declaration for std::tm.

tor is right, without the -compat=4 and no SUNW xptcall code changes,
TestXPTCInvoke dumps core -

calling via invoke:
        1 + 1 = 0
Pure virtual function calledAbort (core dumped)
Status: NEW → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
I think we're tracking two different bugs here: one has to do with the imagelib
compilation problems, and one has to do with the xptcall/vtable stuff.  I've
opened a separate bug (20297) for the xptcall vtable stuff, and set this one
back to FIXED.  I will remain on the hook for verifying the imagelib bug.
Akhil, I assume the patch that you proposed has not been checked into the tree,
so that if it verifies, one of us needs to check it in also.  Correct?
The patch Akhil suggests is not needed by a properly patched SUNWspro 5.0
installation (as mentioned in the 11/23 comment).
ah, ok I missed that bit.  so assuming that i end up with a working build, I'll
then mark this verified.

i'll also be putting more info on building on solaris up on www.mozilla.org in
the not-too-distant future.
Thanks, Dan!
Status: RESOLVED → VERIFIED
Built and ran fine for me on Weds.
No longer blocks: 20203
You need to log in before you can comment on or make changes to this bug.