Почему therubyracer не может собрать мой Debian? - PullRequest
1 голос
/ 24 января 2012

Я хочу обновить до rails 3.2, но процесс сборки therubyracer (0.9.9) завершается неудачно.Я понятия не имею, что мне делать.

Мое окружение: Debian Squeeze (2.6.32-5-amd64)

make
compiling v8_external.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_external.cpp:4:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::External]’:
v8_external.cpp:51:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_external.cpp: At global scope:
v8_external.cpp:10: warning: ‘<unnamed>::references’ defined but not used
compiling v8_context.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_context.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Context]’:
v8_context.cpp:15:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::ObjectTemplate]’:
v8_context.cpp:22:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Value]’:
v8_context.cpp:23:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_value.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_value.cpp:1:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Value]’:
v8_value.cpp:10:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_message.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_message.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Message]’:
v8_message.cpp:10:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_date.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_date.cpp:4:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Date]’:
v8_date.cpp:21:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_handle.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_v8.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_callbacks.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_array.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_array.cpp:1:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Array]’:
v8_array.cpp:13:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_exception.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_exception.cpp:3:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::StackTrace]’:
v8_exception.cpp:48:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::StackFrame]’:
v8_exception.cpp:68:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_exception.cpp: At global scope:
v8_exception.cpp:10: warning: ‘<unnamed>::stack’ defined but not used
compiling v8_weakref.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_debug.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling v8_function.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_function.cpp:5:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Function]’:
v8_function.cpp:13:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Array]’:
v8_function.cpp:23:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::String]’:
v8_function.cpp:49:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_object.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_object.cpp:1:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Object]’:
v8_object.cpp:17:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_locker.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
v8_locker.cpp: In function ‘VALUE<unnamed>::Lock::Delete(VALUE)’:
v8_locker.cpp:45: warning: no return statement in function returning non-void
v8_locker.cpp: In function ‘VALUE<unnamed>::Unlock::Delete(VALUE)’:
v8_locker.cpp:85: warning: no return statement in function returning non-void
compiling v8_script.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_script.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Script]’:
v8_script.cpp:25:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_string.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_string.cpp:3:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::String]’:
v8_string.cpp:13:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
compiling rr.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
rr.cpp: In function ‘VALUE rr_define_finalizer(VALUE, void*, VALUE)’:
rr.cpp:48: warning: no return statement in function returning non-void
In file included from rr.cpp:3:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Value]’:
rr.cpp:159:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_template.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from v8_template.cpp:2:
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Template]’:
v8_template.cpp:42:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::ObjectTemplate]’:
v8_template.cpp:45:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::FunctionTemplate]’:
v8_template.cpp:48:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
v8_handle.h: In function ‘v8::Persistent<T>& rr_v8_handle(VALUE) [with T = v8::Data]’:
v8_template.cpp:54:   instantiated from here
v8_handle.h:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
compiling v8_try_catch.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
linking shared-object v8.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(functexcept.o): relocation R_X86_64_32 against `std::bad_typeid::~bad_typeid()' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [v8.so] Error 1

ОБНОВЛЕНИЕ

Я 'мы попробовали следующее:

  1. Загрузил копию источника git clone https://github.com/cowboyd/therubyracer.git
  2. Добавлен $CPPFLAGS += " -fPIC" в ext/v8/extconf.rb
  3. Встроенный камень с gem build therubyracer.gemspec
  4. Установленный гем с gem install therubyracer-0.9.9.gem

Та же ошибка была показана мне!Выпуск: https://github.com/cowboyd/therubyracer/issues/135

Ответы [ 3 ]

2 голосов
/ 24 апреля 2012

В debian (686 с ядром amd64) мне пришлось удалить livb8, скачать гем и перекомпилировать для моей архитектуры

gem uninstall libv8
wget http://rubygems.org/downloads/libv8-3.3.10.4.gem
ARCHFLAG='-arch i386' gem install ./libv8-3.3.10.4.gem
ARCHFLAG='-arch i386' gem install therubyracer

Затем therubyracer (0.10.1) установился нормально.

1 голос
/ 24 января 2012
recompile with -fPIC

Вы пытались добавить -fPIC в качестве дополнительного флага сборки?Вы можете проверить это в установке gem:

$ gem install therubyracer -- -fPIC

Или, с Bundler:

$ bundle config build.therubyracer -fPIC

Похоже, кто-то еще указал на это в выпуске ,Возможно, вы захотите проверить это, если вышеперечисленное не работает.

0 голосов
/ 31 января 2012

Одним из решений является запуск версии 0.9.8 как версии 0.9.9. (решает не настоящую проблему):

  1. Клон источника therubyracer git clone https://github.com/cowboyd/therubyracer.git
  2. Checkout tag v0.9.8 git checkout v0.9.8
  3. Изменить номер версии в ./lib/v8/version.rb на 0.9.9
  4. Построить драгоценный камень gem build therubyracer.gemspec
  5. Установить драгоценный камень gem install therubyracer-0.9.9.gem
...