From 976c068935379c56f05cc88c9028b2e46e41ea06 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Wed, 30 Sep 2026 10:05:58 -0400 Subject: [PATCH] fix(ed25519): set a minimum OS when compiling the C sources for Apple compileEd25519C_* ran `xcrun -sdk clang -arch -O2 -c` with no -m*-version-min flag, so clang stamped each object with the SDK version as its minimum. In SharedCore 0.10.0 the nine ed25519 objects carry minos 18.5 (macOS 15.0) while the Kotlin/Native objects carry 14.0 (macOS 11.0). The iOS app and both notification extensions target 18.0, so each link emits one "built for newer 'iOS' version (18.5) than being linked (18.0)" warning per object: 21 in a cold iOS build. Pass the same minimums Kotlin/Native uses: iOS and simulator 14.0, macOS 11.0. --- libs/encryption/ed25519/build.gradle.kts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libs/encryption/ed25519/build.gradle.kts b/libs/encryption/ed25519/build.gradle.kts index 38a7c5cecb..b77ecbce3f 100644 --- a/libs/encryption/ed25519/build.gradle.kts +++ b/libs/encryption/ed25519/build.gradle.kts @@ -30,14 +30,18 @@ val ed25519CSources = fileTree(ed25519SrcDir) { // // Output: build/cinterop//libored25519.a -data class AppleTarget(val kotlinName: String, val sdk: String, val arch: String) +// Without a -m*-version-min flag clang stamps each object with the SDK's own +// version as its minimum, and every app linking the framework with a lower +// deployment target gets one ld warning per object. These match the minimums +// Kotlin/Native stamps on the rest of the framework. +data class AppleTarget(val kotlinName: String, val sdk: String, val arch: String, val minVersionFlag: String) val appleTargetDefs = listOf( - AppleTarget("iosArm64", "iphoneos", "arm64"), - AppleTarget("iosSimulatorArm64", "iphonesimulator", "arm64"), - AppleTarget("iosX64", "iphonesimulator", "x86_64"), - AppleTarget("macosArm64", "macosx", "arm64"), - AppleTarget("macosX64", "macosx", "x86_64"), + AppleTarget("iosArm64", "iphoneos", "arm64", "-mios-version-min=14.0"), + AppleTarget("iosSimulatorArm64", "iphonesimulator", "arm64", "-mios-simulator-version-min=14.0"), + AppleTarget("iosX64", "iphonesimulator", "x86_64", "-mios-simulator-version-min=14.0"), + AppleTarget("macosArm64", "macosx", "arm64", "-mmacosx-version-min=11.0"), + AppleTarget("macosX64", "macosx", "x86_64", "-mmacosx-version-min=11.0"), ) appleTargetDefs.forEach { target -> @@ -57,7 +61,7 @@ appleTargetDefs.forEach { target -> commandLine("sh", "-c", buildString { val compileLines = ed25519CSources.files.joinToString(" && ") { src -> val obj = outDir.get().file(src.nameWithoutExtension + ".o").asFile.absolutePath - "xcrun -sdk ${target.sdk} clang -arch ${target.arch} -O2" + + "xcrun -sdk ${target.sdk} clang -arch ${target.arch} ${target.minVersionFlag} -O2" + " -c \"${src.absolutePath}\"" + " -I\"${ed25519SrcDir.absolutePath}\"" + " -o \"$obj\""