Closed JerrySievert closed 4 years ago
oh, and I added myself as a contributor, and fixed the spelling of contributor to be correct.
Merged. A few things you should fix in your QuickJS fork.
CFLAGS=
. If you change this to CFLAGS +=
, you can remove the -O3 -fPIC
stuff because Rack's dep build automatically injects that, as well as -march=nocona
etc into CFLAGS.prefix=
which is bad because I can't overwrite with the command line. You'll need to change this to prefix ?=
in the QuickJS repo and then update the submodule in this repo in order for the current master
to work.why did you remove -fPIC
in your patch?
nevermind, just saw:
because Rack's dep build automatically injects that, as well as -march=nocona etc into CFLAGS.
teaches me to reply while still half asleep.
It's already in the CFLAGS environment variable for Rack plugins. Not sure if it should be default, but it wasn't in the original QuickJS source.
yeah, I knew it wasn't in the original QuickJS source, gcc gave me the error on Linux when embedding it within rack. I have the same issue when embedding on Linux with other code that uses -fPIC
when compiling:
/usr/bin/ld: deps/quickjs/libquickjs.a(quickjs.nolto.o): relocation R_X86_64_PC32 against symbol `lre_id_start_table_ascii' can not be used when making a shared object; recompile with -fPIC
given that I usually only embed with code that's compiled as a .so
, it should probably live there as being able to relocate isn't a problem when compiling against an executable.
@JerrySievert I've switched QuickJS from a submodule to the Makefile calling git clone ...
. This will probably change your workflow if maintaining QuickJS in the future, so you should know.
uses modified version of QuickJS that lives at https://github.com/JerrySievert/QuickJS
added
git clone
toMakefile
, you will likely want to change this to a submodule to lock down the commit id.I've tested builds on Mac, linux, and windows, tested running on Mac and windows.
There is a horrible hack that executes Javascript to convert
ArrayBuffer
toFloat32Array
, my change toquickjs.c
for this was not successful - I will make another attempt later to hopefully remove the hack. https://github.com/JerrySievert/VCV-Prototype/blob/master/src/QuickJSEngine.cpp#L191-L201otherwise, this is a pretty faithful port.
QuickJS changes:
#if 0
to hopefully be able to add them back in if it is possible to change the method that is used to determine stack sizeassert
that checked if variables were still allocated at context free, now just frees the allocated memory instead of dying-fPIC
to the Makefile, required for Linux-g
from Makefile-O3
to Makefile for some compile-time optimizations