Skip to content

Instantly share code, notes, and snippets.

Last active October 23, 2016 23:49
What would you like to do?
Building v8 and plv8 under mingw-w64
# I still haven't figured out how to build with gyp,
# after many hours trying downloading 700 mb of a toolchain google forces me to use,
# so I still build with a version of v8 that I know works with scons
# 1. install scons (32-bit) from (I think mine is 2.3.4) and I have in python 2.7 something
# 2. For this I've been using mingw-w64 on a windows 7 64-bit ((x86_64-win32-seh-rev1, Built by MinGW-W64 project) 4.8.3) , Msys
# (for the 32-bit version I use minGW-w64 w32 chain ( (rev2, Built by MinGW-W64 project) 4.8.1 with sjlj ) )
##Building V8
## Rest is script, there is some manual edit involved
#export PATH="/c/Python27:/c/Python27/Scripts:.:/bin:/include:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows"
export PATH="/c/Python27:/c/Python27/Scripts:.:/bin:/include:/mingw/bin"
export PROJECTS=/projects
export V8_REL=3.14.5
cd ${PROJECTS}/v8
#svn checkout${V8_REL}/ ${V8_REL}
#git clone -b $V8_REL ${V8_REL}
cd ${PROJECTS}/v8/${V8_REL}
#make clean
###Edit the SConstruct file at the root of v8 source tree line 305, 408 and remove the '-Werror'
###If you are building for 32-bit change the x64 to ia32 --warn=no-all mode=release arch=x64 toolchain=gcc importenv=PATH library=shared I_know_I_should_build_with_GYP=yes --warn=no-all d8 mode=release arch=x64 toolchain=gcc importenv=PATH library=shared I_know_I_should_build_with_GYP=yes
strip *.dll
##you should now have a v8.dll, v8preparser.dll, d3.exe in the root of your v8/3.14.5 source tree
## building plv8
export OS_BUILD=64
export PROJECTS=/projects
export GCC_TYPE=gcc48
export PG_VER=9.4
export PGPATH=${PROJECTS}/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE}
export PGPORT=5444
export PGUSER=postgres
export SOURCES=/sources
if true; then
rm -rf plv8js
git clone -b r1.4 plv8js
cd plv8js
export AUTOV8_VERSION=3.14.5
export V8_SRCDIR=${AUTOV8_DIR}
export V8_OUTDIR=${AUTOV8_DIR}
export PATH="${AUTOV8_DIR}:${AUTOV8_DIR}/include:$PATH"
git pull
make clean
export SHLIB_LINK="-lv8 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm"
make && make install && make installcheck && strip *.dll
Copy link

isapir commented Jan 11, 2016


I'm trying to follow your instructions in order to build plv8 for PostgreSQL-9.5 but I don't have an SConstruct file at the root of V8 source tree.

Any ideas? Thanks!

Copy link

I installed PostgreSQL 9.4 and attempted the installation for plv8. On the surface it seemed to go as expected. I did the CREATE EXTENSION plv8; it returned CREATE EXTENSION. Then I added the comments to the custom_variables in the Postgresql.conf and attempted to restart the server and it would not restart. I am running xTuple ERP on it. Any recommendations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment