首页
学习
活动
专区
圈层
工具
发布

gcc 4.8.5
EN

Stack Overflow用户
提问于 2018-01-05 12:54:05
回答 1查看 4.8K关注 0票数 0

我试着在红帽6下编译gcc 4.8.5。这是我的程序:

代码语言:javascript
复制
tar -xvzf archive.tar.gz

cd gcc-4.8.5

./configure --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=fortran,c --prefix=/opt/gcc4.8.5

make

然后,我得到以下错误:

代码语言:javascript
复制
make  all-am
make[4]: Entering directory `/app/gfortran_build/gcc-4.8.5/host-x86_64-unknown-linux-gnu/lto-plugin'
/bin/sh ./libtool --tag=CC --tag=disable-static  --mode=link gcc -Wall -g  -module -bindir /opt/gcc4.8.5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5   -o 
liblto_plugin.la -rpath /opt/gcc4.8.5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5 lto-plugin.lo -Wc,../libiberty/pic/libiberty.a
libtool: link: gcc -shared  .libs/lto-plugin.o    ../libiberty/pic/libiberty.a   -Wl,-soname -Wl,liblto_plugin.so.0 -o .libs/liblto_plugin.so.0.0.0
/usr/bin/ld: ../libiberty/pic/libiberty.a(simple-object-coff.o): relocation R_X86_64_PC32 against undefined symbol `simple_object_set_big_16' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

我已经读过关于CFLAGS的文章了,但是我不会让它开始工作。

亲切问候

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-11 09:14:37

它与以下方面合作:

代码语言:javascript
复制
../gcc-4.8.5/configure CC="/opt/gcc4.5/bin/gcc" --prefix=/opt/gcc4.8.5 --enable-languages=c,c++,fortran --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object

有趣的是CC=..。

安装的gcc版本为4.4.使用此版本,编译将失败。

亲切问候

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48114087

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档