博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
unrecognized command line option "-frame-pointer"解决方法
阅读量:2491 次
发布时间:2019-05-11

本文共 1267 字,大约阅读时间需要 4 分钟。

编译时出现unrecognized command line option "-frame-pointer"的解决办法(陈运文)

报这个错误是因为当前的环境变量不兼容引起的,正在编译的程序不支持编译优化选项-frame-pointer,
这个编译项项在CXXFLAGS这个环境变量中,运行
$echo CXXFLAGS
看看是否里面默认带了这个参数,如果编译遇到unrecognized command line的报错,则运行以下命令:
$CXXFLAGS=""
这时将CXXFLAGS清空,然后重新运行安装程序的 
./configure 
命令,生成环境变量
可以再运行
$echo CXXFLAGS
看看是否更改过来了
然后重新 ./make, 就可以编译通过了
下面补充一些-frame-pointer编译选项的知识:
GCC手册上面是这么说的:

Don't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions. It also makes debugging impossible on some machines.

On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist. The machine-description macro "FRAME_POINTER_REQUIRED" controls whether a target machine supports this flag.
这里,引入了一个"frame pointer"的概念,什么是"stack frame pointer(SFP)"呢?
我们知道,backtrace是利用堆栈中的信息把函数调用关系层层遍历出来的,其中这里的堆栈信息就是SFP。
一般情况下,每一个函数都包含一个堆栈边界指针,也就是说会存在一个栈底和栈顶指针。在X86下,假设堆栈由上往下发展,栈底大地址而栈顶小地址,那么,通常情况下,寄存器ESP为栈顶指针,而EBP就为栈底指针。而EBP和ESP之间的空间就是这个函数的stack frame。

GCC在默认情况下会在每个函数的开始加入一些堆栈设置代码,而在函数退出的时候恢复原来的样子,SFP就是在这个时候设置的。还是看一下这个时候的汇编代码吧 ;-)

转载地址:http://qnmrb.baihongyu.com/

你可能感兴趣的文章
ios设备唯一标识获取策略
查看>>
获取推送通知的DeviceToken
查看>>
Could not find a storyboard named 'Main' in bundle NSBundle
查看>>
CocoaPods安装和使用教程
查看>>
Beginning Auto Layout Tutorial
查看>>
block使用小结、在arc中使用block、如何防止循环引用
查看>>
iPhone开发学习笔记002——Xib设计UITableViewCell然后动态加载
查看>>
iOS开发中遇到的问题整理 (一)
查看>>
Swift code into Object-C 出现 ***-swift have not found this file 的问题
查看>>
为什么你的App介绍写得像一坨翔?
查看>>
RTImageAssets插件--@3x可自动生成@2x图片
查看>>
iOS开发的一些奇巧淫技
查看>>
常浏览的博客和网站
查看>>
Xcode 工程文件打开不出来, cannot be opened because the project file cannot be parsed.
查看>>
iOS在Xcode6中怎么创建OC category文件
查看>>
5、JavaWeb学习之基础篇—标签(自定义&JSTL)
查看>>
8、JavaWEB学习之基础篇—文件上传&下载
查看>>
reRender属性的使用
查看>>
href="javascript:void(0)"
查看>>
h:panelGrid、h:panelGroup标签学习
查看>>