[英]Why does Apple's Clang (from Xcode 5) make typeinfos private_extern for arm64?
If you compile this file p3.cxx: 如果编译此文件p3.cxx:
class foobarclass
{
public:
int i0;
};
void otherfun(void);
void mumble(void);
void fun(void)
{
try {
otherfun();
} catch(foobarclass &e) {
mumble();
}
}
Like this: 像这样:
xcrun clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -fexceptions -c p3.cxx -p3.64.o
and 和
xcrun clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -fexceptions -c p3.cxx -o p3.32.o
and then check the symbol of the "typeinfo for foobarclass": 然后检查“ foobarclass的typeinfo”的符号:
nm -m p3.64.o|grep ZTI
0000000000000110 (__DATA,__datacoal_nt) weak private external __ZTI11foobarclass
nm -m p3.32.o|grep ZTI
00000134 (__DATA,__datacoal_nt) weak external __ZTI11foobarclass
Why is the symbol weak private external in the arm64 case? 为什么在arm64机箱中符号弱私有外部? This means dlsym() won't find it at run-time.
这意味着dlsym()在运行时找不到。 This breaks certain low-level stuff in the LibreOffice codebase.
这会破坏LibreOffice代码库中的某些低级内容。
I asked the same question in the relevant Apple Developer forum, and got the reply that this is intentional, to reduce the number of globally visible symbols in an executable. 我在相关的Apple Developer论坛上提出了相同的问题,并得到了有意答复,以减少可执行文件中全局可见的符号的数量。 So I will just have to live with it.
因此,我将不得不忍受它。
Set the architecture in build setting to Standard architectures(armv7,armv7s) 将构建设置中的体系结构设置为标准体系结构(armv7,armv7s)
ARCHS = **armv7 armv7s**
VALID_ARCHS = **armv6 armv7 armv7s**
Xcode can build your app with both 32-bit and 64-bit binaries included.
Xcode可以同时包含32位和64位二进制文件来构建您的应用程序。 This combined binary requires a minimum deployment target of iOS 7 or later.
此组合二进制文件要求iOS 7或更高版本的最低部署目标。
Note: A future version of Xcode will let you create a single app that supports the 32-bit runtime on iOS 6 and later, and that supports the 64-bit runtime on iOS 7.
注意:将来的Xcode版本将允许您创建一个应用程序,该应用程序在iOS 6和更高版本上支持32位运行时,并在iOS 7上支持64位运行时。
Update In Xcode 5.0.1 they added the support to create 64 bit binary for iOS 5.1.1 onwards. 更新在Xcode 5.0.1中,他们添加了对iOS 5.1.1及更高版本创建64位二进制文件的支持。
Xcode 5.0.1 can build your app with both 32-bit and 64-bit binaries included.
Xcode 5.0.1可以同时包含32位和64位二进制文件来构建您的应用程序。 This combined binary requires a minimum deployment target of iOS 5.1.1 or later.
此组合二进制文件要求iOS 5.1.1或更高版本的最低部署目标。 The 64-bit binary runs only on 64-bit devices running iOS 7.0.3 and later.
64位二进制文件仅在运行iOS 7.0.3及更高版本的64位设备上运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.