gcc编译器无法识别-fno-plt选项 [英] gcc compiler not recognizing -fno-plt option

查看:476
本文介绍了gcc编译器无法识别-fno-plt选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Amazon Linux AMI在Amazon EC2实例上编译QuantLib Python SWIG绑定.我已经成功地成功编译了QuantLib本身,但是,当尝试编译anaconda python swig绑定时,-fno-plt选项出现错误.我已经将gcc编译器版本升级到5.4.0,最初是4.8

I am trying to compile QuantLib Python SWIG bindings on Amazon's EC2 instance with Amazon Linux AMI. I have managed to compile QuantLib itself successfully, however, when trying to compile anaconda python swig bindings, I am getting an error with -fno-plt option. I have upgraded the gcc compiler version to 5.4.0, originally it was 4.8

首先,我进行如下配置:

First I configure as below:

sudo ./configure --disable-perl --disable-ruby --disable-mzscheme --disable-guile --disable-csharp --disable-ocaml --disable-r --disable-java  PYTHON=/opt/anaconda/anaconda2/bin/python

然后我进行如下操作:

make -C Python

我收到错误消息:

make: Entering directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'
make  all-am

make[1]: Entering directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'
CXXFLAGS="-O3 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings" CC="gcc" CXX="g++" /opt/anaconda/anaconda2/bin/python setup.py build

running build

running build_py

running build_ext

building 'QuantLib._QuantLib' extension

gcc -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda/anaconda2/include/python2.7 -I/usr/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.linux-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused -O3 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings

gcc: error: unrecognized command line option ‘-fno-plt’

error: command 'gcc' failed with exit status 1

make[1]: *** [.build-stamp] Error 1

make[1]: Leaving directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'

make: *** [all] Error 2

make: Leaving directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'

我对此很陌生,不知道在编译时是否可以删除-fno-plt选项,如果可以,怎么办?

I am very new to this and do not know if I can remove -fno-plt option when compiling and if yes, how?

推荐答案

您需要升级GCC版本.

You need to upgrade your GCC version.

GCC 6的更改日志页面说:

-fno-plt选项现在可以正常使用.

The option -fno-plt is now fully functional.

因此,您可以从GCC 6使用它.

Thus, from GCC 6 you can use it.

这篇关于gcc编译器无法识别-fno-plt选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆