Skip to content

Instantly share code, notes, and snippets.

@mharsch
Created June 12, 2012 15:34
Show Gist options
  • Save mharsch/2918235 to your computer and use it in GitHub Desktop.
Save mharsch/2918235 to your computer and use it in GitHub Desktop.
notes on porting v8plus to linux
--- notes from my initial pass trying to get wesolows/v8plus to work on linux ---
Download source for both SPL (Solaris Portability Layer) and ZFS from
zfsonlinux.org. Build both SPL and ZFS packages. Now you have the libnvpair
library and the necessary solaris header files to build v8plus.
Modify v8plus Makefile.v8plus.defs as follows
add '-I' include directives to CPPFLAGS for /tmp/zfs/lib/libspl/include and
/tmp/zfs/include (assuming you downloaded the zfs on linux repo to /tmp)
add -DHAVE_IOCTL_IN_UNISTD_H to CPPFLAGS
add -L/tmp/zfs/lib/libnvpair/.libs to LDFLAGS
Put /tmp/zfs/lib/libnvpair/.libs in your LD_LIBRARY_PATH
On linux, dlopen() must be passed either RTLD_NOW or RTLD_LAZY bits as part of
the mode argument. Solaris doesn't seem to have this dependency.
v8plus_subr.cc line 299 should be changed to include one of these flags.
Add def for _B_TRUE and _B_FALSE to /tmp/zfs/lib/libspl/include/sys/types.h:
typedef enum boolean { _B_FALSE, _B_TRUE } boolean_t;
v8plus example should now compile and run.
Tested on Ubuntu running 2.6.32 kernel and node 0.6.19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment