From da2f2d49a6b58e0487bb976b8dd2ac29f27ef2c7 Mon Sep 17 00:00:00 2001 From: Gaelan Steele Date: Thu, 12 May 2022 19:15:20 +0000 Subject: [PATCH] fpc: fix build on aarch64 glibc 2.34 broke it; apply an unreleased patch from upstream --- pkgs/development/compilers/fpc/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix index 4721cac27834..b2c09d806826 100644 --- a/pkgs/development/compilers/fpc/default.nix +++ b/pkgs/development/compilers/fpc/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, gawk }: +{ lib, stdenv, fetchurl, gawk, fetchpatch }: let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in @@ -17,7 +17,14 @@ stdenv.mkDerivation rec { # Patch paths for linux systems. Other platforms will need their own patches. patches = [ ./mark-paths.patch # mark paths for later substitution in postPatch - ]; + ] ++ lib.optional stdenv.isAarch64 (fetchpatch { + # backport upstream patch for aarch64 glibc 2.34 + url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch"; + hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM="; + stripLen = 1; + extraPrefix = "fpcsrc/"; + }); + postPatch = '' # substitute the markers set by the mark-paths patch substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by dynlinker-prefix "${glibc}"