{ stdenv, lib, fetchFromRepoOrCz, perl, texinfo, which }: stdenv.mkDerivation rec { pname = "tcc"; version = "unstable-2021-10-09"; src = fetchFromRepoOrCz { repo = "tinycc"; rev = "ca11849ebb88ef4ff87beda46bf5687e22949bd6"; sha256 = "sha256-xnUDyTYZxbxUCblACyX73boBhU073VRqSy1SWlWsvIw="; }; nativeBuildInputs = [ perl texinfo which ]; hardeningDisable = [ "fortify" ]; postPatch = '' patchShebangs texi2pod.pl ''; configureFlags = [ "--cc=$CC" "--ar=$AR" "--crtprefix=${lib.getLib stdenv.cc.libc}/lib" "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" "--libpaths=${lib.getLib stdenv.cc.libc}/lib" # build cross compilers "--enable-cross" ] ++ lib.optionals stdenv.hostPlatform.isMusl [ "--config-musl" ]; preConfigure = '' echo ${version} > VERSION configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)") ''; postFixup = '' cat >libtcc.pc <