Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

therubyracer/libv8 broken on FreeBSD 9 #52

Closed
threeturn opened this issue Sep 11, 2012 · 14 comments
Closed

therubyracer/libv8 broken on FreeBSD 9 #52

threeturn opened this issue Sep 11, 2012 · 14 comments

Comments

@threeturn
Copy link
Contributor

Hi,

When I'm trying to install therubyracer on FreeBSD 9 AMD64 i got this error message:

[xxxxx@xxxxx-vm ~]$ sudo gem install therubyracer
Fetching: libv8-3.3.10.4-amd64-freebsd-9.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby19 extconf.rb

creating Makefile

make
compiling rr.cpp
rr.cpp: In function 'VALUE rr_define_finalizer(VALUE, void_, VALUE)':
rr.cpp:48: warning: control reaches end of non-void function
compiling v8.cpp
In file included from v8.cpp:16:
v8_locker.h:6:7: warning: no newline at end of file
In file included from v8.cpp:17:
v8_debug.h:6:7: warning: no newline at end of file
In file included from v8.cpp:18:
v8_v8.h:6:7: warning: no newline at end of file
compiling v8_array.cpp
v8_array.cpp:48:2: warning: no newline at end of file
compiling v8_callbacks.cpp
compiling v8_context.cpp
compiling v8_date.cpp
v8_date.cpp:34:2: warning: no newline at end of file
compiling v8_debug.cpp
In file included from v8_debug.cpp:2:
v8_debug.h:6:7: warning: no newline at end of file
compiling v8_exception.cpp
v8_exception.cpp:10: warning: '::stack' defined but not used
compiling v8_external.cpp
v8_external.cpp:10: warning: '::references' defined but not used
compiling v8_function.cpp
compiling v8_handle.cpp
compiling v8_locker.cpp
In file included from v8_locker.cpp:2:
v8_locker.h:6:7: warning: no newline at end of file
v8_locker.cpp: In function 'VALUE::Unlock::Delete(VALUE)':
v8_locker.cpp:85: warning: control reaches end of non-void function
v8_locker.cpp: In function 'VALUE::Lock::Delete(VALUE)':
v8_locker.cpp:45: warning: control reaches end of non-void function
compiling v8_message.cpp
compiling v8_object.cpp
compiling v8_script.cpp
compiling v8_string.cpp
compiling v8_template.cpp
compiling v8_try_catch.cpp
compiling v8_v8.cpp
compiling v8_value.cpp
v8_value.cpp:175:2: warning: no newline at end of file
compiling v8_weakref.cpp
linking shared-object v8.so
/usr/bin/ld: /usr/local/lib/ruby/gems/1.9/gems/libv8-3.3.10.4-amd64-freebsd-9/lib/libv8/build/v8/libv8.a(api.o): relocation R_X86_64_32S against `ZTVN2v89ExtensionE' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/ruby/gems/1.9/gems/libv8-3.3.10.4-amd64-freebsd-9/lib/libv8/build/v8/libv8.a: could not read symbols: Bad value
*
* Error code 1

Stop in /usr/local/lib/ruby/gems/1.9/gems/therubyracer-0.10.2/ext/v8.

The pull request #51 fix that.

Cheers,
Andrea.

@rikai
Copy link

rikai commented Sep 18, 2012

This can probably be closed now too, now that it's been merged. :P

@cowboyd cowboyd closed this as completed Sep 18, 2012
@threeturn
Copy link
Contributor Author

Actually the binary gem (libv8-3.3.10.4) still have the problem therefore there is no way to build therubyracer on freebsd :(

@cowboyd
Copy link
Collaborator

cowboyd commented Sep 19, 2012

@andreacgranata can you not use the pre-release version of therubyracer? 0.11.0beta8?

@rikai
Copy link

rikai commented Sep 19, 2012

I successfully got everything working on FreeBSD just last night.
Clone the libv8 repo, compile from the source and install the gem
After that, just gem install therubyracer --pre

It's pretty much that simple. :)

@threeturn
Copy link
Contributor Author

@rikai of course I know the now everything is working on FreeBSD with the beta version of therubyracer and with the lastest version of libV8.

@cowboyd I'm trying to install Gitlab (https://github.com/gitlabhq/) on FreeBSD. The Gitlab Gemfile.lock declare therubyracer 0.10.1 so i was hoping to get a working stable version also on FreeBSD.

Anyway what's the point in having a broken gem (libv8-3.3.10.4-amd64-freebsd-9) on rubygems? :)

@cowboyd
Copy link
Collaborator

cowboyd commented Sep 20, 2012

There isn't much point, although @renchap was the one who compiled it. I believe that it's working for him, no?

@threeturn
Copy link
Contributor Author

@cowboyd ok, I'll try to get in touch with @renchap.

@yurivict
Copy link

yurivict commented Oct 7, 2012

I had the same issue on FreeBSD 9 amd64 as OP. So I installed the latest version of libv8 3.11.8.3.
Now command 'sudo gem install therubyracer -v '0.11.0beta8' breaks with this message:
c++ -shared -o init.so accessor.o array.o backref.o constants.o constraints.o context.o date.o exception.o external.o function.o gc.o handles.o heap.o init.o invocation.o locker.o message.o object.o primitive.o rr.o script.o signature.o stack.o string.o template.o trycatch.o v8.o value.o -L. -L/usr/local/lib -Wl,-R/usr/local/lib /usr/local/lib/ruby/gems/1.8/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a /usr/local/lib/ruby/gems/1.8/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a -L. -L/usr/lib -rpath=/usr/lib:/usr/local/lib -pthread -rdynamic -Wl,-soname,init.so -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby18 -lpthread -lcrypt -lm -L/usr/lib -rpath=/usr/lib:/usr/local/lib -pthread
/usr/bin/ld: /usr/local/lib/ruby/gems/1.8/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a(api.o): relocation R_X86_64_32S against `_ZTVN2v810ScriptDataE' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/ruby/gems/1.8/gems/libv8-3.11.8.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Bad value

@threeturn
Copy link
Contributor Author

@yurivict did you build libv8 from the source or you just installed the gem?

@jupp0r
Copy link

jupp0r commented Nov 1, 2012

I installed the libv8 gem, it still doesn't work, even with 0.11.0beta8.

@voidzero
Copy link

There is a separate gem called libv8-freebsd. I remember that worked for me but I can't remember how I installed that with bundle. It should work though. It's currently at version 3.11.8.3.

@voidzero
Copy link

Oh, there also exists therubyracer-freebsd; version 0.10.1 whereas therubyracer has version 0.11.0.

See here: rubyjs/therubyracer#158

@voidzero
Copy link

Right. I was trying to get this all to work with Gitlab too but as it turns out, it seems that on Gitlab you can simply comment therubyracer and libv8 from Gemfile and Gemfile.lock and Gitlab still seems to work.

@renchap
Copy link

renchap commented Dec 16, 2012

I have compiled a new version a therubyracer for FreeBSD 9 64 bits. You can find the gem here : http://zekk.renchap.com/therubyracer-0.11.0-amd64-freebsd-9.gem

To install it using bundler (for Rails for example), put it in vendor/cache, then run bundler. It should use this gem file, and it worked fine for me on 2 servers.
On my Gemfiles, I use :

gem 'therubyracer', '0.11.0'

I will check with @cowboyd to upload in on rubygems, so it should work out of the box.

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

No branches or pull requests

7 participants