Ruby eventmachine 编译错误

发布于 2024-12-14 03:47:55 字数 953 浏览 0 评论 0原文

ruby 1.9.2-p290 上编译 eventmachine 0.12.10 时,我收到以下错误输出:

g++ -shared -o rubyeventmachine.so binder.o cmain.o cplusplus.o ed.o em.o emwin.o epoll.o files.o kb.o page.o pipe.o rubymain.o sigs.o ssl.o -L. -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -Wl,-R/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L.  -rdynamic -Wl,-export-dynamic    -Wl,-R -Wl,/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -lruby  -lssl -lcrypto   -lpthread -lrt -ldl -lcrypt -lm   -lc
/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

这是在运行 debian squeeze 的 Linux 机器上完成的。

有什么建议吗?提前致谢!

I'm getting the following error output when compiling eventmachine 0.12.10 on ruby 1.9.2-p290:

g++ -shared -o rubyeventmachine.so binder.o cmain.o cplusplus.o ed.o em.o emwin.o epoll.o files.o kb.o page.o pipe.o rubymain.o sigs.o ssl.o -L. -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -Wl,-R/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L.  -rdynamic -Wl,-export-dynamic    -Wl,-R -Wl,/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -L/home/git/.rvm/rubies/ruby-1.9.2-p290/lib -lruby  -lssl -lcrypto   -lpthread -lrt -ldl -lcrypt -lm   -lc
/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

This is done on a linux machine running debian squeeze.

Any suggestions? Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

内心激荡 2024-12-21 03:47:55

我在尝试在标准 debian squeeze 安装上构建 mosh-1.2.2 时遇到了类似的问题。以下内容对我有用:

# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# rm libstdc++.so
# ln -s ../../../x86_64-linux-gnu/libstdc++.so.6 libstdc++.so

为了更详细地解释,现有的符号链接指向一个不存在的文件:

# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# ls -l libstdc++.so
..
lrwxrwxrwx 1 root root      23 May  3  2011 libstdc++.so -> ../../../libstdc++.so.6
..

我找到了正确的文件位置

# dpkg -S 'libstdc'
..
libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
..

然后按照第一个代码段中的描述修复了符号链接。

我在编译过程中遇到的错误是:

make[3]: *** [mosh-client] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
/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

不知道这个特定的 Debian 挤压服务器是如何崩溃的。我一直在其他挤压系统上进行编译,没有遇到任何问题。

I had a similar issue trying to build mosh-1.2.2 on a standard debian squeeze installation. The following worked for me:

# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# rm libstdc++.so
# ln -s ../../../x86_64-linux-gnu/libstdc++.so.6 libstdc++.so

To explain in a more detail, the existing symlink was pointing to a non-existent file:

# cd /usr/lib/gcc/x86_64-linux-gnu/4.4.5
# ls -l libstdc++.so
..
lrwxrwxrwx 1 root root      23 May  3  2011 libstdc++.so -> ../../../libstdc++.so.6
..

I located the correct file location

# dpkg -S 'libstdc'
..
libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
..

Then repaired the symlink as described in the first code segment.

The error I was getting during compiling was:

make[3]: *** [mosh-client] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
/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

No idea how this particular debian squeeze server broke. I've been compiling on other squeeze systems with no trouble.

后eg是否自 2024-12-21 03:47:55

您的 gcc 安装错误。

特别是,您在 /usr/lib/gcc/x86_64-linux-gnu/4.4.5/ 中有 libstdc++.a,但(显然)不是 libstdc++ .so.

libstdc++.a 中的代码不是使用 -fPIC 标志构建的,因此您无法将该代码链接到共享库。

Your gcc installation is bad.

In particular, you have libstdc++.a in /usr/lib/gcc/x86_64-linux-gnu/4.4.5/, but (apparently) not libstdc++.so.

The code in libstdc++.a was not built with -fPIC flag, and so you can't link that code in to a shared library.

佼人 2024-12-21 03:47:55

我在尝试使用 rvmtherubyracer 0.9.9 安装 ree 1.8.7-2012.02 时遇到了同样的问题。你写的最后一条评论让我能够正确修复它,我只需使用下一个命令将 g++ 更新到测试版本:

sudo apt-get install -t wheezy g++

有关使用不同版本的软件包保留 debian 系统的更多信息,请参阅 debian 文档 如何保持混合系统

I got the same problem when trying to install ree 1.8.7-2012.02 with rvm or therubyracer 0.9.9. The last comment you wrote make me able to correctly fix it, I just use the next command to update g++ to the testing version :

sudo apt-get install -t wheezy g++

For more informations about keeping a debian system with packages from different releases is in the debian doc How to keep a mixed system

十秒萌定你 2024-12-21 03:47:55

升级到 ruby 2.2.3 解决了我的问题

$ gcc -v
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3)
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

upgrading to ruby 2.2.3 resolved the issue for me

$ gcc -v
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3)
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文