Nix Cross Compiling | 559 Members | |
| 121 Servers |
| Sender | Message | Time |
|---|---|---|
| 30 Nov 2025 | ||
I just managed to get ld64 from cctools-port to build. What's wrong with that? | 22:23:03 | |
libtapi doesn't look like great code either, but I'd avoid frontloading rewriting code in order to be able to cross-compile for macOS. | 22:26:56 | |
| 1 Dec 2025 | ||
| 14:57:37 | ||
| LTO doesn’t work, and it uses It also historically lagged behind Apple’s releases, but I think they got better about that. | 15:56:23 | |
| Darwin used to use cctools-port, but it moved away from it due to the LTO and update issue. The code-signing problem was discovered later. | 15:57:18 | |
| Darwin also mostly doesn’t use cctools anymore. For 26.06, I plan to drop it completely from the Darwin bintools. It will just be LLVM bintools. | 15:58:10 | |
| https://github.com/reckenrode/ld64 is the fork of ld64 that nixpkgs uses. https://github.com/reckenrode/ld64/tree/ld64-954.16-nixpkgs is the source of the patches. | 15:58:56 | |
| Note that libtapi is still packaged even though ld64 vendors a reduced version. | 16:00:13 | |
| My recommendation though would be to use LLVM’s bintools and LLD. | 16:00:33 | |
I see, these don't seem to be dealbreaker to start getting some stuff to cross-compile though. If you intend to have a drop-in replacement, it can be adopted.
Does this mean adopting | 16:01:16 | |
*
I see, these don't seem to be dealbreaker to start getting some stuff to cross-compile though. If you intend to have a drop-in replacement, it can be adopted later on.
Does this mean adopting | 16:02:29 | |
Anything that uses strip or install_name_tool will break the signature. | 16:03:36 | |
| There used to be wrappers to work around cctools’s limitations, but those were removed. | 16:04:24 | |
| * | 16:04:46 | |
| The issue with LLD is that it doesn’t support some flags required for compatibility with Xcode projects. It also was missing some features, but I haven’t checked on it in a while. | 16:07:34 | |
| In most cases, it should be fine. | 16:07:44 | |
I see, thanks for the clarifications. I'll try to set up a stdenv using LLD to get to compile hello. I would be very happy not to have to deal with ld64 :P. Also, none of the projects I'm specifically interested in uses Xcode projects, and since the way forward seems to be lld anyway... | 16:10:25 | |
| Also, don’t worry about x86_64-darwin. That platform won’t be available in nixpkgs this time next year. | 16:10:25 | |
Even being able to cross-compile some things will be an improvement. If you do need to go the cctools-port route, I’d suggest setting the platform to non-Darwin and patching it to use rcodesign instead of sigtool. rcodesign can set the linker-signed flag, but its CLI is totally different. | 16:14:07 | |
| And just use LLVM bintools. | 16:14:22 | |
| There are only three we use from cctools right now:
| 16:16:37 | |
| For your situation, LLVM is probably good enough. | 16:16:56 | |
| I plan to try to switch those over to LLVM for 26.05. | 16:17:15 | |
| If we could actually get away with using LLD by default, I’d be willing to consider it, but it had problems on x86_64-darwin building the bootstrap. (Admittedly, that was LLD 16, and we’re on 21 now.) | 16:19:26 | |
Another problem I have with cctools is that it requires
What do you mean by that?
Specifically, I need to cross-build mostly LLVM, Python, node, boost and QEMU.
| 16:21:22 | |
*
Another problem I have with cctools is that it requires
What do you mean by that?
Specifically, I need to cross-build mostly LLVM, Python, node, boost and QEMU.
I gave it a shot but failed, I'll give it another try. | 16:22:11 | |
Download asd.png | 16:23:10 | |
These are the things I'm trying to get to build right now. I still need to figure out the role of libresolv, libsbuf and libutil. Also, apple-sdk. | 16:23:59 | |
apple-sdk provides the stubs and headers used to build packages for Darwin. Some libraries are built from source. libresolv and libutil are some of them. | 16:26:39 | |
I thought swift-corelibs-libdispatch got fixed. I’ll be updating it as part of my Swift work, but right now I keep discovering more horrors trying to bootstrap 6.2. | 16:27:35 | |