Git Product home page Git Product logo

Comments (34)

gdelugre avatar gdelugre commented on June 27, 2024

The linking process works if I remove the statement -Wl,--no-undefined, but I have not tested whether this would cause problems at run-time.

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

if you have the rubyracer installed you can run

therubyracer --selftest

and it should run it through its paces.

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

Same for me.

x86_64-pc-linux-gnu-g++ -shared -o v8.so v8_value.o v8_script.o rr.o v8_external.o v8_context.o v8_try_catch.o v8_array.o v8_string.o v8_date.o v8_locker.o v8_function.o v8_callbacks.o v8_weakref.o v8_template.o v8_object.o v8_message.o v8_v8.o v8_exception.o v8_debug.o v8_handle.o v8.o -L/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8 -Wl,-R/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8 -L. -L/usr/lib64 -Wl,-R/usr/lib64 -L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined   -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby19 -lpthread  -lpthread -lrt -ldl -lcrypt -lm   -lc -lv8
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::LinuxSemaphore::Signal()':
platform-linux.cc:(.text._ZN2v88internal14LinuxSemaphore6SignalEv[v8::internal::LinuxSemaphore::Signal()]+0x5): undefined reference to `sem_post'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::LinuxSemaphore::~LinuxSemaphore()':
platform-linux.cc:(.text._ZN2v88internal14LinuxSemaphoreD1Ev[v8::internal::LinuxSemaphore::~LinuxSemaphore()]+0x13): undefined reference to `sem_destroy'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::LinuxSemaphore::~LinuxSemaphore()':
platform-linux.cc:(.text._ZN2v88internal14LinuxSemaphoreD0Ev[v8::internal::LinuxSemaphore::~LinuxSemaphore()]+0x13): undefined reference to `sem_destroy'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::OS::CreateSemaphore(int)':
platform-linux.cc:(.text._ZN2v88internal2OS15CreateSemaphoreEi+0x30): undefined reference to `sem_init'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::LinuxSemaphore::Wait(int)':
platform-linux.cc:(.text._ZN2v88internal14LinuxSemaphore4WaitEi+0xb0): undefined reference to `sem_timedwait'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::LinuxSemaphore::Wait()':
platform-linux.cc:(.text._ZN2v88internal14LinuxSemaphore4WaitEv+0x35): undefined reference to `sem_wait'
platform-linux.cc:(.text._ZN2v88internal14LinuxSemaphore4WaitEv+0x56): undefined reference to `sem_wait'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::OS::CreateMutex()':
platform-linux.cc:(.text._ZN2v88internal2OS11CreateMutexEv+0x29): undefined reference to `pthread_mutexattr_init'
platform-linux.cc:(.text._ZN2v88internal2OS11CreateMutexEv+0x36): undefined reference to `pthread_mutexattr_settype'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::LinuxMutex::TryLock()':
platform-linux.cc:(.text._ZN2v88internal10LinuxMutex7TryLockEv[v8::internal::LinuxMutex::TryLock()]+0x9): undefined reference to `pthread_mutex_trylock'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Thread::SetThreadLocal(v8::internal::Thread::LocalStorageKey, void*)':
platform-linux.cc:(.text._ZN2v88internal6Thread14SetThreadLocalENS1_15LocalStorageKeyEPv+0x1): undefined reference to `pthread_setspecific'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Thread::GetThreadLocal(v8::internal::Thread::LocalStorageKey)':
platform-linux.cc:(.text._ZN2v88internal6Thread14GetThreadLocalENS1_15LocalStorageKeyE+0x1): undefined reference to `pthread_getspecific'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Thread::DeleteThreadLocalKey(v8::internal::Thread::LocalStorageKey)':
platform-linux.cc:(.text._ZN2v88internal6Thread20DeleteThreadLocalKeyENS1_15LocalStorageKeyE+0x1): undefined reference to `pthread_key_delete'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Thread::CreateThreadLocalKey()':
platform-linux.cc:(.text._ZN2v88internal6Thread20CreateThreadLocalKeyEv+0xc): undefined reference to `pthread_key_create'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Thread::Join()':
platform-linux.cc:(.text._ZN2v88internal6Thread4JoinEv+0xa): undefined reference to `pthread_join'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Thread::Start()':
platform-linux.cc:(.text._ZN2v88internal6Thread5StartEv+0x3a): undefined reference to `pthread_attr_setstacksize'
platform-linux.cc:(.text._ZN2v88internal6Thread5StartEv+0x50): undefined reference to `pthread_create'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::ThreadEntry(void*)':
platform-linux.cc:(.text._ZN2v88internalL11ThreadEntryEPv+0x35): undefined reference to `pthread_setspecific'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::ProfilerSignalHandler(int, siginfo*, void*)':
platform-linux.cc:(.text._ZN2v88internalL21ProfilerSignalHandlerEiP7siginfoPv+0x4f): undefined reference to `pthread_getspecific'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::OS::LogSharedLibraryAddresses()':
platform-linux.cc:(.text._ZN2v88internal2OS25LogSharedLibraryAddressesEv+0x5f): undefined reference to `pthread_getspecific'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Sampler::Stop()':
platform-linux.cc:(.text._ZN2v88internal7Sampler4StopEv+0x5e): undefined reference to `pthread_join'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::OS::Allocate(unsigned long, unsigned long*, bool)':
platform-linux.cc:(.text._ZN2v88internal2OS8AllocateEmPmb+0xbd): undefined reference to `pthread_getspecific'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `global constructors keyed to platform_linux.cc':
platform-linux.cc:(.text._GLOBAL__I_platform_linux.cc+0x29): undefined reference to `pthread_mutexattr_init'
platform-linux.cc:(.text._GLOBAL__I_platform_linux.cc+0x36): undefined reference to `pthread_mutexattr_settype'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::OS::Setup()':
platform-linux.cc:(.text._ZN2v88internal2OS5SetupEv+0x3e): undefined reference to `pthread_mutexattr_init'
platform-linux.cc:(.text._ZN2v88internal2OS5SetupEv+0x4b): undefined reference to `pthread_mutexattr_settype'
/usr/lib64/ruby/gems/1.9.1/gems/libv8-3.3.10.2-x86_64-linux/lib/libv8/build/v8/libv8.a(platform-linux.o): In function `v8::internal::Sampler::Start()':
platform-linux.cc:(.text._ZN2v88internal7Sampler5StartEv+0x171): undefined reference to `pthread_attr_setstacksize'
platform-linux.cc:(.text._ZN2v88internal7Sampler5StartEv+0x187): undefined reference to `pthread_create'
collect2: ld returned 1 exit status
make: *** [v8.so] Error 1

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

two questions:

  1. are you able to compile v8 manually
  2. when you run the selftest, does it work?

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024
  1. Manual compile was long about 5 minutes, but ends with no errors
  2. Where i can find it ?

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

therubyracer --selftest

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

{ ...byracer-0.9.4/bin }$ ./therubyracer
/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file to load -- v8 (LoadError) from /usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from ./therubyracer:7:in rescue in <main>' from ./therubyracer:3:in

'

but i have v8.so in therubyracer ext directory

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024
root@mail { ...uby/gems/1.9.1/gems/therubyracer-0.9.4/bin }$ ./therubyracer 
/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- v8 (LoadError)
    from /usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from ./therubyracer:7:in `rescue in <main>'
    from ./therubyracer:3:in `<main>'

root@mail { ...uby/gems/1.9.1/gems/therubyracer-0.9.4/bin }$ find / -name v8.so
/usr/lib64/v8.so

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

My problem totally solved - it is only gentoo ruby portage problem.
It is located in ruby make opts.
LDFLAGS used in resulting of ruby rbconfig.rb are wrong - using --no-undefined.
Therefore linkage is not completed successful.

Handy solution is to fix Config::CONFIG['LDFLAGS'] in rbconfig.rb to appropriate value.

I think this is not related to the project and therefore must be closed.

Thanks!

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

What is a PR ? Tell me please and i'll do it )

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

PR == 'pull request'. Actually, it sounds like there is nothing that we can tweak in this project to make it just magically work, right? In that case, I am just going to add an entry in the README to this issue for future Gentoo users who may come across this issue.

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

I have this line in rbconfig.rb

CONFIG["LDFLAGS"] = "-L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined"

With your extconf lib will not build up, but with
next line in extconf.rb

$LIBS << ' -lv8 -lpthread'

All is compiled successfully.
Maybe you should add this to the extconf.rb ??

Before we have in make file:

LIBS = $(LIBRUBYARG_SHARED) -lpthread  -lpthread -lrt -ldl -lcrypt -lm   -lc -lv8

and after

LIBS = $(LIBRUBYARG_SHARED) -lpthread  -lpthread -lrt -ldl -lcrypt -lm   -lc -lv8 -lpthread
linux-vdso.so.1 =>  (0x00007fff620f6000)
    libruby19.so.1.9 => /usr/lib64/libruby19.so.1.9 (0x00007f33e8e4d000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f33e8c23000)
    libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/libstdc++.so.6 (0x00007f33e890f000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f33e868e000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f33e8327000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f33e8110000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f33e7f07000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f33e7d02000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f33e7acb000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f33e97fc000)

And one more - i think that #have_library('pthread') is explicit in extconf.rb in this case.

I test it on ubuntu and gentoo (see above)

on ubuntu with this ruby ldflags

CONFIG["LDFLAGS"] = "-L.  -rdynamic -Wl,-export-dynamic"

i have working v8.so

        linux-vdso.so.1 =>  (0x00007fff5dbff000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2f74344000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2f7413c000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2f73f37000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f2f73cfe000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2f739f8000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2f73772000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2f733de000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2f731c8000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f2f74b47000)

Thanks for Yurial - the best C++ programmer i ever know

from libv8.

gdelugre avatar gdelugre commented on June 27, 2024

I can now compile on Gentoo without error. I have not touched anything in my configuration, so I suppose the problem is now fixed?

Anyway, the gem is working fine when I use it, but I cannot use --selftest:

$ therubyracer --selftest
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- spec_helper (LoadError)
    from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/local/lib64/ruby/gems/1.8/gems/therubyracer-0.9.4/spec/ext/array_spec.rb:1
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `map'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in `run'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
    from /usr/local/lib64/ruby/gems/1.8/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `autorun'
    from /usr/local/bin/therubyracer:19

I have rspec installed.

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

gdelugre, please do selftest at gem_localtion folder where spec subfolder is situated.

from libv8.

gdelugre avatar gdelugre commented on June 27, 2024

Thank you.
Everything is working fine.

from libv8.

alexbhr avatar alexbhr commented on June 27, 2024

Hey guys,
this problem still persists on gentoo-amd64, any plans on incorporating a fix?

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

according to @kalabiyau and @gdelugre, it is working fine for them, and they are using gentoo-amd64

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

I confirm, U can test my fork of therubyracer https://github.com/kalabiyau/therubyracer

Please try and tell us what kind of problems will you have

from libv8.

alexbhr avatar alexbhr commented on June 27, 2024

@cowboyd with the upstream gem I get the same error as above:
https://gist.github.com/86f8ed09775a8e18d4c8

@kalabiyau 's fork works like a charm, any plans on merging his changes in?

I have a large amount of servers that need building and deploying of all the gems automatically, so fiddling the gem is not an option and I would like to avoid cloning @kalabiyau's version in order to keep up to date.

from libv8.

alexbhr avatar alexbhr commented on June 27, 2024

@kalabiyau sounds to me like you can submit a pull request for this commit:
kalabiyau/therubyracer@1964f87

@cowboyd feel like accepting this in exchange for beer? :P

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

U can use it in gemfile like others but with git source, or U can make one gem builded on one server and deploy to anothers

About merging - maybe @cowboyd will check my PR :)

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

rubyjs/therubyracer#108 this one is done, but needs testing on other platforms - MacOS and freebsd

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

ok, v0.9.6 released

from libv8.

alexbhr avatar alexbhr commented on June 27, 2024

I am still having the same build problem on 0.9.6 under.

EDIT: Installing directly from gems still fails with the same error. "bundle install" in my Rails dir still fails to link as above.

from libv8.

Metallord avatar Metallord commented on June 27, 2024

Same here.
@kalabiyau 's fork works though.

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

weird. I merged his PR. What if you try this:

rubyjs/therubyracer@ff1abe7

from libv8.

alexbhr avatar alexbhr commented on June 27, 2024

Well, the following reproduces it reliably:

git clone git://github.com/cowboyd/therubyracer.git; cd therubyracer
gem build therubyracer.gemspec
gem install therubyracer-0.9.6.gem

Also, this Gentoo build was made from stage3-amd64-20110929.tar.bz2 and a portage snapshot of 20110930. Ruby 1.9.2 installed via portage.

EDIT: Same thing works for @kalabiyau's fork.

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

As mentioned, I have in fact merged his fork into master, so I'm not sure what exactly the problem is. @kalabiyau, can you tell why master is not building? I don't have a gentoo box available for testing

from libv8.

kalabiyau avatar kalabiyau commented on June 27, 2024

I have tested it. IMHO We must use -lpthread after the lv8 linkage
If we make

LIBS = $(LIBRUBYARG_SHARED)   -lrt -ldl -lcrypt -lm   -lc -lv8 -lpthread

Only one include of -lpthread after -lv8 usage - all is compiled well, but with your

$LIBS << ' -lpthread' unless $LIBS =~ /-lpthread/

It will fail because of undefined errors

It is save to append one pthread to the end and the first one to delete ?

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

Ok, well we'll just revert my "optimization" have a look at 0.9.7

from libv8.

Metallord avatar Metallord commented on June 27, 2024

Now I get this on installation (through bundler):

Installing therubyracer (0.9.7) with native extensions Invalid gemspec in 
[/home/lord/gems/bank/ruby/1.9.1/specifications/therubyracer-0.9.7.gemspec]: Illformed requirement ["#
<Syck::DefaultKey:0x00000004fa6500> 0.8.7"]

from libv8.

Metallord avatar Metallord commented on June 27, 2024

It prevents the gem from being installed I should add.

from libv8.

cowboyd avatar cowboyd commented on June 27, 2024

I believe that is a bug in either rubygems or in bundler

from libv8.

Metallord avatar Metallord commented on June 27, 2024

Well I removed the Syck::DefaultKey things from the gemspec and it works now.
Thank you for caring enough to fix problems of the gentoo minority :)

from libv8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.