最近由于工作的需要,重新弄起arm-linux-gcc编译。离上一次弄这些有整整10年了。
我是在一台64位的机器上实机安装的 centos7 发行版,系统和交叉编译器的安装过程自是没话说,问题出在使用arm-linux-gcc编译
arm程序时,
$ arm-linux-gcc main.c
/opt/FriendlyARM/toolschain/4.4.3/libexec/gcc/arm-none-linux-gnueabi/4.4.3/cc1: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
提示找不到库文件 libstdc++.so.6 , 在确定系统里确实没有该文件,且环境变量正常的情况下,决定安装之
sudo yum install libstdc++.so.6 , 不料出现以下情况:
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: centos.cs.nctu.edu.tw
* nux-dextop: li.nux.ro
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 libstdc++.i686.0.4.8.5-28.el7_5.1 将被 安装
--> 正在处理依赖关系 libgcc_s.so.1(GLIBC_2.0),它被软件包 libstdc++-4.8.5-28.el7_5.1.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1(GCC_4.2.0),它被软件包 libstdc++-4.8.5-28.el7_5.1.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1(GCC_3.3),它被软件包 libstdc++-4.8.5-28.el7_5.1.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1(GCC_3.0),它被软件包 libstdc++-4.8.5-28.el7_5.1.i686 需要
--> 正在处理依赖关系 libgcc_s.so.1,它被软件包 libstdc++-4.8.5-28.el7_5.1.i686 需要
--> 正在检查事务
---> 软件包 libgcc.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 libgcc.i686.0.4.8.5-28.el7_5.1 将被 安装
---> 软件包 libgcc.x86_64.0.4.8.5-28.el7_5.1 将被 更新
--> 解决依赖关系完成
错误: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libstdc++ which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libstdc++ of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libstdc++.otherarch ... this should give you an error
message showing the root cause of the problem.
2. You have multiple architectures of libstdc++ installed, but
yum can only see an upgrade for one of those architectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.
3. You have duplicate versions of libstdc++ installed already.
You can use "yum check" to get yum show these errors.
...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).
保护多库版本:libstdc++-4.8.5-28.el7_5.1.i686 != libstdc++-4.8.5-28.el7.x86_64
大意是:在安装32位的库的同时也在更新64位的库,所以出现了多库版本问题。
在网上搜同样的问题,得到的资料提示要分开安装和更新。
好吧,先更新64位的库:
sudo yum update libstdc++-4.8.5-28.el7.x86_64
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: centos.communilink.net
* nux-dextop: li.nux.ro
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 libstdc++.x86_64.0.4.8.5-28.el7 将被 升级
--> 正在处理依赖关系 libstdc++ = 4.8.5-28.el7,它被软件包 gcc-c++-4.8.5-28.el7.x86_64 需要
--> 正在处理依赖关系 libstdc++(x86-64) = 4.8.5-28.el7,它被软件包 libstdc++-devel-4.8.5-28.el7.x86_64 需要
---> 软件包 libstdc++.x86_64.0.4.8.5-28.el7_5.1 将被 更新
--> 正在检查事务
---> 软件包 gcc-c++.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 gcc-c++.x86_64.0.4.8.5-28.el7_5.1 将被 更新
--> 正在处理依赖关系 gcc = 4.8.5-28.el7_5.1,它被软件包 gcc-c++-4.8.5-28.el7_5.1.x86_64 需要
---> 软件包 libstdc++-devel.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 libstdc++-devel.x86_64.0.4.8.5-28.el7_5.1 将被 更新
--> 正在检查事务
---> 软件包 gcc.x86_64.0.4.8.5-28.el7 将被 升级
--> 正在处理依赖关系 gcc = 4.8.5-28.el7,它被软件包 libquadmath-devel-4.8.5-28.el7.x86_64 需要
--> 正在处理依赖关系 gcc = 4.8.5-28.el7,它被软件包 gcc-gfortran-4.8.5-28.el7.x86_64 需要
---> 软件包 gcc.x86_64.0.4.8.5-28.el7_5.1 将被 更新
--> 正在处理依赖关系 libgomp = 4.8.5-28.el7_5.1,它被软件包 gcc-4.8.5-28.el7_5.1.x86_64 需要
--> 正在处理依赖关系 cpp = 4.8.5-28.el7_5.1,它被软件包 gcc-4.8.5-28.el7_5.1.x86_64 需要
--> 正在处理依赖关系 libgcc >= 4.8.5-28.el7_5.1,它被软件包 gcc-4.8.5-28.el7_5.1.x86_64 需要
--> 正在检查事务
---> 软件包 cpp.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 cpp.x86_64.0.4.8.5-28.el7_5.1 将被 更新
---> 软件包 gcc-gfortran.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 gcc-gfortran.x86_64.0.4.8.5-28.el7_5.1 将被 更新
--> 正在处理依赖关系 libquadmath = 4.8.5-28.el7_5.1,它被软件包 gcc-gfortran-4.8.5-28.el7_5.1.x86_64 需要
--> 正在处理依赖关系 libgfortran = 4.8.5-28.el7_5.1,它被软件包 gcc-gfortran-4.8.5-28.el7_5.1.x86_64 需要
---> 软件包 libgcc.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 libgcc.x86_64.0.4.8.5-28.el7_5.1 将被 更新
---> 软件包 libgomp.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 libgomp.x86_64.0.4.8.5-28.el7_5.1 将被 更新
---> 软件包 libquadmath-devel.x86_64.0.4.8.5-28.el7 将被 升级
---> 软件包 libquadmath-devel.x86_64.0.4.8.5-28.e