Linker errors while building Objective-C++ porject with Xcode 9
Originator: | matej | ||
Number: | rdar://32664169 | Date Originated: | 08-Jun-2017 06:28 PM |
Status: | Closed | Resolved: | |
Product: | Developer Tools | Product Version: | Xcode Version 9.0 beta (9M136h) |
Classification: | Serious Bug | Reproducible: | Always |
Summary: Building a project that uses C++ with Xcode 9, results in “ld: symbol(s) not found for architecture armv7” errors. This issue only occurs during release builds. We observed the issue in our framework (PSPDFKit) and could also reproduce it in an isolated sample project. Steps to Reproduce: Open the provided C++Test project. Use the Xcode Archive action to build a release build of the application. Expected Results: The application should build without any linked errors. Actual Results: The following linker error occurs: Undefined symbols for architecture armv7: "operator new(unsigned long, std::align_val_t)", referenced from: triggerStuff() in Test.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) Version: Xcode Version 9.0 beta (9M136h) Notes: Limiting the application to arm64 works around the issue, but is obviously not a viable workaround: <key>UIRequiredDeviceCapabilities</key> <array> <string>arm64</string>
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Fixed
This is fixed in Xcode 9.3 beta. The feature is marked as unavailable for iOS versions prior to iOS 11 and compilation now succeeds for iOS 11+ deployment targets.
Sample project
https://cloudup.com/ik2-nM3VGR8