Noob question - Trying to build Clang from LLVM Source, getting linker errors to GLIBC library symbols

Here is my super simple flake.nix:

  description = "A template for Nix based C++ project setup.";

  inputs = {
    # nixpkgs.url = "github:NixOS/nixpkgs/unstable";
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

  outputs = { self, nixpkgs }: {

    defaultPackage.x86_64-linux =
      # Notice the reference to nixpkgs here.
      with import nixpkgs { system = "x86_64-linux"; };
      stdenv.mkDerivation {
        name = "llvm-env";
        src = self;

        # where to find libgcc
        # teach clang about C startup file locations
        CFLAGS="-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version} -B ${}/lib";

        cmakeFlags = [
          # Debug for debug builds
          # inst will be our installation prefix
          # change this to enable the projects you need
          # enable libcxx* to come into play at runtimes
          # this makes llvm only to produce code for the current platform, this saves CPU time, change it to what you need

I run

nix develop --extra-experimental-features "nix-command flakes"

Then follow the steps in this guide to build clang:

However I keep running into “undefined reference to `__isoc23_strtoull’”. I checked and this comes from the library…

My C_INCLUDE_DIRS are /nix/store/ij144ma6vs8acil8r9hgr8xkb1dp9azg-glibc-2.39-5-dev/include
The library is located at /nix/store/35pq4hr29c3sl79lgfwgsvd9nwzyp4am-glibc-2.39-5/lib/
I tried updating LIBRARY_PATH / LD_LIBRARY_PATH to that location but it caused more build issues.

Any ideas on how to fix this?

To add, I checked gcc search directories and the folder above appears in output.

gcc -print-search-dirs | grep glibc

maybe try the latest release channel instead of unstable? iirc there is a glibc version bump and it always causes headaches…