Hi,
I am trying to use JSAutoStructuredCloneBuffer from js/StructuredClone in an application that uses spidermonkey 68 as its scripting engine. When I try to link the application the linker complains about missing SharedArrayRawBufferRefs symbol.
/usr/include/mozjs-68/js/StructuredClone.h:433: undefined reference to `js::SharedArrayRawBufferRefs::~SharedArrayRawBufferRefs()'
I am using my system mozjs-68 library (I am on debian bullseye). However, if I try to compile it from source using the information in
https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/esr68/docs/Building%20SpiderMonkey.md still, the destructor symbol is not exported by the compiled mozjs-68 library.
objdump -T libmozjs-68.so | c++filt | grep SharedArrayRawBufferRefs
(none)
as comparison:
objdump -T libmozjs-68.so | c++filt | grep JSAutoStructuredCloneBuffer
00000000005838b0 g DF .text 0000000000000082 mozjs_68 JSAutoStructuredCloneBuffer::JSAutoStructuredCloneBuffer(JSAutoStructuredCloneBuffer&&)
00000000005837c0 g DF .text 000000000000007c mozjs_68 JSAutoStructuredCloneBuffer::write(JSContext*, JS::Handle<JS::Value>, JSStructuredCloneCallbacks const*, void*)
0000000000583840 g DF .text 0000000000000070 mozjs_68 JSAutoStructuredCloneBuffer::read(JSContext*, JS::MutableHandle<JS::Value>, JSStructuredCloneCallbacks const*, void*)
0000000000583e60 g DF .text 0000000000000314 mozjs_68 JSAutoStructuredCloneBuffer::adopt(JSStructuredCloneData&&, unsigned int, JSStructuredCloneCallbacks const*, void*)
00000000005838b0 g DF .text 0000000000000082 mozjs_68 JSAutoStructuredCloneBuffer::JSAutoStructuredCloneBuffer(JSAutoStructuredCloneBuffer&&)
0000000000583c70 g DF .text 00000000000000bc mozjs_68 JSAutoStructuredCloneBuffer::operator=(JSAutoStructuredCloneBuffer&&)
0000000000583940 g DF .text 0000000000000322 mozjs_68 JSAutoStructuredCloneBuffer::steal(JSStructuredCloneData*, unsigned int*, JSStructuredCloneCallbacks const**, void**)
0000000000584180 g DF .text 000000000000006e mozjs_68 JSAutoStructuredCloneBuffer::write(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::CloneDataPolicy, JSStructuredCloneCallbacks const*, void*)
0000000000583d30 g DF .text 0000000000000129 mozjs_68 JSAutoStructuredCloneBuffer::clear()
Am I missing something? All the other symbols I use (Context creation, value r/w, GC management etc etc.) are correctly found, just SharedArrayRawBufferRefs destructor is not found. I use JSAutoStructuredCloneBuffer to move data between contexts. Is it the right way to do it? thanks!