简体   繁体   English

为什么Apple的Clang(来自Xcode 5)将typeinfos设置为arm64的private_extern?

[英]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位运行时。

  • Xcode can create both 64bit 32bit binaries for a single app but the deployment target should be iOS7. Xcode可以为一个应用程序创建两个64位32位二进制文​​件,但部署目标应为iOS7。
  • They are saying in future it will be iOS 6.0 32 bit binary will work fine in iPhone 5S(64 bit processor). 他们说,将来它将在iPhone 5S(64位处理器)上正常运行iOS 6.0 32位二进制文​​件。

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.

相关问题 为什么我在 Apple Silicon 上编译的本机应用程序有时构建为 arm64,有时构建为 x86_64? - Why does my native application compiled on Apple Silicon sometimes build as arm64 and sometimes build as x86_64? 适用于arm64 iPhone的Xcode 5编译失败 - xcode 5 compile for arm64 iPhone failed 为 x86_64 构建但从自制软件安装的 glfw 是为 arm64 (aarch64) - Make building for x86_64 but glfw installed from homebrew is for arm64 (aarch64) C++ 错误:ld:未找到体系结构 arm64 的符号 clang:错误:链接器命令失败,退出代码为 1 - C++ Error: ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 xcode体系结构宏,用于检测arm64或armv7 - xcode architectures macro for detecting arm64 or armv7 Protobuf,ld:找不到体系结构 arm64 的符号 - Protobuf, ld: symbol(s) not found for architecture arm64 STLR(B) 是否在 ARM64 上提供顺序一致性? - Does STLR(B) provide sequential consistency on ARM64? boost :: context for arm64吗? - boost::context for arm64? ARM64上的多播“没有这样的设备”? - Multicast 'no such device' on ARM64? 如果仅针对armv7和armv7s编译应用程序,则在arm64设备上运行时会使用什么大小的数据类型? - If app is compiled only for armv7 and armv7s, what size data types does it use when running on an arm64 device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM