Building libunwind for Mac
Asked Answered
N

2

2

I am trying to build libunwind on Mac for both iOS and Mac, I was able to resolve few of the compilation problem.

Building on Mac

I configured the project using

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

And copied elf.h from google's breakpad project.

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

I get the following error now:

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

Can anybody help me in solving this problem Or there is some other procedure for build libunwind?

I would also like to know if something else has to be done to build libunwind for iOS.

Nantucket answered 8/1, 2015 at 14:24 Comment(2)
Why not use built-in backtrace / backtrace_symbols ?Ers
Hey Steven, Thanks for taking time off to help me.Nantucket
N
1

I got an answer from libunwind developer forum.

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.

In short libunwind is not supported on Mac OS X.

Nantucket answered 9/1, 2015 at 3:34 Comment(3)
Can you post link to the forum? Is it about OSX (desktop), iOS (mobile) or both?Accompaniment
It is not available on both the platforms. This was the answer I received to the question I posted on the mailing thread. Apple has it's own version of libunwind (Apple's libunwind) available for mac os, but it does not provide most of the functionality provided by the libunwind.Nantucket
You can't just copy text from other people; you should give at least attribution. What was the mailing list? When you did? Author of post in comp.lib.unwind.devel was Lassi Tuura; comments.gmane.org/gmane.comp.lib.unwind.devel/2199 8 Jan 2015Accompaniment
I
5

libunwind is included in clang and it is supported from MacOS 10.6

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

Inviolable answered 5/11, 2019 at 9:48 Comment(1)
Beware that since it currently uses the private function _dyld_find_unwind_sections it will be rejected if you submit it to the App Store.Constringent
N
1

I got an answer from libunwind developer forum.

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.

In short libunwind is not supported on Mac OS X.

Nantucket answered 9/1, 2015 at 3:34 Comment(3)
Can you post link to the forum? Is it about OSX (desktop), iOS (mobile) or both?Accompaniment
It is not available on both the platforms. This was the answer I received to the question I posted on the mailing thread. Apple has it's own version of libunwind (Apple's libunwind) available for mac os, but it does not provide most of the functionality provided by the libunwind.Nantucket
You can't just copy text from other people; you should give at least attribution. What was the mailing list? When you did? Author of post in comp.lib.unwind.devel was Lassi Tuura; comments.gmane.org/gmane.comp.lib.unwind.devel/2199 8 Jan 2015Accompaniment

© 2022 - 2024 — McMap. All rights reserved.