Closed Bug 624080 Opened 14 years ago Closed 14 years ago

"non-relocatable subtraction expression" trying to compile jsclone.cpp on mac os x 10.5

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
blocker

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- final+

People

(Reporter: jruderman, Assigned: luke)

References

Details

(Keywords: regression, Whiteboard: [hardblocker][fixed-in-tracemonkey])

Attachments

(2 files, 2 obsolete files)

{standard input}:1528:non-relocatable subtraction expression, "LC2" minus "L00000000010$pb"
{standard input}:1528:symbol: "L00000000010$pb" can't be undefined in a subtraction expression
{standard input}:unknown:Undefined local symbol L00000000010$pb

In the directory  /Users/jruderman/mozilla-central/opt-obj/js/src
The following command failed to execute properly:
g++-4.2 -o jsclone.o -c -fvisibility=hidden -DOSTYPE="Darwin9.8.0" -DOSARCH=Darwin -DEXPORT_JS_API -D__STDC_LIMIT_MACROS -DJS_HAS_CTYPES -DDLL_PREFIX="lib" -DDLL_SUFFIX=".dylib" -Ictypes/libffi/include -I. -I/Users/jruderman/mozilla-central/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub -I/Users/jruderman/mozilla-central/opt-obj/dist/include/nspr -I/Users/jruderman/mozilla-central/js/src -I/Users/jruderman/mozilla-central/js/src/assembler -I/Users/jruderman/mozilla-central/js/src/yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -fno-strict-aliasing -fpascal-strings -fno-common -pthread -pipe -DNDEBUG -DTRIMMED -O3 -fstrict-aliasing -fomit-frame-pointer -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsclone.pp /Users/jruderman/mozilla-central/js/src/jsclone.cpp
make[4]: *** [jsclone.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [libs_tier_js] Error 2
make[2]: *** [tier_js] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2
Attached file my mozconfig
This only affects my opt build. My debug build is fine.
$ g++-4.2 --version
i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5574)
Doubt we want to ship saying that the only way you can build opt for 10.5 is to cross-complile from 10.6.
blocking2.0: --- → ?
Keywords: regression
Hmm, maybe I am doing it wrong, but I compile no problem with a clean build of cset 43fcf9a72eb3 using the attached mozconfig with g++ 4.2 on a Mac Pro:
      System Version: Mac OS X 10.5.8 (9L31a)
      Kernel Version: Darwin 9.8.0
I have:
  System Version:	Mac OS X 10.5.8 (9L30)
  Kernel Version:	Darwin 9.8.0

Luke, what do you get for "g++-4.2 --version"?
Maybe not the best interim workaround, but since I needed to be able to build, I switched JS_CANONICALIZE_NAN to be JS_NEVER_INLINE - at least that'll be easier to rebase than keeping a backout of bug 616454 in my queue.
Thanks for the workaround, philor :)
(In reply to comment #7)
> Luke, what do you get for "g++-4.2 --version"?

i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5566)

Phil: is there still an error if you put back JS_ALWAYS_INLINE and instead remove the JS_UNLIKELY inside JS_CANONICALIZE_NAN?
Yep, "if (d != d) {" still has the same error.

Not sure if this is meaningful, or trivially obvious, but removing either one of the uses of JS_CANONICAL_NAN in jsclone.cpp does make the error go away, so apparently whatever is causing our build 5574's (since I have the same build as Jesse) to fail is in the way it inlines it the second time.
blocking2.0: ? → final+
Whiteboard: hardblocker
Hmm, its hard to see this as anything but a compiler bug.  This patch removes one of the JS_CANONICALIZE_NANs (which, because of the related invariant, is unnecessary).  Phil, based on your observations, this patch should fix the link error, yes?
Assignee: general → lw
Status: NEW → ASSIGNED
Attachment #502572 - Flags: review?(jorendorff)
Both should, and does, thanks!

(Googling "non-relocatable subtraction expression" finds a lot of people over the years saying that they should file a bug on Apple, but as usual not a lot saying what the result of filing was, and now it's too late, since they aren't going to update Xcode for 10.5 at this point.)
Comment on attachment 502572 [details] [diff] [review]
don't need that second JS_CANONICALIZE_NAN

I think WriteStructuredClone should always write a NaN as the bytes
00 00 00 00 00 00 f8 7f, and ReadStructuredClone should not accept any other byte-sequence as a NaN.

Both must be independent of jsval representation issues.
Attachment #502572 - Flags: review?(jorendorff)
Attached patch fix 2 (obsolete) — Splinter Review
Fixes build on Jesse's laptop.
Attachment #502572 - Attachment is obsolete: true
Attachment #502692 - Flags: review?(jorendorff)
Attached patch hg qref'dSplinter Review
Attachment #502692 - Attachment is obsolete: true
Attachment #502700 - Flags: review?(jorendorff)
Attachment #502692 - Flags: review?(jorendorff)
Attachment #502700 - Flags: review?(jorendorff) → review+
http://hg.mozilla.org/tracemonkey/rev/140bc539ca67
Whiteboard: hardblocker → [hardblocker][fixed-in-tracemonkey]
http://hg.mozilla.org/mozilla-central/rev/140bc539ca67
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: