我试图在我的实验室中运行RHEL6.6服务器版本的计算机上更新GCC。运行' make'后,我一直收到错误。命令。以下是一些代码:
/usr/bin/ld: /usr/local/GCC-5.1.0/gcc-build/./gmp/.libs /libgmp.a(mp_set_fns.o): relocation R_X86_64_32 against `__gmp_default_allocate' can not be used when making a shared object; recompile with -fPIC
/usr/local/GCC-5.1.0/gcc-build/./gmp/.libs/libgmp.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[6]: *** [libjavamath.la] Error 1
make[6]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native/jni/java-math'
make[6]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native/jni'
/bin/sh ../../scripts/check_jni_methods.sh
make[6]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native/jni'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native/jni'
make[5]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/native'
Making all in resource
make[4]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/resource'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/resource'
Making all in scripts
make[4]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/scripts'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/scripts'
Making all in tools
make[4]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/tools'
make all-am
make[5]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/tools'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/tools'
make[4]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath/tools'
make[4]: Entering directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath'
true DO=all multi-do # make
make[4]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava/classpath'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build/x86_64-unknown-linux-gnu/libjava'
make[1]: *** [all-target-libjava] Error 2
make[1]: Leaving directory `/usr/local/GCC-5.1.0/gcc-build'
make: *** [all] Error 2
我在这里看到另一个问题,其中两个海报的错误与我的错误相同,答案是在texinfo包中安装makeinfo。我安装了该软件包,上面的代码是我在运行' make'之后收到的代码。命令再次。
我不确定libjavamath.la是什么错误,但我认为它是我需要的文件才能完成制作。'另一个错误是全递归的,我不知道它可能意味着什么。
答案 0 :(得分:2)
按照https://gcc.gnu.org/wiki/InstallingGCC上的简单说明进行操作,除非您确实需要Java编译器,否则应使用--enable-languages=c,c++,fortran
(或 所需的任何语言集,不使用Java)进行配置
libjavamath.la是作为GCJ Java编译器的一部分构建的库,但如果您不关心使用GCJ,那么您可以(并且恕我直言)在没有它的情况下配置GCC。这将解决构建libjavamath.la时发生的任何问题,因为它不会被构建。
答案 1 :(得分:-2)
我配置为: ./configure --disable-shared --enable-languages = all --enable-threads = posix --enable-libgomp --enable -lto --enable-tls --with-fpmath = sse --disable-multilib - -build = x86_64-redhat-linux --with-system-zlib --enable-gnu-unique-object --with-mpc = / usr / local / --with-java-home = / usr / java / jdk1。 7.0_79 / --enable-java-awt = gtk --enable -__ cxa_atexit
你应该试试。