2

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

在 Mac 上构建

我使用

./configure CC="cc -Ae -D_XOPEN_SOURCE=500"

elf.h从 google 的 breakpad 项目中复制。

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。

4

2 回答 2

3

libunwind 包含在 clang 中,并且从 MacOS 10.6 开始支持

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

于 2019-11-05T09:48:34.183 回答
1

我从 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。

于 2015-01-09T03:34:29.500 回答