繁体   English   中英

我在Solaris 10 SPARC中编译的GNU GCC 9无法正常工作

[英]My compiled GNU GCC 9 in Solaris 10 SPARC is not working

我已成功将GNU GCC-9.1.0成功编译到我的Sun / Oracle SPARC服务器上的Solaris 10 SPARC版OS中。 但是,我不得不将libgmp.so,libmfr.so和libmpc.so的静态库文件复制到在“ gmake”过程中创建的以下目录gcc-9.1.0 / host-sparc-sun-solaris2.10 / gcc gcc-9.1.0 / host-sparc-sun-solaris2.10 / prev-gcc

现在,当我尝试使用'./configure'命令配置包含C代码源文件的任何tarball归档文件时,我遇到了一个问题。 当我输入'./configure'时,我收到一条错误消息,提示'C编译器不起作用,有关详细信息,请参见config.log文件。 我已将生成的相关config.log文件上传到以下URL。 它提到缺少名为'libmpc.so.3的静态库文件,但是该库文件位于/ usr / local / lib目录中。 我该如何解决这种情况。 我将不胜感激

configure:2912: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/sparc-sun-solaris2.10/9.1.0/lto-wrapper
Target: sparc-sun-solaris2.10
Configured with: ./configure --enable-obsolete --with-gmp-lib=/usr/local/lib --with-mpfr-lib=/usr/local/lib --with-mpc-lib=/usr/local/lib
...[snip]...
configure:2975: gcc    conftest.c  >&5
ld.so.1: cc1: fatal: libmpc.so.3: open failed: No such file or directory
gcc: fatal error: Killed signal terminated program cc1
compilation terminated.
configure:2978: $? = 1
configure:3016: result: 
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3023: error: C compiler cannot create executables

(完整的config.log位于http://tab140.freewebspace.com/config-gcc9.txt

cc1 (编译器的适当可执行文件)取决于动态libmpc.so.3库。

看到

ldd `gcc --print-file-name cc1`

它应该显示未找到mpc和其他库。 这是因为/usr/local/lib不在您的运行时共享库​​路径中,因此您有责任确保它位于。 一种选择是暂时将其放置在此处:尝试

LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ldd `gcc --print-file-name cc1`  

如果“未找到”消息在第二输出走了,你可以前缀所有涉及的调用命令gcc (如./configuregmake带等) LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH 或者,您可以export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ,但这仍然仅对当前的shell会话有效。 要使更改永久生效,可以将export命令添加到您的配置文件中(例如bash的~/.bashrc文件,我不知道您使用的是什么shell)。


GCC有一个安装手册 ,其中记录了--with-mpc-lib选项:

'--with-gmp=PATHNAME'
'--with-gmp-include=PATHNAME'
'--with-gmp-lib=PATHNAME'
'--with-mpfr=PATHNAME'
'--with-mpfr-include=PATHNAME'
'--with-mpfr-lib=PATHNAME'
'--with-mpc=PATHNAME'
'--with-mpc-include=PATHNAME'
'--with-mpc-lib=PATHNAME'
     If you want to build GCC but do not have the GMP library, the MPFR
     library and/or the MPC library installed in a standard location and
     do not have their sources present in the GCC source tree then you
     can explicitly specify the directory where they are installed
     ('--with-gmp=GMPINSTALLDIR', '--with-mpfr=MPFRINSTALLDIR',
     '--with-mpc=MPCINSTALLDIR').  The '--with-gmp=GMPINSTALLDIR' option
     is shorthand for '--with-gmp-lib=GMPINSTALLDIR/lib' and
     '--with-gmp-include=GMPINSTALLDIR/include'.  Likewise the
     '--with-mpfr=MPFRINSTALLDIR' option is shorthand for
     '--with-mpfr-lib=MPFRINSTALLDIR/lib' and
     '--with-mpfr-include=MPFRINSTALLDIR/include', also the
     '--with-mpc=MPCINSTALLDIR' option is shorthand for
     '--with-mpc-lib=MPCINSTALLDIR/lib' and
     '--with-mpc-include=MPCINSTALLDIR/include'.  If these shorthand
     assumptions are not correct, you can use the explicit include and
     lib options directly.  You might also need to ensure the shared
     libraries can be found by the dynamic linker when building and
     using GCC, for example by setting the runtime shared library path
     variable ('LD_LIBRARY_PATH' on GNU/Linux and Solaris systems).

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM