···254 hash = "sha256-2IpdSyye3VT4VB95WurnyRFtdN1lfVtYpgEiUVhfNjw=";
255 })
256 ]
257+ ++ [
258+ # LLVM 19 turned on WASM reference types by default, exposing a bug
259+ # that broke the Mozilla WASI build. Supposedly, it has been fixed
260+ # upstream in LLVM, but the build fails in the same way for us even
261+ # with LLVM 19 versions that contain the upstream patch.
262+ #
263+ # Apply the temporary patch Mozilla used to work around this bug
264+ # for now until someone can investigate what’s going on here.
265+ #
266+ # TODO: Please someone figure out what’s up with this.
267+ #
268+ # See: <https://bugzilla.mozilla.org/show_bug.cgi?id=1905251>
269+ # See: <https://github.com/llvm/llvm-project/pull/97451>
270+ (fetchpatch {
271+ name = "wasi-sdk-disable-reference-types.patch";
272+ url = "https://hg.mozilla.org/integration/autoland/raw-rev/23a9f6555c7c";
273+ hash = "sha256-CRywalJlRMFVLITEYXxpSq3jLPbUlWKNRHuKLwXqQfU=";
274+ })
275+ ]
276 ++ extraPatches;
277278 postPatch = ''