Merge pull request #172747 from Gaelan/fpc-aarch64-fix

fpc: fix build on aarch64
This commit is contained in:
Thiago Kenji Okada 2022-05-12 22:02:52 +01:00 committed by GitHub
commit 55c9cdeef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}"