Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpiderMonkey build issues #359

Open
jailbird777 opened this issue Jan 8, 2025 · 2 comments
Open

SpiderMonkey build issues #359

jailbird777 opened this issue Jan 8, 2025 · 2 comments

Comments

@jailbird777
Copy link
Contributor

Attempting to build 0.18.0 with SpiderMoney 128, which is the required version according to the changelog, errors with:

FAILED: src/elinks.p/js_spidermonkey_fragment.cpp.o
c++ -Isrc/elinks.p -Isrc -I../src -I. -I.. -I/usr/local/include -I/usr/local/include/nspr -I/usr/local/lib/perl5/5.40/mach/CORE -I/usr/local/include/js-128 -fdiagnostics-color=never -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu++17 -O2 -pipe -O3 -march=native -mtune=native -fzero-call-used-regs=used -fstack-protector-all -Qunused-arguments -isystem /usr/local/include -fno-strict-aliasing -O3 -march=native -mtune=native -DHARDENEDBSD -fzero-call-used-regs=used -isystem /usr/local/include -DLIBICONV_PLUG -isystem /usr/local/include -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -fstack-protector-strong -isystem /usr/local/include/mozjs-128 -isystem /usr/local/include -DHAVE_CONFIG_H -fno-strict-aliasing -Wno-address -Wno-array-bounds -fpermissive -Wno-sign-compare -MD -MQ src/elinks.p/js_spidermonkey_fragment.cpp.o -MF src/elinks.p/js_spidermonkey_fragment.cpp.o.d -o src/elinks.p/js_spidermonkey_fragment.cpp.o -c ../src/js/spidermonkey/fragment.cpp
In file included from ../src/js/spidermonkey/fragment.cpp:15:
In file included from ../src/js/spidermonkey/util.h:4:
In file included from ../src/js/spidermonkey-shared.h:4:
In file included from /usr/local/include/mozjs-128/jsapi.h:30:
In file included from /usr/local/include/mozjs-128/js/CallAndConstruct.h:15:
/usr/local/include/mozjs-128/js/RootingAPI.h:1182:9: error: cannot initialize a member subobject of type 'JSObject *' with an lvalue of type 'void *'
1182 | : ptr(std::forward(initial)) {
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~
../src/js/spidermonkey/fragment.cpp:2293:19: note: in instantiation of function template specialization 'JS::Rooted<JSObject *>::Rooted<JSContext *, void *&>' requested here
2293 | JS::RootedObject r_doc(ctx, interpreter->document_obj);
| ^
1 error generated.

I tried to fix it myself, but I'm a C guy, not a C++ guy, so I have no clue how instantiations work.

@rkd77
Copy link
Owner

rkd77 commented Jan 9, 2025

Oh, sorry, I did not build it under BSD. You can try cast interpreter->document_obj to (JSObject *).
Here it would be:
JS::RootedObject r_doc(ctx, (JSObject *)interpreter->document_obj);
If such places is more, you can change void * to JSObject * at the begining of the ecmascript.h in the struct ecmascript_interpreter.

@dmarquess2
Copy link

Bingo! That did the trick, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants