需要GLibc优化 [英] GLibc optimizations required

查看:425
本文介绍了需要GLibc优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不可能重新编译GLibc关闭所有的优化(即-O0)?



特别是在这样做:

  make CFLAGS =' -  O0 -w'CXXFLAGS =' -  O0 -w'

我得到:

  #errorglibc无法编译而没有优化


解决方案

如果您从字面上看只是Google的错误, a href =http://devpit.org/wiki/Gnu_Toolchain/Compatibility_Matrix#endnote_ODonell_and_Drepper_on_Inline =noreferrer>告诉你究竟是为什么。


在动态加载器( _dl_start )的早期启动中,在PLT的
重定位之前,不能进行函数调用。必须内联
在早期启动时使用的函数或调用编译器
内置函数( __ builtin _ * )。

未启用优化GCC不会内联函数。动态加载器的早期
启动将通过
未重新定位的PLT进行函数调用并崩溃。 - Carlos O'Donell



Why is it not possible recompile GLibc turning off all the optimizations (i.e., -O0)?

Particularly in doing this:

make CFLAGS='-O0 -w' CXXFLAGS='-O0 -w'

I get:

 #error "glibc cannot be compiled without optimization"

解决方案

If you literally just Google the error, the first result tells you exactly why.

"In the early startup of the dynamic loader (_dl_start), before relocation of the PLT, you cannot make function calls. You must inline the functions you will use during early startup, or call compiler builtins (__builtin_*).

Without optimizations enabled GCC will not inline functions. The early startup of the dynamic loader will make function calls via an unrelocated PLT and crash." -- Carlos O'Donell

这篇关于需要GLibc优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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