注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

断尘居

温柔的男人像海洋。

 
 
 
 
 

日志

 
 

用eclipse构建OpenJDK7报错/usr/bin/ld: cannot find -lstdc++  

2014-11-16 03:40:47|  分类: JVM/ HotSpot |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

 # 软件环境丨Software Environment

OS: CentOS 6.5
IDE: eclipse-cpp-luna

# 问题描述丨Problem Description

博主在以前的文章里已经介绍过在Linux下编译OpenJDK7的方法,今天准备用eclipse build一次,然后顺便搭建一下debug环境,不过在build过程中报错如下:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libstdc++.a when searching for -lstdc++

/usr/bin/ld: cannot find -lstdc++


使用rpm -aq查询了一下是否安装了stdc++包,结果并未安装。

 # 解决方案丨Solution

原因是缺少stdc++包,于是通过yum安装:

[root@BobServerStation local]#  yum install -y sdtc++-devel


安装完成之后重新build,顺利通过。以下是部分log信息:

/usr/bin/objcopy --only-keep-debug libsaproc.so libsaproc.debuginfo

/usr/bin/objcopy --add-gnu-debuglink=libsaproc.debuginfo libsaproc.so

strip -g libsaproc.so

[ -f libsaproc_g.debuginfo ] || { ln -s libsaproc.debuginfo libsaproc_g.debuginfo; }

zip -q -y libsaproc.diz libsaproc.debuginfo libsaproc_g.debuginfo

rm -f libsaproc.debuginfo libsaproc_g.debuginfo

[ -f libsaproc_g.diz ] || { ln -s libsaproc.diz libsaproc_g.diz; }

echo "**NOTICE** Dtrace support disabled: "/usr/include/sys/sdt.h not found""

**NOTICE** Dtrace support disabled: /usr/include/sys/sdt.h not found

make[4]: Leaving directory `/usr/local/openjdk/hotspot/build/linux/linux_i486_compiler1/fastdebug'

All done.

make[3]: Leaving directory `/usr/local/openjdk/hotspot/build/linux/linux_i486_compiler1/fastdebug'

cd linux_i486_compiler1/fastdebug && ./test_gamma

JAVA_HOME must point to a 32-bit OpenJDK.

make[2]: Leaving directory `/usr/local/openjdk/hotspot/build/linux'

make[1]: Leaving directory `/usr/local/openjdk/hotspot/make'

make BUILD_FLAVOR=fastdebug VM_SUBDIR=fastdebug \

      EXPORT_SUBDIR=/fastdebug \

      generic_export

INFO: ENABLE_FULL_DEBUG_SYMBOLS=1

INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.

INFO: STRIP_POLICY=min_strip

INFO: ZIP_DEBUGINFO_FILES=1

make[1]: Entering directory `/usr/local/openjdk/hotspot/make'

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_docs/jvmti.html /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/docs/platform/jvmti/jvmti.html

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler2/fastdebug/libjsig.so /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/libjsig.so

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler2/fastdebug/libjsig.diz /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/libjsig.diz

rm -f /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/server/Xusage.txt.temp

sed 's/\(separated by \)[;:]/\1:/g' /usr/local/openjdk/hotspot/src/share/vm/Xusage.txt > /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/server/Xusage.txt.temp

mv /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/server/Xusage.txt.temp /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/server/Xusage.txt

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler2/fastdebug/libjvm.so /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/server/libjvm.so

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler2/fastdebug/libjvm.diz /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/server/libjvm.diz

rm -f /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/client/Xusage.txt.temp

sed 's/\(separated by \)[;:]/\1:/g' /usr/local/openjdk/hotspot/src/share/vm/Xusage.txt > /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/client/Xusage.txt.temp

mv /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/client/Xusage.txt.temp /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/client/Xusage.txt

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler1/fastdebug/libjvm.so /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/client/libjvm.so

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler1/fastdebug/libjvm.diz /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/client/libjvm.diz

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler2/fastdebug/libsaproc.so /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/libsaproc.so

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler1/generated/sa-jdi.jar /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/lib/sa-jdi.jar

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler2/fastdebug/libsaproc.diz /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/jre/lib/i386/libsaproc.diz

cp /usr/local/openjdk/hotspot/build/linux/linux_i486_compiler1/generated/jvmtifiles/jvmti.h /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/include/jvmti.h

cp /usr/local/openjdk/hotspot/src/share/vm/code/jvmticmlr.h /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/include/jvmticmlr.h

cp /usr/local/openjdk/hotspot/src/share/vm/prims/jni.h /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/include/jni.h

cp /usr/local/openjdk/hotspot/src/cpu/x86/vm/jni_x86.h /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/include/linux/jni_md.h

cp /usr/local/openjdk/hotspot/src/share/vm/services/jmm.h /usr/local/openjdk/hotspot/build/linux/export-linux-i586/fastdebug/include/jmm.h

make[1]: Leaving directory `/usr/local/openjdk/hotspot/make'


19:42:37 Build Finished (took 20m:17s.502ms)



-EOF-
日志格式 - Bob.Z - 断尘居
 文章作者:Bob.Z 编写时间:2014-11-16
 E-mail:zhaohevip@gmail.com 最后修正:2014-11-16
 申明:本文章版权完全断尘居博主所有,转载请在本文底部留言并注明本文链接。

  评论这张
 
阅读(1632)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017