Comments (34)
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.
if you have the rubyracer installed you can run
therubyracer --selftest
and it should run it through its paces.
from libv8.
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.
two questions:
- are you able to compile v8 manually
- when you run the selftest, does it work?
from libv8.
- Manual compile was long about 5 minutes, but ends with no errors
- Where i can find it ?
from libv8.
therubyracer --selftest
from libv8.
{ ...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:in
require'
from ./therubyracer:7:in rescue in <main>' from ./therubyracer:3:in
but i have v8.so in therubyracer ext directory
from libv8.
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.
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.
What is a PR ? Tell me please and i'll do it )
from libv8.
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.
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.
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.
gdelugre, please do selftest at gem_localtion folder where spec subfolder is situated.
from libv8.
Thank you.
Everything is working fine.
from libv8.
Hey guys,
this problem still persists on gentoo-amd64, any plans on incorporating a fix?
from libv8.
according to @kalabiyau and @gdelugre, it is working fine for them, and they are using gentoo-amd64
from libv8.
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.
@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.
@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.
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.
rubyjs/therubyracer#108 this one is done, but needs testing on other platforms - MacOS and freebsd
from libv8.
ok, v0.9.6 released
from libv8.
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.
Same here.
@kalabiyau 's fork works though.
from libv8.
weird. I merged his PR. What if you try this:
from libv8.
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.
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.
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.
Ok, well we'll just revert my "optimization" have a look at 0.9.7
from libv8.
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.
It prevents the gem from being installed I should add.
from libv8.
I believe that is a bug in either rubygems or in bundler
from libv8.
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)
- register rubyjs.org ? HOT 10
- Installation failure -- update_depot_tools_toggle.py: no such file or directory HOT 3
- Binary builds for Apple Silicon M1 arm64-darwin-20 HOT 8
- Error "update_depot_tools_toggle.py" building libv8 ruby gem HOT 17
- Segfault during compilation on Ubuntu 20 HOT 3
- Unable To Install libv8/therubyracer on M1 Macbook Pro (Apple Silicon) HOT 60
- Release aarch64 gem HOT 2
- depot_tools may work with python3.8 or higher HOT 2
- Unable to install libv8 within docker running on Apple M1 HOT 9
- Installing 7.3.492.27.1 fails to install intermittently with "ImportError: No module named json" on Ubuntu 20.04.2 LTS HOT 1
- upgrade to newer version of libv8 that does not need Python 2.7 HOT 2
- Missing macOS Monterey build (x86_64-darwin-21) HOT 18
- Support for Apple Silicon (arm64-darwin21) HOT 1
- request for option HOT 1
- Unable to start rails Server
- psych 4.x breaks libv8 `.location.yml` deserialisation during extension building HOT 3
- Does not work on OSX 12.1 HOT 6
- How does libv8 find the system's v8? HOT 1
- libv8-node-*-x86_64-darwin-22 not found HOT 2
- Status: UNMAINTAINED HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libv8.