| 20 Mar 2026 |
alexfmpe | I've seen different libffi errors elsewhere, will try to reproduce tomorrow and check against this | 09:02:09 |
sterni (he/him) | In reply to @alex:tunstall.xyz
Of course, then it is necessary to manually add the required paths to the package db after installation.
sterni would you happen to know how to do that, given that you mentioned it?
If not, I will spend some time figuring it out.
I tried your suggestion, and it is indeed in need of something extra for libffi to make the compiler fully functional.
ld.gold: error: cannot find -lffi
It looks like libffi is already in depsTargetTargetPropagated, so I don't understand why it's not made available in package builds. you sed it in after library-dirs and include-dirs I can find you an example later | 09:45:53 |
Alex | I have it in both library-dirs and include-dirs for rts-*.conf yet GHC seems to not even try to link libffi.
I'm looking at the output with vendored libffi and I can't see where it's getting linked, so there's no way to take inspiration from there.
I could try adding -lffi to the ld-options. Is this approach sane? | 22:41:52 |
alexfmpe | keep in mind next ghc release will handle libffi differently | 23:19:42 |
alexfmpe | https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14996 | 23:19:44 |
Alex | Adding -lffi did not work. Somehow none of the library-dirs in rts-*.conf seem to be used; Haskell package builds fail with "error: cannot find -lffi".
It's no surprise that they're changing the libffi handling soon, this is difficult to hack around. | 23:59:52 |
| 21 Mar 2026 |
alexfmpe | I did PR a bump to ghcHEAD precisely to see if it affected the cross libffi shenanigans | 00:24:50 |
alexfmpe | but iserv-proxy doesn't build with it yet | 00:25:07 |
alexfmpe | maybe we just merge your PR as is and revisit when we can test cross on 10.0? | 00:35:21 |
alexfmpe | * maybe we just merge your PR as is and revisit when we can test cross properly on 10.0? | 00:35:37 |
alexfmpe | I also have no idea how the on-demand interpreter will shake things | 00:35:47 |
woobilicious | Lol I got almost no where so far, converting a monomorphic C interface to a typesafe hetrogenous list type is way too complex for my puny brain. | 05:07:12 |
sterni (he/him) | teo (they/he): do you know whether there is already a GHC issues w.r.t. handling of system gmp/libffi in a cross context? I think a fundamental problem in GHC is that it assumes that the same (system) libffi and gmp flags can be passed during every stage, but when e.g. building a cross compiler, stage0 would need to use a different version of those libraries which has been built for the build platform. | 13:59:16 |
sterni (he/him) | I assume that the in tree gmp/libffi handle this just fine since it's recompiled for every stage (?) | 13:59:54 |
sterni (he/him) | One option I see would be to build stage0 without libffi and gmp altogether if that's possible | 14:00:54 |
sterni (he/him) | In any case, context is that I'm currently patching the system libffi handling slightly to special-case stage0 and I want to at least reference some issue, so would be good to have something related already, but can also open a new one. | 14:02:28 |
sterni (he/him) | Not sure if the patch would be upstreamable though I suspect that --with-system-* does not work when building a cross compiler with anything but Nix and with Nix it's sometimes broken if the headers are platform specific (i.e. libffi). | 14:03:17 |
sterni (he/him) | * Not sure if the patch would be upstreamable though I suspect that, currently, --with-system-* does not work when building a cross compiler with anything but Nix and with Nix it's sometimes broken if the headers are platform specific (i.e. libffi). So maybe it would be a net positive. | 14:03:39 |
| @galileocharonvostok1:matrix.org joined the room. | 14:53:20 |
| @galileocharonvostok1:matrix.org left the room. | 14:54:10 |
sterni (he/him) | alexfmpe: Alex: https://github.com/NixOS/nixpkgs/pull/501983 so this is my idea, just letting cc wrapper deal with stage0 (since we're in stdenv anyways) | 16:30:59 |
sterni (he/him) | gonna clean that up, patch doesn't seem too terrible to maintain, may even be upstreamable in some shape or form | 16:31:27 |
Teo (he/him) | I'm not sure if there's an existing issue. Creating one sounds great! https://gitlab.haskell.org/ghc/ghc/-/merge_requests/15231 might cover this but I'm not sure.
Even if it's just nix specific it would be good to have it upstream since then we'd be less likely to break downstream all the time.
| 16:53:41 |
| 20 May 2021 |
| @grahamc:nixos.org set the history visibility to "world_readable". | 22:10:58 |
| @grahamc:nixos.org changed the room name to "" from "". | 22:10:58 |
| @grahamc:nixos.org invited maralorn. | 22:11:05 |
| maralorn joined the room. | 22:11:13 |
| andi- joined the room. | 22:30:49 |
| @grahamc:nixos.orgchanged room power levels. | 22:36:42 |
| Room Avatar Renderer. | 22:46:20 |