From 1508ea570843dd585dabbebac517256c29b6c436 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 22 Jul 2021 19:06:15 +0200 Subject: [PATCH] gnat{6,9,10,11}: don't build libada when building a cross compiler According to https://wiki.osdev.org/GNAT_Cross-Compiler building libada is not possible when building a cross compiler. Unfortunately I haven't been able to determine if this is upstream's position as well, but sure enough disabling libada lets us build a GNAT cross compiler. --- pkgs/development/compilers/gcc/common/configure-flags.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index 997771c2abf..1d75966797b 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -170,8 +170,11 @@ let "--enable-cloog-backend=isl" ] - # Ada options - ++ lib.optional langAda "--enable-libada" + # Ada options, gcc can't build the runtime library for a cross compiler + ++ lib.optional langAda + (if hostPlatform == targetPlatform + then "--enable-libada" + else "--disable-libada") # Java options ++ lib.optionals langJava [