为 Mac 构建 libunwind

Building libunwind for Mac

我正在尝试在 Mac 上为 iOS 和 Mac 构建 libunwind,我能够解决一些编译问题。

建立在Mac

之上

我使用

配置项目
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"

并从 Google 的 breakpad 项目复制 elf.h

https://google-breakpad.googlecode.com/svn-history/r1017/trunk/src/common/android/include/elf.h

我现在收到以下错误:

/usr/include/elf.h:58:15: fatal error: 'elf.h' file not found
#include_next <elf.h>

任何人都可以帮助我解决这个问题或者有一些其他的构建 libunwind 的程序吗?

我还想知道是否需要做其他事情来为 iOS 构建 libunwind。

我从 libunwind 开发者论坛得到了答案。

I don't think it will work. There's no OS X support in libunwind at the moment, 
and the platform is quite different.

There is a sort of a libunwind (which has little or nothing to do with this one) in the  
OS itself though. See http://opensource.apple.com/source/libunwind/

There's also some sort of symbolization library for post-processing. IIRC 
you more or less want to use the tools that ship with base OS or at least Xcode, 
otherwise you are up against writing quite a lot of tooling yourself.

简而言之,Mac OS X 不支持 libunwind。

libunwind 包含在 clang 中,MacOS 10.6 支持它

https://github.com/llvm/llvm-project/blob/368c02e3ec44e5418626f46abebcc22a69c7f66d/libunwind/include/libunwind.h