Last Comment Bug 537784 - AIX port compilation error in js/src/jsstdint.h
: AIX port compilation error in js/src/jsstdint.h
Status: RESOLVED FIXED
: verified1.9.1, verified1.9.2
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: 1.9.1 Branch
: PowerPC AIX
: -- normal (vote)
: ---
Assigned To: Uli Link (:ul-mcamafia)
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-04 12:52 PST by Uli Link (:ul-mcamafia)
Modified: 2010-04-25 07:33 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
.2-fixed
.9-fixed


Attachments
including <sys/types.h> instead of redefinition (659 bytes, patch)
2010-01-04 13:00 PST, Uli Link (:ul-mcamafia)
no flags Details | Diff | Splinter Review
including <sys/types.h> on AIX ifdefined HAVE_INTTYPES_H (617 bytes, patch)
2010-01-26 10:56 PST, Uli Link (:ul-mcamafia)
no flags Details | Diff | Splinter Review
Recognize that <sys/types.h> has defined <stdint.h> types (as on AIX) (1.15 KB, patch)
2010-02-09 10:11 PST, Jim Blandy :jimb
no flags Details | Diff | Splinter Review
include <sys/types.h> if it defines int8_t, etc. 1.9.1 Branch only (2.03 KB, patch)
2010-02-09 11:08 PST, Uli Link (:ul-mcamafia)
jimb: review+
dveditz: approval1.9.1.9+
Details | Diff | Splinter Review
include <sys/types.h> if it defines int8_t, etc. for trunk (2.70 KB, patch)
2010-02-09 12:32 PST, Uli Link (:ul-mcamafia)
ted: review+
Details | Diff | Splinter Review
include <sys/types.h> if it defines int8_t, etc. for 1.9.2 branch. (2.70 KB, patch)
2010-02-09 12:54 PST, Uli Link (:ul-mcamafia)
ted: review+
dveditz: approval1.9.2.2+
Details | Diff | Splinter Review

Description Uli Link (:ul-mcamafia) 2010-01-04 12:52:21 PST
User-Agent:       Mozilla/5.0 (X11; U; AIX 5.1; en-US; rv:1.9.1.7) Gecko/20100101 Firefox/3.5.7
Build Identifier: Firefox 3.5, Seamonkey 2.0, Thunderbird 3.0

Comilation of js/src/jsapi.cpp fails due to conflicting types.
AIX has no <stdint.h> and uses <sys/types.h> which includes <sys/inttypes.h> instead.

Building deps for /home/ulink/Src/comm-1.9.1/mozilla/js/src/jsapi.cpp
xlC_r -o jsapi.o -c  -DOSTYPE=\"AIX5.1\" -DOSARCH=AIX -DEXPORT_JS_API  -DJS_USE_SAFE_ARENA  -I/home/ulink/Src/comm-1.9.1/mozilla/js/src -I.  -I./../../dist/include   -I./../../dist/include/js -I/home/ulink/Src/comm-1.9.1/SM2_OBJ32/mozilla/dist/include/nspr -I/sdk/include -I/home/ulink/Src/comm-1.9.1/mozilla/js/src   -qflag=w:w      -DNDEBUG -DTRIMMED -O2 -qarch=ppc -qmaxmem=-1 -qalias=noansi   -DAIX=1 -DHAVE_SYS_INTTYPES_H=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DJS_INT8_TYPE=char -DJS_INT16_TYPE=short -DJS_INT32_TYPE=int -DJS_INT64_TYPE=long\ long -DJS_INTPTR_TYPE=int -DJS_BYTES_PER_WORD=4 -DJS_BITS_PER_WORD_LOG2=5 -DJS_ALIGN_OF_POINTER=4 -DJS_BYTES_PER_DOUBLE=8 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_INT64=1 -DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_CPP_2BYTE_WCHAR_T=1 -DHAVE_DIRENT_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_VFS_H=1 -DNEW_H=\<new\> -DHAVE_LIBC_R=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_LIBC_R=1 -D_REENTRANT=1 -DHAVE_RANDOM=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1 -DHAVE_SNPRINTF=1 -DHAVE_STATVFS=1 -DHAVE_MEMMOVE=1 -DHAVE_RINT=1 -DHAVE_STAT64=1 -DHAVE_LSTAT64=1 -DHAVE_TRUNCATE64=1 -DHAVE_FLOCKFILE=1 -DHAVE_GETPAGESIZE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STRTOK_R=1 -DHAVE_WCRTOMB=1 -DHAVE_MBRTOWC=1 -DHAVE_RES_NINIT=1 -DHAVE_ICONV=1 -DHAVE_ICONV_WITH_CONST_INPUT=1 -DHAVE_CPP_EXPLICIT=1 -DHAVE_CPP_TYPENAME=1 -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX=1 -DHAVE_CPP_PARTIAL_SPECIALIZATION=1 -DHAVE_CPP_AMBIGUITY_RESOLVING_USING=1 -DHAVE_CPP_NAMESPACE_STD=1 -DHAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL=1 -DHAVE_CPP_NEW_CASTS=1 -DNEED_CPP_UNUSED_IMPLEMENTATIONS=1 -DHAVE_I18N_LC_MESSAGES=1 -DCPP_THROW_NEW=throw\(\) -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1  -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT /home/ulink/Src/comm-1.9.1/mozilla/js/src/jsapi.cpp
"/home/ulink/Src/comm-1.9.1/mozilla/js/src/jsstdint.h", line 60.33: 1540-0400 (S) "intptr_t" has a conflicting declaration.
"/usr/include/sys/inttypes.h", line 104.33: 1540-0425 (I) "intptr_t" is defined on line 104 of "/usr/include/sys/inttypes.h".
"/home/ulink/Src/comm-1.9.1/mozilla/js/src/jsstdint.h", line 66.33: 1540-0400 (S) "uintptr_t" has a conflicting declaration.
"/usr/include/sys/inttypes.h", line 105.33: 1540-0425 (I) "uintptr_t" is defined on line 105 of "/usr/include/sys/inttypes.h".
gmake[4]: *** [jsapi.o] Error 1
gmake[4]: Leaving directory `/home/ulink/Src/comm-1.9.1/SM2_OBJ32/mozilla/js/src'
gmake[3]: *** [libs_tier_js] Error 2



Reproducible: Always

Steps to Reproduce:
1. Compile on AIX with any version of IBM compiler

Actual Results:  
Compilation error

Expected Results:  
Successful compilation
Comment 1 Uli Link (:ul-mcamafia) 2010-01-04 13:00:50 PST
Created attachment 419961 [details] [diff] [review]
including <sys/types.h> instead of redefinition

Configure sets HAVE_SYS_INTTYPES_H on AIX.
then include <sys/types.h> as <sys/inttypes.h> should not be included directly. The visibility is triggerd depending on language level compiler internal macros.
Comment 2 Brendan Eich [:brendan] 2010-01-04 13:35:04 PST
Comment on attachment 419961 [details] [diff] [review]
including <sys/types.h> instead of redefinition

Please use Jim Blandy for reviews of this file -- in general use hg log to see who seems to be maintaining it.

/be
Comment 3 Uli Link (:ul-mcamafia) 2010-01-05 07:39:29 PST
Comment on attachment 419961 [details] [diff] [review]
including <sys/types.h> instead of redefinition

This patch is for 1.9.1 only. For 1.9.2 similar hack, different patch is needed. Will provide soon for review.
Comment 4 Uli Link (:ul-mcamafia) 2010-01-06 11:07:45 PST
Here is the error when compiling Firefox 3.6rc1 source:

xlC_r -o jsapi.o -c  -DOSTYPE=\"AIX5.1\" -DOSARCH=AIX -DEXPORT_JS_API  -DJS_USE_SAFE_ARENA  -I/home/ulink/src/fx36/mozilla-1.9.2/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub  -I/home/ulink/src/fx36/mozilla-1.9.2/FX36_OBJ/dist/include/nspr   -I/home/ulink/src/fx36/mozilla-1.9.2/js/src   -qflag=w:w      -DNDEBUG -DTRIMMED -O2 -qarch=com -qmaxmem=-1 -qalias=noansi   -DAIX=1 -DHAVE_SYS_INTTYPES_H=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DJS_INT8_TYPE=char -DJS_INT16_TYPE=short -DJS_INT32_TYPE=int -DJS_INT64_TYPE=long\ long -DJS_INTPTR_TYPE=int -DJS_BYTES_PER_WORD=4 -DJS_BITS_PER_WORD_LOG2=5 -DJS_ALIGN_OF_POINTER=4 -DJS_BYTES_PER_DOUBLE=8 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_INT64=1 -DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_DIRENT_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_SYS_VFS_H=1 -DNEW_H=\<new\> -DHAVE_LIBC_R=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_LIBC_R=1 -D_REENTRANT=1 -DHAVE_FCHMOD=1 -DHAVE_FLOCKFILE=1 -DHAVE_GETC_UNLOCKED=1 -DHAVE_GETPAGESIZE=1 -DHAVE_LCHOWN=1 -DHAVE_LOCALTIME_R=1 -DHAVE_LSTAT64=1 -DHAVE_MEMMOVE=1 -DHAVE_RANDOM=1 -DHAVE_RINT=1 -DHAVE_SBRK=1 -DHAVE_SNPRINTF=1 -DHAVE_STAT64=1 -DHAVE_STATVFS=1 -DHAVE_STRERROR=1 -DHAVE_STRTOK_R=1 -DHAVE_TRUNCATE64=1 -DHAVE_WCRTOMB=1 -DHAVE_MBRTOWC=1 -DHAVE_RES_NINIT=1 -DHAVE_ICONV=1 -DHAVE_ICONV_WITH_CONST_INPUT=1 -DHAVE_CPP_EXPLICIT=1 -DHAVE_CPP_TYPENAME=1 -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX=1 -DHAVE_CPP_PARTIAL_SPECIALIZATION=1 -DHAVE_CPP_AMBIGUITY_RESOLVING_USING=1 -DHAVE_CPP_NAMESPACE_STD=1 -DHAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL=1 -DHAVE_CPP_NEW_CASTS=1 -DNEED_CPP_UNUSED_IMPLEMENTATIONS=1 -DHAVE_I18N_LC_MESSAGES=1 -DCPP_THROW_NEW=throw\(\) -DEDITLINE=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1 -DHAVE_SETLOCALE=1  -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT /home/ulink/src/fx36/mozilla-1.9.2/js/src/jsapi.cpp
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsstdint.h", line 78.19: 1540-0400 (S) "intptr_t" has a conflicting declaration.
"/usr/include/sys/inttypes.h", line 104.33: 1540-0425 (I) "intptr_t" is defined on line 104 of "/usr/include/sys/inttypes.h".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsstdint.h", line 79.19: 1540-0400 (S) "uintptr_t" has a conflicting declaration.
"/usr/include/sys/inttypes.h", line 105.33: 1540-0425 (I) "uintptr_t" is defined on line 105 of "/usr/include/sys/inttypes.h".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 183.16: 1540-0198 (W) The omitted keyword "private" is assumed for base class "AllocPolicy".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 219.22: 1540-1109 (S) The use of undefined class "js::Vector<unsigned short,32,js::ContextAllocPolicy>::BufferPtrs" is not valid.
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 218.25: 1540-0700 (I) The previous message was produced while processing "js::Vector<unsigned short,32,class js::ContextAllocPolicy>::sInlineCapacity".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 183.7: 1540-0700 (I) The previous message was produced while processing "class js::Vector<unsigned short,32,js::ContextAllocPolicy>".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsscan.h", line 245.8: 1540-0700 (I) The previous message was produced while processing "struct JSTokenStream".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 224.36: 1540-1269 (S) The template argument for the non-type template parameter of type "unsigned long" must be an integral constant expression.
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 223.25: 1540-0700 (I) The previous message was produced while processing "js::Vector<unsigned short,32,class js::ContextAllocPolicy>::sInlineBytes".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 183.7: 1540-0700 (I) The previous message was produced while processing "class js::Vector<unsigned short,32,js::ContextAllocPolicy>".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsscan.h", line 245.8: 1540-0700 (I) The previous message was produced while processing "struct JSTokenStream".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 183.16: 1540-0198 (W) The omitted keyword "private" is assumed for base class "AllocPolicy".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsscan.h", line 264.25: 1540-0700 (I) The previous message was produced while processing "class js::Vector<unsigned short,32,js::ContextAllocPolicy>".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsscan.h", line 245.8: 1540-0700 (I) The previous message was produced while processing "struct JSTokenStream".
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsvector.h", line 224.36: 1540-1269 (S) The template argument for the non-type template parameter of type "unsigned long" must be an integral constant expression.
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jscntxt.h", line 1530.44: 1540-1281 (W) "offsetof" cannot be applied to "struct JSContext".  It is not a POD (plain old data) type.
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jstl.h", line 198.78: 1540-0040 (S) The text "_" is unexpected.  "tl::StaticAssert<0>::result" may be undeclared or ambiguous.
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsnum.h", line 126.23: 1540-0274 (S) The name lookup for "signbit" did not find a declaration.
"/home/ulink/src/fx36/mozilla-1.9.2/js/src/jsnum.h", line 150.12: 1540-0274 (S) The name lookup for "signbit" did not find a declaration.
gmake[3]: *** [jsapi.o] Error 1
gmake[3]: Leaving directory `/home/ulink/src/fx36/mozilla-1.9.2/FX36_OBJ/js/src'
gmake[2]: *** [libs_tier_js] Error 2
gmake[2]: Leaving directory `/home/ulink/src/fx36/mozilla-1.9.2/FX36_OBJ'
gmake[1]: *** [tier_js] Error 2
gmake[1]: Leaving directory `/home/ulink/src/fx36/mozilla-1.9.2/FX36_OBJ'
gmake: *** [default] Error 2
Comment 5 Uli Link (:ul-mcamafia) 2010-01-17 05:06:17 PST
porting the the Javascript engine of Mozilla 1.9.2 to AIX isn't a single patch. So this bug is considered Mozilla 1.9.1 branch only.
Comment 6 Uli Link (:ul-mcamafia) 2010-01-26 10:56:35 PST
Created attachment 423568 [details] [diff] [review]
including <sys/types.h> on AIX ifdefined HAVE_INTTYPES_H

Recreated patch with hg and ifdef  for both _AIX and HAVE_INTTYPES_H
Comment 7 Jim Blandy :jimb 2010-02-09 10:11:16 PST
Created attachment 426013 [details] [diff] [review]
Recognize that <sys/types.h> has defined <stdint.h> types (as on AIX)

Could you give this a try on the current sources?  If it works, then let's backport something like this to 1.9.1.
Comment 8 Uli Link (:ul-mcamafia) 2010-02-09 11:08:30 PST
Created attachment 426028 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc.
1.9.1 Branch only
Comment 9 Jim Blandy :jimb 2010-02-09 11:42:12 PST
Comment on attachment 426028 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc.
1.9.1 Branch only

Looks good.
Comment 10 Mike Shaver (:shaver -- probably not reading bugmail closely) 2010-02-09 11:57:11 PST
Comment on attachment 426028 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc.
1.9.1 Branch only

js doesn't require sr (and I'm a bad person to ask anyway) -- this is ready to land!
Comment 11 Jim Blandy :jimb 2010-02-09 12:03:40 PST
Comment on attachment 426013 [details] [diff] [review]
Recognize that <sys/types.h> has defined <stdint.h> types (as on AIX)

Hi, Ted. We've got two versions of this patch: I wrote this one for trunk, and Uli adapted it for 1.9.1, which is what we really need.

I've r+'d Uli's adaptation; could you look at my original?
Comment 12 Uli Link (:ul-mcamafia) 2010-02-09 12:32:20 PST
Created attachment 426046 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc. for trunk

This is jim's patch + one additional hunk needed in jsstdint.h
for trunk
Comment 13 Uli Link (:ul-mcamafia) 2010-02-09 12:54:43 PST
Created attachment 426052 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc. for 1.9.2 branch.
Comment 14 Uli Link (:ul-mcamafia) 2010-02-09 12:56:01 PST
Comment on attachment 426052 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc. for 1.9.2 branch.

same as trunk patch, only offset for js/src/configure.in hunk adjusted
Comment 15 Jim Blandy :jimb 2010-02-09 13:44:44 PST
They all look good to me.
Comment 16 Ted Mielczarek [:ted.mielczarek] 2010-02-10 12:10:52 PST
Comment on attachment 426046 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc. for trunk

It might be nice to combine those two defines into one thing to check for, something like
#if defined(JS_HAVE_STDINT_H) || defined(JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES)
#define JS_HAVE_STDINT_TYPES
#endif

but that's not critical.
Comment 17 Ted Mielczarek [:ted.mielczarek] 2010-02-10 12:12:04 PST
Comment on attachment 426052 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc. for 1.9.2 branch.

This is the exact same patch just with context adjusted, right?

You'll need separate approval to land on 1.9.2.
Comment 18 Uli Link (:ul-mcamafia) 2010-02-10 14:38:05 PST
(In reply to comment #17)
> (From update of attachment 426052 [details] [diff] [review])
> This is the exact same patch just with context adjusted, right?

Yes.
Comment 19 Daniel Veditz [:dveditz] 2010-02-22 10:40:13 PST
Comment on attachment 426028 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc.
1.9.1 Branch only

Approved for 1.9.1.9, a=dveditz for release-drivers
Comment 20 Daniel Veditz [:dveditz] 2010-02-22 10:40:32 PST
Comment on attachment 426052 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc. for 1.9.2 branch.

Approved for 1.9.2.2, a=dveditz for release-drivers
Comment 21 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2010-03-06 10:08:46 PST
Checked in on trunk http://hg.mozilla.org/mozilla-central/rev/bae59e32bd06
Comment 22 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2010-03-06 13:24:28 PST
This still needs to be landed on 1.9.2 and 1.9.1

Note You need to log in before you can comment on or make changes to this bug.