Page MenuHomeFreeBSD

New spidermonkey port based on firefox-esr 52.4.1.
AbandonedPublic

Authored by kwm on Oct 14 2017, 1:40 PM.

Details

Reviewers
None
Group Reviewers
gecko
Summary

But I need help. When build with clang there are undefined references,
and I'm not able to find out why this is. I listed the things I did
find out in this review. But I suspect it is either my unfamiliarty with
C++, the mozilla buildsystem or some kind of wierd clang vs gcc thing.

I found this problem when I was trying to port lang/gjs to version 1.50.1.
This version requires spidermonkey52 but I was getting the undefined
references problem. This problem first showed up on my test system which
is running HEAD, but I also reproduced it on 10.3-i386 with clang.

./.libs/libgjs.so: undefined reference to `void JS::TraceEdge<JSObject*>(JSTracer*, JS::Heap<JSObject*>*, char const*)'
./.libs/libgjs.so: undefined reference to `void js::UnsafeTraceManuallyBarrieredEdge<JSObject*>(JSTracer*, JSObject**, char const*)'
./.libs/libgjs.so: undefined reference to `void js::UnsafeTraceManuallyBarrieredEdge<JS::Value>(JSTracer*, JS::Value*, char const*)'
./.libs/libgjs.so: undefined reference to `void js::UnsafeTraceManuallyBarrieredEdge<jsid>(JSTracer*, jsid*, char const*)'

After some looking around I decided to build spidermonkey52 with both clang
and gcc6, and looked at the symbols in libmozjs-52.so.

nm -DgC /usr/local/lib/libmozjs-52.so.1 > ${compiler}-symbols.txt

lang/spidermonkey52 % cat gcc-symbols.txt | grep JS::TraceEdge
0000000000650ecc T JS::TraceEdge(JSTracer*, JS::TenuredHeap<JSObject*>*, char const*)
000000000065e082 W void JS::TraceEdge<jsid>(JSTracer*, JS::Heap<jsid>*, char const*)
0000000000662961 W void JS::TraceEdge<JS::Value>(JSTracer*, JS::Heap<JS::Value>*, char const*)
000000000065c123 W void JS::TraceEdge<JSFunction*>(JSTracer*, JS::Heap<JSFunction*>*, char const*)
000000000065ccc2 W void JS::TraceEdge<JSAtom*>(JSTracer*, JS::Heap<JSAtom*>*, char const*)
000000000065c146 W void JS::TraceEdge<JSObject*>(JSTracer*, JS::Heap<JSObject*>*, char const*)
000000000065ea67 W void JS::TraceEdge<JSScript*>(JSTracer*, JS::Heap<JSScript*>*, char const*)
000000000065cce5 W void JS::TraceEdge<JSString*>(JSTracer*, JS::Heap<JSString*>*, char const*)
000000000065ddcf W void JS::TraceEdge<JS::Symbol*>(JSTracer*, JS::Heap<JS::Symbol*>*, char const*)
clang:
0000000000740770 T JS::TraceEdge(JSTracer*, JS::TenuredHeap<JSObject*>*, char const*)
00000000007519d0 W void JS::TraceEdge<jsid>(JSTracer*, JS::Heap<jsid>*, char const*)
0000000000751870 W void JS::TraceEdge<JS::Value>(JSTracer*, JS::Heap<JS::Value>*, char const*)
0000000000751530 W void JS::TraceEdge<JSFunction*>(JSTracer*, JS::Heap<JSFunction*>*, char const*)
00000000007513e0 W void JS::TraceEdge<JSAtom*>(JSTracer*, JS::Heap<JSAtom*>*, char const*)
0000000000751590 W void JS::TraceEdge<JSScript*>(JSTracer*, JS::Heap<JSScript*>*, char const*)
0000000000751720 W void JS::TraceEdge<JSString*>(JSTracer*, JS::Heap<JSString*>*, char const*)
0000000000751290 W void JS::TraceEdge<JS::Symbol*>(JSTracer*, JS::Heap<JS::Symbol*>*, char const*)

Ok so only the JS::TraceEdge<JSObject*>() function is missing. Now the
other symbol.

lang/spidermonkey52 % cat gcc-symbols.txt | grep js::UnsafeTraceManuallyBarrieredEdge
000000000065e0a8 W void js::UnsafeTraceManuallyBarrieredEdge<jsid>(JSTracer*, jsid*, char const*)
0000000000662991 W void js::UnsafeTraceManuallyBarrieredEdge<JS::Value>(JSTracer*, JS::Value*, char const*)
000000000065c138 W void js::UnsafeTraceManuallyBarrieredEdge<JSFunction*>(JSTracer*, JSFunction, char const*)
000000000065ccd7 W void js::UnsafeTraceManuallyBarrieredEdge<JSAtom*>(JSTracer*, JSAtom
, char const*)
000000000065c15b W void js::UnsafeTraceManuallyBarrieredEdge<JSObject*>(JSTracer*, JSObject, char const*)
000000000065ea7c W void js::UnsafeTraceManuallyBarrieredEdge<JSScript*>(JSTracer*, JSScript
, char const*)
000000000065ccfa W void js::UnsafeTraceManuallyBarrieredEdge<JSString*>(JSTracer*, JSString, char const*)
000000000065dde4 W void js::UnsafeTraceManuallyBarrieredEdge<JS::Symbol*>(JSTracer*, JS::Symbol
, char const*)

lang/spidermonkey52 % cat clang-symbols.txt | grep js::UnsafeTraceManuallyBarrieredEdge
0000000000751370 W void js::UnsafeTraceManuallyBarrieredEdge<JS::Symbol*>(JSTracer*, JS::Symbol**, char const*)

This function is even missing more stuff.

I think we can presume there are more "missing symbols" but these are the
only onces I focused on due to gjs.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12045
Build 12352: arc lint + arc unit

Event Timeline

kwm created this revision.Oct 14 2017, 1:40 PM
kwm added a project: gecko.Oct 14 2017, 1:45 PM

CC'ing gecko people, with the hope they can help with the symbol problems with standalone spidermonkey52.

Before anyone asks, the patches are from the archlinux mozjs52 package.

kwm added a reviewer: gecko.Oct 14 2017, 1:46 PM

sigh, I never learn phabricator ... Properly add gecko@ as reviewer

kwm abandoned this revision.Jan 22 2018, 5:49 PM

Issues been fixed, spidermonkey 52 will arrive to the ports tree soon TM.