From c10438d264b37bdda7e8aea4ab392b8e6c7abeca Mon Sep 17 00:00:00 2001 From: Khronos31 <39792509+Khronos31@users.noreply.github.com> Date: Sat, 5 Sep 2026 05:29:41 +0900 Subject: [PATCH] Use .dylib for the iOS dynamic library extension (#26171) `--app:lib` currently produces an ELF-style name when targeting iOS: ```console $ nim c --app:lib --os:macosx --cpu:arm64 mylib.nim # -> libmylib.dylib $ nim c --app:lib --os:ios --cpu:arm64 mylib.nim # -> libmylib.so ``` iOS is Darwin: its shared libraries are Mach-O `.dylib`, loaded by the same dyld as on macOS. `compiler/platform.nim` already encodes this for the `MacOSX` entry (`lib$1.dylib`); the `iOS` entry is the only Darwin row still carrying the ELF name, so the same source yields a differently named artifact depending on which Apple platform it is built for. --- changelog.md | 3 +++ compiler/platform.nim | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index dc1cf67111..942441d06f 100644 --- a/changelog.md +++ b/changelog.md @@ -164,6 +164,9 @@ parameter and result types, not just their source-level shape. Use arrays slice via a `{base, off, len}` view. This also covers seq/non-numeric-array write-through, pass-through, re-slicing and `@` (openArray-to-seq) of such views. +- On `--os:ios`, the default file name for `--app:lib` is now `libfoo.dylib` + instead of `libfoo.so`, matching `--os:macosx` and the Darwin convention. + ## Tool changes - Added `--raw` flag when generating JSON docs to not render markup. diff --git a/compiler/platform.nim b/compiler/platform.nim index 62c8e3e90f..5d467b96c8 100644 --- a/compiler/platform.nim +++ b/compiler/platform.nim @@ -148,7 +148,7 @@ const objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}), - (name: "iOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", + (name: "iOS", parDir: "..", dllFrmt: "lib$1.dylib", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}),