Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win下编译anroid armv7-a默认未链接unwind,导致程序无法捕获C++异常 #608

Closed
fasiondog opened this issue Oct 28, 2019 · 12 comments
Milestone

Comments

@fasiondog
Copy link
Contributor

Win下编译 android armv7-a 使用c++_static时(linux没试验),由于默认未链接 libunwind.a,将导致C++程序中的try catch 无法捕获异常直接退出。

android C++异常无法捕获导致程序退出的问题之前挺多,这个可参考:
android/ndk#289

android ndk 应该是更改了编译脚本,默认在c++_static + armv7-a时,自动链接 libunwind.a 和 libatomic.a 两个库。可以参考 NDK 目录下(ndk-bundle\sources\cxx-stl\llvm-libc++\libs\armeabi-v7a)的相关 libc++.a.xx 文件,如 libc++.a.29内容如下:
INPUT(-lc++_static -lc++abi -lunwind -latomic)

@waruqi
Copy link
Member

waruqi commented Oct 28, 2019

好的,我回头看下

@waruqi waruqi added this to the v2.2.9 milestone Oct 28, 2019
@waruqi
Copy link
Member

waruqi commented Oct 28, 2019

我github上更新了,可以试试: xmake update -s github:xmake-io#dev 其他镜像还没更新。

@fasiondog
Copy link
Contributor Author

好,明天试下

@fasiondog
Copy link
Contributor Author

图片

@waruqi
Copy link
Member

waruqi commented Oct 29, 2019

你网络的问题的吧,github访问不到? 不过我所有mirror都更新了,你直接 xmake update -s dev就好了。会自动拉取gitee的。。

@OpportunityLiu
Copy link
Member

命令输错了吧。。。github:xmake-io/xmake#dev

@waruqi
Copy link
Member

waruqi commented Oct 29, 2019

哦 我敲错了 = =

@fasiondog
Copy link
Contributor Author

不清楚是不是网络,但git我可以访问。明天再试下。

@fasiondog
Copy link
Contributor Author

OK,可以

@fasiondog
Copy link
Contributor Author

这个只有在32位的arm里加,64位的不能加,现在64位的编译失败了,找不unwind库

@fasiondog fasiondog reopened this Oct 30, 2019
@waruqi
Copy link
Member

waruqi commented Oct 30, 2019

你再更新下dev脚本试试

@fasiondog
Copy link
Contributor Author

可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants