Open
Bug 1039964
Opened 10 years ago
Updated 2 years ago
undefined reference to `JS::WeakMapPtr<JSObject*, JSObject*>::trace(JSTracer*) when building with --enable-shared-js
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
NEW
People
(Reporter: glandium, Unassigned)
References
Details
Attachments
(1 file)
713 bytes,
patch
|
Details | Diff | Splinter Review |
../../../dom/bindings/Unified_cpp_dom_bindings0.o: In function `TraceSelf':
/home/glandium/mozilla-central/js/xpconnect/src/xpcprivate.h:1071: undefined reference to `JS::WeakMapPtr<JSObject*, JSObject*>::trace(JSTracer*)'
../../../js/xpconnect/src/Unified_cpp_js_xpconnect_src1.o: In function `~XPCWrappedNativeScope':
/home/glandium/mozilla-central/js/xpconnect/src/XPCWrappedNativeScope.cpp:404: undefined reference to `JS::WeakMapPtr<JSObject*, JSObject*>::destroy()'
../../../js/xpconnect/src/Unified_cpp_js_xpconnect_src1.o: In function `initialized':
/home/glandium/build/obj-x86_64-unknown-linux-gnu/js/xpconnect/src/../../../dist/include/js/WeakMapPtr.h:(.text._ZN21XPCWrappedNativeScope15GetExpandoChainEN2JS6HandleIP8JSObjectEE+0xc): undefined reference to `JS::WeakMapPtr<JSObject*, JSObject*>::lookup(JSObject* const&)'
../../../js/xpconnect/src/Unified_cpp_js_xpconnect_src1.o: In function `SetExpandoChain':
/home/glandium/mozilla-central/js/xpconnect/src/XPCWrappedNativeScope.cpp:703: undefined reference to `JS::WeakMapPtr<JSObject*, JSObject*>::init(JSContext*)'
/home/glandium/mozilla-central/js/xpconnect/src/XPCWrappedNativeScope.cpp:705: undefined reference to `JS::WeakMapPtr<JSObject*, JSObject*>::put(JSContext*, JSObject* const&, JSObject* const&)'
/usr/bin/ld: libxul.so: hidden symbol `_ZN2JS10WeakMapPtrIP8JSObjectS2_E4initEP9JSContext' isn't defined
WeakMapPtr is declared visible, but as I understand it, the fact that JSObject is not visible makes the symbols hidden.
A minimal testcase is as follows:
#pragma GCC visibility push(hidden)
class A;
template <class T>
class __attribute__((visibility("default"))) B {
public:
void init(T *t) { }
};
void foo(A *a) {
B<A> b;
b.init(a);
}
This results in the _ZN1BI1AE4initEPS0_ symbol being hidden.
While --enable-shared-js is not really a supported option for Linux or Mac, it is useful to make incremental builds faster, and is also helpful to test a kind-of-like Windows setup on Linux when working on the build system.
Reporter | ||
Comment 1•10 years ago
|
||
And it works on Windows because dllexport on the template doesn't have the same restriction.
Comment 2•10 years ago
|
||
--enable-shared-js is also very useful for profiling.
Reporter | ||
Comment 3•10 years ago
|
||
This worked for me, but this has the unpleasant side effect of making JSObject functions public when they weren't before.
Reporter | ||
Comment 4•10 years ago
|
||
Please note I won't be actively working on this bug despite having attached a working hackish patch.
Reporter | ||
Comment 5•10 years ago
|
||
Also note that it's hackish *and* dangerous. I'm sure there are possible problems with JSObject not being declared visible in jsobj.h (that is, some files would think it's hidden and others it's visible).
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•