| 8 Dec 2025 |
Ihar Hrachyshka | ack on obsolete linker, I didn't know of the difference. if that's the case then I think we should patch to something like 0.0.0001 or perhaps 0.0.<last-working-version> until linker is updated. | 17:40:49 |
Randy Eckenrode | I do have as a goal for 26.05 to have pure LLVM bintools on Darwin. | 17:41:22 |
Randy Eckenrode | The few things that need other tools can add them. | 17:41:37 |
Randy Eckenrode | Ideally, no cctools or ld64 in the bootstrap, but that may not be possible. | 17:42:49 |
emily | https://github.com/ggml-org/llama.cpp/blob/bde188d60f58012ada0725c6dd5ba7c69fe4dd87/src/CMakeLists.txt#L140 is the relevant line, fwiw | 17:43:22 |
emily | we could probably just drop that on Darwin for now | 17:43:36 |
emily | I'm guessing nothing really cares about the version | 17:43:43 |
emily | maybe we should check whether LLD can handle this, though 🤔 | 17:43:58 |
Randy Eckenrode | That line will set the current version in the dylib. | 17:43:58 |
emily | we could always use LLD here if so | 17:44:05 |
emily | (maybe not, I guess wrapping is a question) | 17:44:16 |
emily | shion:/v/f/1/j/T/tmp.gRxduPvwNI
❭ clang -shared foo.c -current_version 0.0.7299 -o libfoo.dylib
foo.c:1:9: warning: non-void function does not return a value [-Wreturn-type]
1 | int a(){}
| ^
1 warning generated.
ld: warning: truncating -dylib_current_version to fit in 32-bit space used by old mach-o format
uh, that's fun :D
| 17:46:30 |
Ihar Hrachyshka | what's "old mach-o" and is there a "new" one... | 17:47:43 |
emily | someone should check whether the Xcode toolchain is truncating it too | 17:48:18 |
emily | shion:/v/f/1/j/T/tmp.gRxduPvwNI
❭ otool -l libfoo.dylib | rg -A 5 LC_ID_DYLIB
cmd LC_ID_DYLIB
cmdsize 40
name libfoo.dylib (offset 24)
time stamp 1 Thu Jan 1 01:00:01 1970
current version 0.0.255
compatibility version 0.0.0
| 17:48:20 |
emily | oh they have official binaries. how convenient | 17:48:52 |
emily | hehe | 17:49:17 |
emily | shion:~/Downloads/llama-b7325
❭ otool -l libllama.0.0.7325.dylib | rg -A 5 LC_ID_DYLIB
cmd LC_ID_DYLIB
cmdsize 48
name @rpath/libllama.0.dylib (offset 24)
time stamp 1 Thu Jan 1 01:00:01 1970
current version 0.0.255
compatibility version 0.0.0
| 17:49:19 |
Ihar Hrachyshka | oh | 17:49:48 |
emily | so the version in their library has been getting truncated for approximately the past 100 years. | 17:49:55 |
emily | the only difference is… | 17:50:15 |
Ihar Hrachyshka | we can set it to 255 then and forget about it 😎 | 17:50:26 |
emily | ld64 barfs on 0.0.7299 and ld-prime accepts it | 17:50:28 |
emily | but 0.0.256 truncates to 0.0.255 with both | 17:50:34 |
emily | yes, but only in https://github.com/ggml-org/llama.cpp/blob/bde188d60f58012ada0725c6dd5ba7c69fe4dd87/src/CMakeLists.txt#L140 and similar, please, not the actual version variable | 17:51:01 |
emily | since LLAMA_INSTALL_VERSION is used elsewhere | 17:51:03 |
emily | https://github.com/search?q=repo%3Aggml-org%2Fllama.cpp%20LLAMA_INSTALL_VERSION&type=code | 17:51:17 |
emily | substituteInPlace src/CMakeLists.txt \
--replace-fail 'VERSION ${LLAMA_INSTALL_VERSION}' 'VERSION 0.0.255'
substituteInPlace tools/mtmd/CMakeLists.txt \
--replace-fail 'VERSION ${LLAMA_INSTALL_VERSION}' 'VERSION 0.0.255'
only on Darwin
| 17:51:57 |
emily | but, yes, it would actually be best to fix this upstream then | 17:52:06 |
emily | since their version is just useless | 17:52:10 |