Building kernel 5.16.9 from source fails, how to downgrade dwarves/pahole

I am trying to build a specific commit from kernel 5.16.9 fetched from the stable kernel repo. Purpose being that I have to find a bug which first occurred on my machine starting with kernel 5.16.10. I use the following approach:

{ pkgs, ... }:

  boot.kernelPackages =
      linux_pkg = { fetchgit, buildLinux, ... } @ args:

        buildLinux (args // rec {
          version = "5.16.9";
          modDirVersion = version;

          src = fetchgit
              url = "";
              rev = "91fc147";
              sha256 = "Dz+CpecLcVU/jA00gCnOenDhL8yYzMxM58uCXcTtzj0=";

          kernelPatches = [ ];

          extraMeta.branch = "5.16";
        } // (args.argsOverride or { }));
      linux_5-16-9 = pkgs.callPackage linux_pkg { };
    pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_5-16-9);

However the build itself fails with the follow error that I cannot really wrap my head around:

error: builder for '/nix/store/bmmnyw3mimg3x01x9l8v396dn7vbqkj5-linux-5.16.9.drv' failed with exit code 2;
       last 10 log lines:
       >   KSYMS   .tmp_vmlinux.kallsyms2.S
       >   AS      .tmp_vmlinux.kallsyms2.S
       >   LD      vmlinux
       > /nix/store/pnajkjw1fz03z1x27ski1qbx9n3hd4df-binutils-2.39/bin/ld: warning: .btf.vmlinux.bin.o: missing .note.GNU-stack section implies executable stack
       > /nix/store/pnajkjw1fz03z1x27ski1qbx9n3hd4df-binutils-2.39/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
       > /nix/store/pnajkjw1fz03z1x27ski1qbx9n3hd4df-binutils-2.39/bin/ld: warning: vmlinux has a LOAD segment with RWX permissions
       >   BTFIDS  vmlinux
       > FAILED: load BTF from vmlinux: Invalid argument
       > make: *** [../Makefile:1161: vmlinux] Error 255
       > make: *** Deleting file 'vmlinux'
       For full logs, run 'nix log /nix/store/bmmnyw3mimg3x01x9l8v396dn7vbqkj5-linux-5.16.9.drv'.

How to fix this and get kernel 5.16.9 working? I’ve been googling a bit, but I am not really sure what to do. I found something about compiling the kernel with a different version of pahole or dwarves, but I am unsure how to implement that in nix.

I found a suggestion here:

The guy on the mailing list mentions this: “Perhaps, .tmp_vmlinux.btf is generated incorrectly? Downgrading dwarves to v1.23 resolves the issue.”

So how would I go about downgrading dwarves to v1.23 for my kernel build?

I guess I could rephrase my question like so: How do I override the nativeBuildInputs for buildLinux as they are found here including pahole: nixpkgs/manual-config.nix at eb95aa0392d4a6f0eb3ac66eb0329397eafde4fb · NixOS/nixpkgs · GitHub

Because then I could just import an older nixpkgs for NixOS 22.05 instead of 22.11 which I am using right now and get pahole version 1.23 this way. Which supposedly would solve the build problem.