Closed Bug 491866 Opened 11 years ago Closed 11 years ago

AvmCore.cpp fails to compile on Solaris with a "Badly formed constant expression"

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

Sun
Solaris
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: brbaker, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

Unable to compile the avmshell on solaris. 

"tamarin-redux/core/AvmCore.cpp", line 3583: Error: Badly formed constant expression.

This change was possibly introduced in changeset 1840:2ec02b439233

changeset:   1840:2ec02b439233
user:        Steven Johnson <stejohns@adobe.com>
date:        Tue May 05 12:54:03 2009 -0700
files:       core/AvmCore.cpp
description:
rename identifiers named id to avoid Obj-C conflicts (r=edwsmith)
Flags: flashplayer-qrb?
Component: Tracing Virtual Machine → Virtual Machine
QA Contact: tracing-vm → vm
If I revert back to changeset 1839 then different compilation errors happens:

...
...
"/usr/include/iso/stdlib_iso.h", line 51: Error: Multiple declaration for div_t.
"/usr/include/iso/stdlib_iso.h", line 56: Error: Multiple declaration for ldiv_t.
"/usr/include/iso/stdlib_c99.h", line 38: Error: Multiple declaration for lldiv_
t.
"/usr/include/math.h", line 83: Error: Multiple declaration for version.
"/usr/include/math.h", line 83: Error: Multiple declaration for libm_ieee.
"/usr/include/math.h", line 83: Error: Multiple declaration for c_issue_4.
"/usr/include/math.h", line 83: Error: Multiple declaration for ansi_1.
"/usr/include/math.h", line 83: Error: Multiple declaration for strict_ansi.
"/usr/include/inttypes.h", line 63: Error: Multiple declaration for imaxdiv_t.
"/usr/include/sys/types.h", line 176: Error: Multiple declaration for B_FALSE.
"/usr/include/sys/types.h", line 176: Error: Multiple declaration for B_TRUE.
"/usr/include/sys/types.h", line 176: Error: Multiple declaration for boolean_t.
"/usr/include/sys/types.h", line 209: Error: Multiple declaration for pad128_t.
"/usr/include/sys/types.h", line 214: Error: Multiple declaration for upad128_t.
"/usr/include/sys/types.h", line 246: Error: Multiple declaration for lloff_t.
"/usr/include/sys/types.h", line 266: Error: Multiple declaration for lldaddr_t.
"/usr/include/sys/types.h", line 432: Error: Multiple declaration for pthread_barrier_t.
"/usr/include/sys/types.h", line 478: Error: Multiple declaration for pthread_ba
rrierattr_t.
"/usr/include/sys/select.h", line 46: Error: Multiple declaration for sigset_t.
"/home/build/buildbot/tamarin-redux/solaris-sparc/tamarin-redux/core/AtomConstants.h", line 89: Error: Multiple declaration for kUnusedAtomTag.
"/home/build/buildbot/tamarin-redux/solaris-sparc/tamarin-redux/core/AtomConstants.h", line 90: Error: Multiple declaration for kObjectType.
"/home/build/buildbot/tamarin-redux/solaris-sparc/tamarin-redux/core/AtomConstants.h", line 91: Error: Multiple declaration for kStringType.
"/home/build/buildbot/tamarin-redux/solaris-sparc/tamarin-redux/core/AtomConstants.h", line 92: Error: Multiple declaration for kNamespaceType.
"/home/build/buildbot/tamarin-redux/solaris-sparc/tamarin-redux/core/AtomConstants.h", line 93: Error: Multiple declaration for kSpecialType.
"/home/build/buildbot/tamarin-redux/solaris-sparc/tamarin-redux/core/AtomConstants.h", line 94: Error: Multiple declaration for kBooleanType.
Compilation aborted, too many Error messages.
make: *** [eval/eval-abc.o] Error 1
make: *** Waiting for unfinished jobs....
build failed return value 2
avmshell is missing, build failed
Attached patch Patch (obsolete) — Splinter Review
Attachment #376296 - Flags: review?(brbaker)
Comment on attachment 376296 [details] [diff] [review]
Patch

This patch does fix the issue in AvmCore.cpp

We are still unable to compile as we now hit the error in comment #1
Attachment #376296 - Flags: review?(brbaker) → review+
(In reply to comment #3)
> 
> We are still unable to compile as we now hit the error in comment #1

I've played around with this for a bit and I don't know what causes it, but I do know a thing or two.

Not every .cpp file in the eval/ directory causes this.

If I #ifdef out the body of the RTC namespace in eval-abc.cpp (which is the first file to cause it) but leaves the namespace avmplus { namespace RTC { } } structure and the includes intact, then the file compiles just fine.

Ergo, though it looks like a header file problem from the error messages, I think that's just a symptom of the problem, not the underlying cause.

There are warnings for trailing commas in enums, but these are not the cause.

If I #ifdef out everything starting with ABCFile::addNamespace it compiles; if I then #ifdef in addNsset it still compiles, but compiling also multinameLookup makes it fail again.

This is messy and chaotic enough for me to suspect compiler bugs.  A temporary relief would be to disable 'eval' in avmshell-features.h.
Attached patch [v2] patchSplinter Review
This patch includes Steven's previous patch plus

+ disable AVMFEATURE_EVAL on solaris
+ provide a dummy return for "static void* slaveThread()", which will never return, to make solaris compiler happy

This gets the shells compiling on solaris... yeah, but shells core dump when trying to run an abc boooo
Attachment #376296 - Attachment is obsolete: true
Attachment #376432 - Flags: review?(lhansen)
Attachment #376432 - Flags: review?(lhansen) → review+
patch pushed as 1861:126cde9a360c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
removing QRB request, bug resolved/verified
Flags: flashplayer-qrb?
You need to log in before you can comment on or make changes to this bug.