Hello,
have found a weird behaviour of compiler when targeting arm64-apple-ios12, OBJC_CLASS data is not being generated for classes that includes members from high ios versions.
Minimal code to reproduce:
import Foundation
import StoreKit
@available(iOS 15.0, *)
@objc(RvmProduct_PurchaseOption) public class RvmProduct_PurchaseOption: NSObject {
let raw: Product.PurchaseOption
init(raw: Product.PurchaseOption) {
self.raw = raw
}
}
and command lines to check:
swiftc -c test.swift -sdk `xcrun --sdk iphoneos --show-sdk-path` -target arm64-apple-ios12 -o arm64-iphone-12.o
swiftc -c test.swift -sdk `xcrun --sdk iphoneos --show-sdk-path` -target arm64-apple-ios13 -o arm64-iphone-13.o
swiftc -c test.swift -sdk `xcrun --sdk iphonesimulator --show-sdk-path` -target arm64-apple-ios12.0-simulator -o arm64-sim.o
nm ./arm64-iphone-12.o | grep _OBJC_CLASS_
nm ./arm64-iphone-13.o | grep _OBJC_CLASS_
U _OBJC_CLASS_$_NSObject
0000000000001758 S _OBJC_CLASS_$_RvmProduct_PurchaseOption
nm ./arm64-sim.o | grep _OBJC_CLASS_
U _OBJC_CLASS_$_NSObject
0000000000001728 S _OBJC_CLASS_$_RvmProduct_PurchaseOption
-target arm64-apple-ios12.0-simulator
, -target arm64-apple-ios13
produce objc class data. but -target arm64-apple-ios12
– doesn’t.
Environment: XCode 16.4 & Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Anything specific I miss here ?
Thank you