Closed Bug 537784 Opened 15 years ago Closed 15 years ago

AIX port compilation error in js/src/jsstdint.h

Categories

(Core :: JavaScript Engine, defect)

1.9.1 Branch
PowerPC
AIX
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- .2-fixed
status1.9.1 --- .9-fixed

People

(Reporter: ul-mcamafia, Assigned: ul-mcamafia)

Details

(Keywords: verified1.9.1, verified1.9.2)

Attachments

(4 files, 2 obsolete files)

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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FIX=\".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
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.
Version: unspecified → 1.9.1 Branch
Attachment #419961 - Flags: review?(brendan)
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
Attachment #419961 - Flags: review?(brendan) → review?(jim)
Assignee: general → ul.mcamafia
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
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.
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
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.
Recreated patch with hg and ifdef  for both _AIX and HAVE_INTTYPES_H
Attachment #419961 - Attachment is obsolete: true
Attachment #423568 - Flags: review?
Attachment #419961 - Flags: review?(jim)
Attachment #423568 - Flags: review? → review?(jim)
Could you give this a try on the current sources?  If it works, then let's backport something like this to 1.9.1.
Attachment #423568 - Attachment is obsolete: true
Attachment #423568 - Flags: review?(jim)
Attachment #426028 - Flags: review?(jim)
Comment on attachment 426028 [details] [diff] [review]
include <sys/types.h> if it defines int8_t, etc.
1.9.1 Branch only

Looks good.
Attachment #426028 - Flags: review?(jim) → review+
Attachment #426028 - Flags: superreview?(shaver)
Attachment #426028 - Flags: superreview?(shaver)
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 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?
Attachment #426013 - Flags: review?(ted.mielczarek)
Attachment #426028 - Attachment description: include <sys/types.h> if it defines int8_t, etc. → include <sys/types.h> if it defines int8_t, etc. 1.9.1 Branch only
This is jim's patch + one additional hunk needed in jsstdint.h
for trunk
Attachment #426046 - Flags: review?(ted.mielczarek)
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
Attachment #426052 - Attachment description: Same patch as for trunk with adjusted offset → include <sys/types.h> if it defines int8_t, etc. for 1.9.2 branch.
Attachment #426052 - Flags: review?(ted.mielczarek)
They all look good to me.
Attachment #426013 - Flags: review?(ted.mielczarek)
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.
Attachment #426046 - Flags: review?(ted.mielczarek) → review+
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.
Attachment #426052 - Flags: review?(ted.mielczarek)
Attachment #426052 - Flags: review+
Attachment #426052 - Flags: approval1.9.2.2?
Attachment #426028 - Flags: approval1.9.1.9?
(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.
Keywords: checkin-needed
Whiteboard: [attachment 426046 on trunk]
Attachment #426028 - Flags: approval1.9.1.9? → approval1.9.1.9+
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 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
Attachment #426052 - Flags: approval1.9.2.2? → approval1.9.2.2+
Whiteboard: [attachment 426046 on trunk] → [attachment 426046 on trunk],[attachment 426052 branch 1.9.2],[attachment 426028 branch 1.9.1]
Checked in on trunk http://hg.mozilla.org/mozilla-central/rev/bae59e32bd06
Whiteboard: [attachment 426046 on trunk],[attachment 426052 branch 1.9.2],[attachment 426028 branch 1.9.1] → [attachment 426052 branch 1.9.2],[attachment 426028 branch 1.9.1]
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
This still needs to be landed on 1.9.2 and 1.9.1
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: