Closed
Bug 76846
Opened 23 years ago
Closed 23 years ago
Cast errors in XPCOM code on 64bit SPARC platform
Categories
(Core :: XPCOM, defect)
Tracking
()
People
(Reporter: roland.mainz, Assigned: kandrot)
References
Details
Attachments
(2 files)
2.87 KB,
patch
|
Details | Diff | Splinter Review | |
3.47 KB,
patch
|
Details | Diff | Splinter Review |
An attempt to build Mozilla as 64bit application on Solaris 7 SPARC from 2001-04-17 CVS snapshot using Sun Workshop 6 Update 2 EA2 fails like this: -- snip -- nsAFlatString.cpp Rebuilding deps for ../../../../../../../home/mozilla/src/2001-04-17-cvs/mozilla/string/src/nsAFlatString.cpp /opt/SUNWspro/bin/CC -xarch=v9 -o nsAFlatString.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP -DOJI -D_IMPL_NS_COM -D_IMPL_NS_BASE -I../../dist/include -I../../dist/include -I/shared/bigtmp/mozilla/2001-04-17-cvs/objdir_ws6_xlib_sparcv9/dist/include/nspr -I/usr/openwin/include -KPIC -I/usr/openwin/include -I/usr/include -I/usr/local/include -mt -O -DDEBUG -DDEBUG_mozilla -DTRACING -g -I/usr/openwin/include -DMOZILLA_CLIENT -DBROKEN_QSORT=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DMOZ_WIDGET_XLIB=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_DEFAULT_TOOLKIT=\"xlib\" -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_64BIT_OS=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_FILIO_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_SY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X=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DHAVE_MOVEMAIL=1 -DJS_THREADSAFE=1 ../../../../../../../home/mozilla/src/2001-04-17-cvs/mozilla/string/src/nsAFlatString.cpp "../../dist/include/nsPromiseConcatenation.h", line 68: Error: Cannot cast from const void*const to unsigned. "../../dist/include/nsPromiseConcatenation.h", line 74: Error: Cannot cast from const void* to unsigned. "../../dist/include/nsPromiseConcatenation.h", line 81: Error: Cannot cast from const void* to unsigned. "../../dist/include/nsPromiseConcatenation.h", line 145: Error: Cannot cast from const void*const to unsigned. "../../dist/include/nsPromiseConcatenation.h", line 151: Error: Cannot cast from const void* to unsigned. "../../dist/include/nsPromiseConcatenation.h", line 158: Error: Cannot cast from const void* to unsigned. 6 Error(s) detected. make[2]: *** [nsAFlatString.o] Error 6 make[2]: Leaving directory `/shared/bigtmp/mozilla/2001-04-17-cvs/objdir_ws6_xlib_sparcv9/string/src' make[1]: *** [install] Error 2 make[1]: Leaving directory `/shared/bigtmp/mozilla/2001-04-17-cvs/objdir_ws6_xlib_sparcv9/string' make: *** [install] Error 2 -- snip -- Note that "long long","long" and "void *" are 64bit datatypes for 64bit sparcv9 applications...
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Added dirty hack fix for this issue... at least it seems to compile... Setting milestone to 0.9.1 to match req. for bug 20860... scc... any comments ?
Target Milestone: --- → mozilla0.9.1
Reporter | ||
Comment 3•23 years ago
|
||
In fact we need an integer datatype which is able to hold all bits of a "void *" - and macros which are guranteed to allow a cast from/to this datatype. PRUptrdiff may be a good canidate, matching macros would look like this: #define PTR2INT(p) ((PRUptrdiff)((p)-0)) #define INT2PTR(p) ((void *)(((char *)0) + (p)))
Comment 4•23 years ago
|
||
re-targeting milestones, starting from a clean slate
Target Milestone: mozilla0.9.1 → ---
Reporter | ||
Comment 5•23 years ago
|
||
scc: This bug is _blocking_ bug 20860... wanna spend some time in code and help me to fix this stuff in a _clean_ way ? First item in the list is: -- snip -- gmake[1]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/js' gmake[1]: Entering directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/string' gmake[2]: Entering directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/string/public' gmake[2]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/string/public' gmake[2]: Entering directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/string/src' nsAFlatString.cpp Building deps for ../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/string/src/nsAFlatString.cpp /opt/SUNWspro/bin/CC -xarch=v9 -o nsAFlatString.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP -DOJI -D_IMPL_NS_COM -D_IMPL_NS_BASE -I../../dist/include -I../../dist/include -I/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/dist/include/nspr -I/usr/openwin/include -KPIC -I/usr/openwin/include -mt -DDEBUG -DDEBUG_mozilla -DTRACING -g -I/usr/openwin/include -DMOZILLA_CLIENT -DBROKEN_QSORT=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DMOZ_WIDGET_XLIB=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_DEFAULT_TOOLKIT=\"xlib\" -DMOZ_X11=1 -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_64BIT_OS=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_MEMORY_H=1 -D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1 -DUSE_IMG2=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DHAVE_MOVEMAIL=1 -DJS_THREADSAFE=1 ../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/string/src/nsAFlatString.cpp "../../dist/include/nsDependentConcatenation.h", line 68: Error: Cannot cast from const void*const to unsigned. "../../dist/include/nsDependentConcatenation.h", line 74: Error: Cannot cast from const void* to unsigned. "../../dist/include/nsDependentConcatenation.h", line 81: Error: Cannot cast from const void* to unsigned. "../../dist/include/nsDependentConcatenation.h", line 145: Error: Cannot cast from const void*const to unsigned. "../../dist/include/nsDependentConcatenation.h", line 151: Error: Cannot cast from const void* to unsigned. "../../dist/include/nsDependentConcatenation.h", line 158: Error: Cannot cast from const void* to unsigned. 6 Error(s) detected. gmake[2]: *** [nsAFlatString.o] Error 6 gmake[2]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/string/src' gmake[1]: *** [install] Error 2 gmake[1]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/string' gmake: *** [install] Error 2 -- snip --
Comment 6•23 years ago
|
||
I verified that the patch fixes the problem with string. However, the build then fails in xpcom/base. With scc's coaching, I verified that the local typedef fix works for the xpcom/base cases as well. I'm going to guess that there are probably a few hundred of these cases that need to resolved. Because of the magnitude of potential files to be changed, I'm going to suggest making a branch to handle making the tree 64bit sane (at the compile level anyways).
Reporter | ||
Comment 10•23 years ago
|
||
cls/scc: Patch works great - Thanks ! Next error: -- snip -- gmake[2]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/xpcom/typelib' gmake[2]: Entering directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/xpcom/base' nsLogging.cpp Building deps for ../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/xpcom/base/nsLogging.cpp /opt/SUNWspro/bin/CC -xarch=v9 -o nsLogging.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DMOZ_REFLOW_PERF -DMOZ_REFLOW_PERF_DSP -DOJI -D_IMPL_NS_COM -I../../dist/include -I../../dist/include -I/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/dist/include/nspr -I/usr/openwin/include -KPIC -I/usr/openwin/include -mt -DDEBUG -DDEBUG_mozilla -DTRACING -g -I/usr/openwin/include -DMOZILLA_CLIENT -DBROKEN_QSORT=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DMOZ_WIDGET_XLIB=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_DEFAULT_TOOLKIT=\"xlib\" -DMOZ_X11=1 -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_64BIT_OS=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_FILIO_H=1 -DHAVE_NL_TYPES_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_LIBSOCKET=1 -DHAVE_LIBPOSIX4=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_USLEEP=1 -DHAVE_RINT=1 -DHAVE_NL_LANGINFO=1 -DHAVE_GETTIMEOFDAY=1 -DGETTIMEOFDAY_TWO_ARGS=1 -DHAVE_DEV_ZERO=1 -DHAVE_IOS_BINARY=1 -DHAVE_OSTREAM=1 -DHAVE_CPP_EXPLICIT=1 -DHAVE_CPP_SPECIALIZATION=1 -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX=1 -DHAVE_CPP_PARTIAL_SPECIALIZATION=1 -DHAVE_CPP_ACCESS_CHANGING_USING=1 -DHAVE_CPP_AMBIGUITY_RESOLVING_USING=1 -DHAVE_CPP_NAMESPACE_STD=1 -DHAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL=1 -DHAVE_CPP_NEW_CASTS=1 -DHAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR=1 -DNEED_CPP_UNUSED_IMPLEMENTATIONS=1 -DHAVE_I18N_LC_MESSAGES=1 -DMOZ_LOGGING=1 -DMOZ_EDITOR_API_LOG=1 -DMOZ_ENDER_LITE=1 -DNS_MT_SUPPORTED=1 -DIBMBIDI=1 -DDETECT_WEBSHELL_LEAKS=1 -DMOZ_USER_DIR=\".mozilla\" -DMOZ_XUL=1 -DINCLUDE_XUL=1 -DMOZ_NEW_CACHE=1 -DUSE_IMG2=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DHAVE_MOVEMAIL=1 -DJS_THREADSAFE=1 ../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/xpcom/base/nsLogging.cpp "../../dist/include/nsHashtable.h", line 190: Error: Cannot cast from nsISupports*const to unsigned. "../../dist/include/nsHashtable.h", line 219: Error: Cannot cast from void*const to unsigned. "../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/xpcom/base/nsLogging.cpp", line 95: Error: Cannot cast from void* to unsigned. "../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/xpcom/base/nsLogging.cpp", line 424: Error: Cannot cast from void* to unsigned. "../../../../../../../home/mozilla/src/2001-06-29-08-trunk/mozilla/xpcom/base/nsLogging.cpp", line 693: Error: Cannot cast from PRThread* to int. 5 Error(s) detected. gmake[2]: *** [nsLogging.o] Error 5 gmake[2]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/xpcom/base' gmake[1]: *** [install] Error 2 gmake[1]: Leaving directory `/shared/bigtmp/mozilla/2001-06-29-08-trunk/objdir_ws6_gtk_sparcv9/xpcom' gmake: *** [install] Error 2 -- snip -- What are the steps to get such a 64bit branch ? I suggest to use Sun Workshop 6 Update 1 (better: Update 2) - a good&picky compiler which should catch all those issues... ...and how can we avoid that such changes get rotten ? Create Tinderbox for 64bit platform (hint: GTK+ toolkit does not work on 64bit SPARC - we would have to use --enable-toolkit=xlib) ?
Comment 11•23 years ago
|
||
I checked in the string part of this bug. I know you have other places in the code to fix, so I'm reassigning this bug to you for the rest of the fixes and/or to manage a branch on which to make those fixes.
Assignee: scc → Roland.Mainz
Comment 12•23 years ago
|
||
...and since you're out of the String code, changing the component to get it off my radar.
Component: String → XPCOM
Reporter | ||
Comment 13•23 years ago
|
||
First lets see what the default owner of the XPCOM stuff says...
Assignee: Roland.Mainz → kandrot
Reporter | ||
Updated•23 years ago
|
Summary: cast errors in string lib on 64bit SPARC platform → Cast errors in XPCOM code on 64bit SPARC platform
Comment 14•23 years ago
|
||
Ugh. Can we skip a) the bug morphing and b) having multiple bugs open for the same issue? Marking a dupe of 20860. *** This bug has been marked as a duplicate of 20860 ***
Reporter | ||
Comment 15•23 years ago
|
||
Oh... yes... /me dumb ... sorry... ;-(( Marking as VERIFIED.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•