Closed Bug 486584 Opened 16 years ago Closed 16 years ago

tracemonkey uses Solaris-only code on SPARC

Categories

(Core :: JavaScript Engine, defect)

Sun
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 502369

People

(Reporter: armin76, Assigned: leon.sha)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file build.log
Hi guys, due to the commit of bug 476042, the build on Linux/sparc fails due to undefined reference to `sync_instruction_memory', which as far as I know, its a Solaris-only libc function. The relevant part is: g++ -o jsbuiltins.o -c -fvisibility=hidden -DAVMPLUS_SPARC -DAVMPLUS_UNIX -DAVMPLUS_LINUX -DFEATURE_NANOJIT -DJS_TRACER -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -DEXPORT_JS_API -DJS_USE_SAFE_ARENA -I. -I. -I./../../dist/include -I./../../dist/include/js -I/usr/include/nspr -I/sdk/include -I. -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-invalid-offsetof -Wno-long-long -pedantic -g -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -fstrict-aliasing -DMOZILLA_CLIENT -include ./mozilla-config.h -Wp,-MD,.deps/jsbuiltins.pp jsbuiltins.cpp In file included from jsbuiltins.h:45, from jsbuiltins.cpp:58: nanojit/nanojit.h:141:30: warning: anonymous variadic macros were introduced in C99 nanojit/nanojit.h:188:23: warning: anonymous variadic macros were introduced in C99 In file included from nanojit/nanojit.h:235, from jsbuiltins.h:45, from jsbuiltins.cpp:58: nanojit/Native.h:120:22: warning: anonymous variadic macros were introduced in C99 rm -f libmozjs.so g++ -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-invalid-offsetof -Wno-long-long -pedantic -g -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -fstrict-aliasing -fPIC -shared -Wl,-z,defs -Wl,-h,libmozjs.so -o libmozjs.so jsapi.o jsarena.o jsarray.o jsatom.o jsbool.o jscntxt.o jsdate.o jsdbgapi.o jsdhash.o jsdtoa.o jsemit.o jsexn.o jsfun.o jsgc.o jshash.o jsinterp.o jsinvoke.o jsiter.o jslock.o jslog2.o jsmath.o jsnum.o jsobj.o json.o jsopcode.o jsparse.o jsprf.o jsregexp.o jsscan.o jsscope.o jsscript.o jsstr.o jsutil.o jsxdrapi.o jsxml.o prmjtime.o jstracer.o Assembler.o Fragmento.o LIR.o RegAlloc.o avmplus.o NativeSparc.o jsbuiltins.o -lpthread -Wl,-Bsymbolic-functions -Wl,-rpath-link,/bin -Wl,-rpath-link,/lib -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm -lm -ldl Assembler.o: In function `nanojit::Assembler::endAssembly(nanojit::Fragment*, avmplus::List<unsigned int*, (avmplus::ListElementType)0>&)': /build/buildd/xulrunner-1.9.1-1.9.1~b4~hg20090330r24021+nobinonly/build-tree/mozilla/js/src/./nanojit/Assembler.cpp:963: undefined reference to `sync_instruction_memory' collect2: ld returned 1 exit status make[4]: *** [libmozjs.so] Error 1 make[4]: Leaving directory `/build/buildd/xulrunner-1.9.1-1.9.1~b4~hg20090330r24021+nobinonly/build-tree/mozilla/js/src' make[3]: *** [libs_tier_js] Error 2 make[3]: Leaving directory `/build/buildd/xulrunner-1.9.1-1.9.1~b4~hg20090330r24021+nobinonly/build-tree/mozilla' make[2]: *** [tier_js] Error 2 make[2]: Leaving directory `/build/buildd/xulrunner-1.9.1-1.9.1~b4~hg20090330r24021+nobinonly/build-tree/mozilla' make[1]: *** [default] Error 2 make[1]: Leaving directory `/build/buildd/xulrunner-1.9.1-1.9.1~b4~hg20090330r24021+nobinonly/build-tree/mozilla' make: *** [debian/stamp-makefile-build] Error 2 Thanks
Mono has something to deal with that on non solaris in mono/mono/mini/mini-sparc.c:mono_arch_flush_icache().
FTR, that's what mono does (for an equivalent to sync_instruction_memory (code, size);): guint64 *p = (guint64*)code; guint64 *end = (guint64*)(code + ((size + 8) /8)); /* * FIXME: Flushing code in dword chunks in _slow_. */ while (p < end) #ifdef __GNUC__ __asm__ __volatile__ ("iflush %0"::"r"(p++)); #else flushi (p ++); #endif
@sun.com guys: please fix the mess you did.
Attached patch patch (obsolete) — Splinter Review
Assignee: general → leon.sha
Status: NEW → ASSIGNED
Comment on attachment 375123 [details] [diff] [review] patch Raúl, I don't have linux on sparc. Can you try this patch to see if it works on linux. Thanks a lot.
Attachment #375123 - Flags: review?(armin76)
Attached file backtrace.txt
Well, it compiles, but unfortunately it sigbuses. I'm attaching the backtrace. Thanks for the effort :)
(In reply to comment #6) > Created an attachment (id=375329) [details] > backtrace.txt > > Well, it compiles, but unfortunately it sigbuses. I'm attaching the backtrace. > > Thanks for the effort :) Well, this is a little bit complicate. I can not resolve this by guessing. I need to find a linux box to do some debugging.
Attached patch patch 2Splinter Review
This is the patch for tracemonkey.
Attachment #375123 - Attachment is obsolete: true
Attachment #376872 - Flags: review?(armin76)
Attachment #375123 - Flags: review?(armin76)
Attachment #376872 - Flags: review?(armin76)
For the crash issue we'd better file another bug to track it.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: