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.
This commit is contained in:
Khronos31
2026-09-05 05:29:41 +09:00
committed by GitHub
parent 641243b70e
commit c10438d264
2 changed files with 4 additions and 1 deletions

View File

@@ -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.

View File

@@ -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}),